Thursday 11 February 2016

Magento Add custom image attribute to category


 Just copy paste the below code in header.phtml and run your magento once, your attribute will be created and you can see in backend under manage category. After you are done remove this code again.
 
<?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->addAttribute('catalog_category', 'sliderimage2', array(
    'group'         => 'General',
    'input'         => 'image',
    'type'          => 'varchar',
    'label'         => 'Slider Image 2',
    'backend'       => 'catalog/category_attribute_backend_image',
    'visible'       => 1,
    'required'        => 0,
    'user_defined' => 1,
    'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
)); ?>

Tuesday 2 February 2016

How to change the Magento Email Templates

You’ll probably know by now that the transactional email templates in Magento are a bit, with respect, “naff”. To edit through the admin will take forever and a day so here’s a couple of useful solutions to help make things easier.


Locate the email templates.
The Magento email templates are located in (note: “en_US” may change depending on language).
magento\app\locale\en_US\template\email\account_new.html”:
magento\app\locale\en_US\template\email\admin_password_new.html”:
magento\app\locale\en_US\template\email\sales\newsletter_subscr_confirm.html”:
magento\app\locale\en_US\template\email\sales\order_creditmemo.html”:
magento\app\locale\en_US\template\email\sales\order_creditmemo.html”:
magento\app\locale\en_US\template\email\sales\order_invoice.html”:
magento\app\locale\en_US\template\email\sales\order_invoice.html”:
magento\app\locale\en_US\template\email\sales\order_new.html”:
magento\app\locale\en_US\template\email\sales\order_new.html”:
magento\app\locale\en_US\template\email\sales\order_shipment.html”:
magento\app\locale\en_US\template\email\sales\order_shipment.html”:
magento\app\locale\en_US\template\email\sales\order_update.html”:
magento\app\locale\en_US\template\email\password_new.html”:
magento\app\locale\en_US\template\email\wishlist_share.html”:

Magento add CMS Static Block underneath categories in left sidebar

Paste below xml code in custom design part  for call static block after left navigation.

 <reference name="left">
<block type="cms/block" name="book_left_block" after="catalog.leftnav">
<action method="setBlockId"><block_id>book_left_block</block_id></action>
</block>
</reference>

For remove left navigation from left sidebar.
 <reference name="left">
<block type="cms/block" name="book_left_block" after="catalog.leftnav">
<action method="setBlockId"><block_id>book_left_block</block_id></action>
</block>
<remove name="catalog.leftnav" />
</reference>