When a visitor adds items to his shopping cart in my site, they seem to appear at the top of the list of cart items in the shopping cart page, when what I’m used to–and what I’d like–is for them to appear at the bottom of the list.
How can I reverse the order of the items?
Actually, I solved my own problem!
For all those who are interested:
In views/checkout/components/cart_items.tpl
{* addition, begin *}
{assign var="h_item_list_reversed" value=""}
{* addition, end *}
{foreach from=$cart_products item="product" ...}
{* addition, begin *}
{capture name=$h_current_item}
{* addition, end *}
{hook name="checkout:items_list"}
...
{/hook}
{* addition, begin *}
{/capture}
{* Prepend the current item list with the current item. *}
{assign var="h_item_list_reversed" value=$smarty.capture.$h_current_item|cat:"$h_item_list_reversed"}
{* addition, end*}
{/foreach}
{* addition, begin *}
{* Display the item list in reverse order. *}
{$h_item_list_reversed}
{* addition, end *}