Magento Themes and Magento Extensions

Disable state/province option in the Magento

Share
Posted on April 1st, 2013 | Posted by admin

Sometime your Magento site doesn’t need the region/state for customer address and you don’t know how to turn it off without touching in many places in the complex source code. Please try to run following SQL statements to try

1
2
update core_config_data set `value`=0 where path = 'general/region/display_all';
update core_config_data set `value`='' where path = 'general/region/state_required';

Magento Check if Home page is Current Page

Share
Posted on March 26th, 2013 | Posted by admin

There is no built-in default function to check if the current page is the home page in Magento. But it doesn’t stop you from writing your own.

One way to do so is:

1
if ( $_SERVER['REQUEST_URI'] == "/" || $_SERVER['REQUEST_URI'] == "/index.php" )

Magento : how to set the same order increment id for all stores

Share
Posted on March 6th, 2013 | Posted by admin

Magento in default sets different order increment id for each of you magento store or store views.
Here is simple fix to set the same order increment id for all your store.
Run the following code once from anywhere within your site.

Mage::getModel(‘eav/entity_type’)
->loadByCode(‘order’)
->setIncrementPerStore(false)
->save();

Magento In Maintenance Mode

Share
Posted on December 20th, 2012 | Posted by admin

Magento In Maintenance Mode
So here is a little bit of code, that allows you and other you set to work on the site while everyone else sees its maintenance mode.

All we need to do it edit 3 lines.

Open: index.php in root and above line 57 add (remembering to edit the ‘allowed’ array to contain the IP’s you want to be able to access the site);

Add Static Block to Magento cms Page by updating the Design Layout XML

Share
Posted on December 19th, 2012 | Posted by admin

This is a very simple task.
Once you created the Static Block, simply go to CMS -> Manage Pages. Select your Page or create a new one.
Click on the Design tab on the left and paste the following code to the “Layout Update XML” textarea.
(Also, don’t forget to select the Layout, eg.: 2 columns with left (or right) bar)

<reference name="left">
    <block before="-" name="block-name" type="cms/block">
        <action method="setBlockId"><block_id>block-id</block_id></action>
    </block>
</reference>
Page 4 of 12« First...«23456»10...Last »