Magento: Add new tab under system configuration

First of all need to add system.xml file in module etc folder and following code put into system.xml file.


<config>
    <tabs>
        <tabname translate="label" module="modulename">
            <label>Module Name</label>
            <sort_order>100</sort_order>
        </tabname>
    </tabs>
   <sections>
        <modulename translate="label" module="modulename">
            <label>Title Goes Here</label>
            <tab>tabname</tab>
            <frontend_type>text</frontend_type>
            <sort_order>10</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>0</show_in_store>
            <groups>
                <columns translate="label">
                    <label>Settins Title-1</label>
                    <sort_order>100</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <fields>
                        <isenabled translate="label">
                            <label>Options-1</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_yesno</source_model>
                            <sort_order>10</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                        </isenabled>
                    </fields>
                </columns>
                <credential translate="label">
                    <label>Settins Title-1</label>
                    <sort_order>200</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <fields>
                        <user translate="label">
                            <label>Options-1</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                        </user>
                        <pass translate="label">
                            <label>Options-1</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>30</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                        </pass>
                    </fields>
                </credential>
            </groups>
        </modulename>
    </sections>
</config>

Continue reading

Updating product prices in magento in easier faster way

Product prices can be updated via default import profile though but this is very slow and requires lots of csv fields(besides sku & price) for updating.
Today i am going to talk about updating product prices just by using csv with two fields: sku & price(new) which is very fast enough even for thousands of products.

Steps:

1> Prepare CSV file(prices.csv) with two fields: sku & price and upload in the root of Magento installation.
You can see the snapshot how it should look like:
prices

Continue reading

How to remove index.php from url in magento

Use the following steps to access your Magento URL without index.php,

1) Login to admin section by using the URL

http://domain.com/index.php/admin

2) Go to “System >> Configuration >>Web >> Search Engines Optimization”
Use Web Server Rewrites : YES
3) Go to “System >> Configuration >>Web >>Secure”
Use secure URL Frontend: YES
Continue reading

Magento: Get controller, module, action and router name

Get Controller and Action name in template files:

/**
 * get Controller name
 */
$this->getRequest()->getControllerName();
 
/**
 * get Action name, i.e. the function inside the controller
 */
$this->getRequest()->getActionName();
 
/**
 * get Router name
 */
$this->getRequest()->getRouteName();
 
/**
 * get module name
 */
$this->getRequest()->getModuleName();

Continue reading