Magento has lots of blocks that display in the left and right columns (based on your layout). Changing the order in which they are displayed or sorted is easy. Navigate to the folder “app\design\frontend\default\YOUR_THEME\layout”. In this folder, there are several XML files which are called Layouts.
Magento Layouts are the tools with which you can assign content blocks to each structural block you create. Layout exists in the form of XML text-file and by modifying the layout you are able to move blocks around in a page and assign templates to the content blocks to produce markup for the structural blocks.
To change the order, find a block you want to change. So if I wanted to display the products compared side box first in my left column, I would do by adding before=”-” as an attirbute to it’s xml node. Now, save it and upload. That’s it!
1 2 3 |
<reference name="left"> <block type="core/template" before="-" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/> </reference> |
Here some other ways to order blocks.
To display as the First block:
1 |
before="-" |
To display as the last block:
1 |
after="-" |
To display before any other block:
1 |
before="block_name" |
To display after any other block:
1 |
after="block_name" |
Thanks so much for this post! You saved my life! This totally makes sense now 🙂
Cleared up the problem I had in seconds! Thanks for the useful post 🙂
Thanks!! It’s so simple once you know it :).
Thanks a lot man!!
Thanks a lot Richard, one question. i have Most Popular blocks on the left display more than 10 products how can i make it only 5?
I have been looking all over for this… I am too used to working with OsCommerce I think. Thanks for the help here.
A great help thank you.
Thank you so much for this, it can save me a lot of time brilliant.
Very helpful with magento core blocks, how do I get this to work with custom blocks, I want the tags block to appear last in my left column, I changed the layout file to read;
refreshed and dumped cache, block still not appearing after the left_column_payment block?
Any help would be appreciated.
thanks
Would be able to tell me how to set order of a widget in the felt column?
thanks
Your site contain a many useful information, thanks.
Hmmm. If I place that code on my layered_nav box it stop displaying anything at all…
Hi,
Thanks for the post very helpful, playing with before/after but still can’t get the blocks to get exactly where I want them!!
Thanks
Hah, dude, helped me so much! Thanks a lot 😀
For interest, there is Reorder Product List for Magento 2 extension which allows showing all ordered products as a list so that customers can reorder at ease.
Check it here: http://bsscommerce.com/reorder-product-list-for-magento-2.html