- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Magento. How to change blocks order
November 18, 2015
This tutorial shows how to change blocks order in Magento templates.
Magento. How to change blocks order
Sidebar blocks can be rearranged in one of the template files. Use either FTP or hosting cPanel to reach it. Open the following file on server /app/design/frontend/tm_themes/themeXXX/layout/local.xml. Use any HTML editor to check its content, locate the following piece of code:
simple checkout/cart_item_renderer checkout/cart/sidebar/default.phtmlgrouped checkout/cart_item_renderer_grouped checkout/cart/sidebar/default.phtmlconfigurable checkout/cart_item_renderer_configurable checkout/cart/sidebar/default.phtml
Update the reference name to be
This allows using before="-" and after="-" tools to reorder the sidebar blocks. Insert the actual block name instead of hyphen.
Let’s reorder ‘Shop By’ and ‘My Cart’ blocks as an example:
-
Locate the following line in the local.xml file:
checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-"> before="-"is the value to update.
-
Specify if you want to have cart before or after the Shop By filter. Let’s put it after Shop By filter. Code should be eventually updated as follows:
The same values can be changed for other sidebar blocks. Update the file once all modifications are applied.
Note: you might need to rebuild the index and clear cache to apply the changes.
Get back to the category page and refresh it. Sidebar blocks have been successfully reordered.
Feel free to check the detailed video tutorial below: