![]() |
Order of items added to cart
When someone ads an item to the shopping cart is there anyway to have that item appear on the top of the list in the cart?
I am just thinking that when they add and item to the cart they will want to verify what they just added as being correct and if they have 20 items in their cart they are going to have to scroll all the way to the bottom to find the item they just added to verify it but if it appeared at the top it would be the first item they would see. Thanks |
Re: Order of items added to cart
Interesting idea... this should work. In /include/cart_process.php in the func_add_to_cart function, around line 248 you can see where it tacks the latest addition on the end of an array, it looks like this:
$cart["products"][] = array( ... etc etc Change $cart['products'][] to $temp_arr[] then after the array is defined do this array_unshift($cart['products'],$temp_arr); I don't know if thats all you'd need to do, but it'd be a quick fix and worth a shot. |
Re: Order of items added to cart
all you need to do is edit cart.tpl and look for the section loop for the products and change the stepping to -1
|
Re: Order of items added to cart
Looking in /customer/main/cart.tpl
I find this section: {section name=product loop=$products} {if $products[product].hidden eq ""} <tr><td class="PListImgBox"> <a href="product.php?productid={$products[product].productid}">{if $products[product].is_pimage eq 'W' }{assign var="imageid" value=$products[product].variantid}{else}{assign var="imageid" value=$products[product].productid}{/if}{include file="product_thumbnail.tpl" productid=$imageid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].pimage_url type=$products[product].is_pimage}</a> What do I change to -1? |
Re: Order of items added to cart
Yeah, i guess that would be easier, but you'll probably have to do this in more than one place (mini cart, etc).
{section name=product loop=$products step="-1"} |
Re: Order of items added to cart
Thanks it works perfectly!
|
All times are GMT -8. The time now is 02:09 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.