Magento E-commerce Platform Q/ A

Email Notification of Magento 'Contact Us' Form Submitter

The feature notifies the user who submits 'Contact Us' form on site (the notification will be delivered to the indicated by the user email address).

See the image:

248

The notification message example:

249

To enable the feature:

1. We will extend Contacts settings with the ability to Enable/ Disable notification and the ability to choose the template of the notification to send to the user.

Add file system.xml into the module folder:

How to Automatically Convert Simple Products to Bundle in Magento

The feature might be useful for the stores dealing with large and often updated inventory. In order not to convert each product manually after each inventory update to existing bundle products it is possible to make the process automated.

First we will create the observer that will be performing the function each time a new product is saved.

Announce the observer in config.xml file:

How to Add a Category Tree with Checkboxes (Admin Interface) into a Custom Magento Module

In Tabs.php file of custom module in  _beforeToHtml method we will add a custom tab after the main (default) tab and will place a category tree there:

$this->addTab('category_tree_tab', array(
		'label'     => Mage::helper('catalog')->__('Category Tree Tab'),
		'url'       => $this->getUrl('modulename/adminhtml_index/categories', array('_current' => true)),
		'class'     => 'ajax',
	));

 

Then in parameter url we should indicate the path to a method categoriesAction (method presented below)

Custom Redirect from a Category Page in Magento

Let's assume your customer needs to redirect store users when they click on some category link to some particular product page. You can do it by creating a simple module. 

The structure of the etc/config.xml file:

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.

 

How to Setup Magento Scripts

In order to add a new table into Magento database you need to determine Setup Resource class in config.xml

Instantiating Magento Blocks, Models, Helpers and Controllers

Usually Magento organizes its code in the individual modules. Typical Model-View-Controller (MVC ) application stores all controllers in one folder, all models in another folder etc. But Magento groups all files together and these files are called: “Modules”.  For example, in Magento you'll be able to find Controllers, Models, Helpers, Blocks, etc that are related to the Catalog functions in:

Magento Module Setup system.xml (Part 2)

 

System.xml (Part 2)

You can review Part 1 here

To set the fields specify the following tags:

Magento Module Setup system.xml (Part 1)

 

System.xml (Part 1)

Magento is highly customizable and have lots of pre-built configurations. All of it could be found in: System -> Configuration. Any module could add specific parameters into that interface. New fields, groups and tabs – it all could be added with the help of the configuration file: system.xml.

 

Magento Module Setup (Part 2)

Part 2

You can find Magento Module Setup (Part 1) here

Now let's take a look at the section: acl