Magento E-commerce Platform Q/ A

Ways to Enable or Add Custom Breadcrumbs in Magento

There are some pages in Magento with no breadcrumbs enabled by default. In order to enable it, for example, on the checkout page, open checkout.xml file stored in 'layout' folder of the current theme, and find there 'checkout_onepage_index' block.  Then add to the block this code:

How to Add a Custom Footer to Email Templates in Magento

Here's the example of the footer and how to do it:

247

Namespace - Ikantam

Module - EmailFooter

In the example the footer text is extracted from a readymade template. Since templates might be both text and html, the appropriate footer should be applied to each, i.e. for the html templates – html footer template, for the text templates – text footer template. How to create custom email templates you can read here

 

Creating Recursive Menu in Magento

In order to create the menu a function need to be added. The function that will receive the ID of the parent (main) categories as an argument and will be displaying child categories. Also the function should check presence of the sub-categories each time a child category is called.  

Here's the example of the 'recursive' function:

How to Add a New Tab to a Category in Magento

To add a new magento category tab (manage categories page/ admin area), rewrite or simply copy the file from: core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php to: local/Mage/Adminhtml/Block/Catalog/Category/Tabs.php.

Next in _prepareLayout method after this code:

$this->addTab(’products’, array( 
‘label’ => Mage::helper(’catalog’)->__(’Category Products’), 
‘content’ => $this->getLayout()->createBlock(’adminhtml/catalog_category_tab_product’, ‘category.product.grid’)->toHtml(), 
));

 

Add this one:

How to Add Custom Renderer to Magento Grid

Magento Grid – a very handy tool for flexible data display. In Magento it is usually  presented as a table. There is a possibility to modify tables if necessary.

To do this, you need to add a column to Magento grid and overwrite the default renderer with a custom one.

In the example below, instead of product id we will be displaying product image in 'Product' id column.  You can see default meaning of the column (before customization):

235

Use this code to add a custom renderer:

Magento: Custom Input Types in Custom Options

Magento by default supports about 10 input types for the product custom options. In order to create a custom one first of all it is necessary to add a possibility in Magento admin area to indicate this custom attribute:

File 'config.xml'

How to Create E-mail Templates in Magento

To create a custom e-mai template in Magento, you need to specify it in the config.xml file of the module.  Example: Place this code between the tags

Magento Product Ratings and Reviews

There is prebuilt product ratings and reviews functionality in Magento. By default all reviews and ratings should be approved by the store owner via Magento admin panel.

Store users can rate (review) products by clicking the link on the product page.

214

 

At the product page users see the form to leave a comment to the product and rate it by assigning it 1-5 star rating.

215

 

 

Magento Source Model

Source model serves to insert the data into the certain fields: checkboxes, multi selects, radios, selects in admin area: System- > Configuration.

 

To indicate Source Model for the field, add tag: <source_model> and define source model in it

<source_model>adminhtml/system_config_source_allregion</source_model>

The field must contain tag: <frontend_type> with one of the values: сheckbox, multi select, radio or select.

 

Magento Multi-Language

Introduction

Magento is a flexible platform to create personalized e-commerce solutions (web shops). One of Magento important features is multiple languages support. Thanks to this feature the platform usage grows all over the world. In this article you will learn how to add language/s to your Magento shop.

 

Adding another language to the website

In order to add one more (or a couple) of language/s the first thing to do is to create Store View.

173