Monday, January 25, 2010

Image Magic code

This post is for those who are new to image magic and want to start with something.

This simple command will merge two images and output with the third or overwrite any image.

exec("composite -geometry +0+30 -gravity north ".$uploadDir.$thumb." ".$uploadDir.$imgnm." ".$uploadDir.$imgnm."");

Make sure that both files before this command executed.

To know more about Image Magic CLICK HERE

Setting Cron Jobs

Path to your cron job must be DOCUMENT_ROOT/filename.php

Note: Always include any files from the DOCUMENT_ROOT path for example /home/sites/yourdomain/public_html/filename.php

To know more about cron CLICK HERE

Wednesday, January 20, 2010

Getting product attributes values and labels in Magento

This is how you can get the particular attribute value:

$_product
->getResource()->getAttribute('desired_attribute_code')->getFrontend()->getValue($_product);


how to set the Column number in magento

You need to change in catalog.xml

Search for setColumnCount


Monday, January 18, 2010

Contact Form in Magento

There are cases when you would like to give your client an option to edit some intro text, edit his phone numbers, edit text behind the form, etc. You are probably guessing that it would be nice to be able to embed contact form in some CMS page. No problem.

  • Go to your CMS> Manage Pages interface
  • Once there, input your HTML as you normally would on any other page
  • Once you are happy with HTML part, add this lines:

    {{block type="core/template" name="contactForm" template="contacts/form.phtml"}}
Note: While writing above code please make sure that you are in the source view of Editor.

Click Here to know more.