Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Display Added Products in Cart, in Reverse -- one line code.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-22-2003, 01:05 AM
 
Alan Alan is offline
 

Advanced Member
  
Join Date: Feb 2003
Posts: 83
 

Default Display Added Products in Cart, in Reverse -- one line code.

Hello X-carters.
X-cart displays products added from top to bottom (oldest to newest),
Customers might find it irritating to scroll down your Cart page, to see if s/he added the products successfully.

A very simple 1 liner code to display them from Newest added to Oldest.

In your {x-cart-skin1-dir}/customers/main/cart.tpl locate line no.14:
Code:
{section name=product loop=$products}
Ammend this code to
Code:
{section name=product loop=$products start=-1 step=-1}

1. Start=-1 <=> Tells loop to start at the end of array
2. Step =-1 <=> loops backward 1 step at a time

Hope it helps some of you out.
__________________
Best Regards!
Alan
Search is my friend
Reply With Quote
  #2  
Old 04-22-2003, 01:47 AM
 
magnumkp magnumkp is offline
 

eXpert
  
Join Date: Apr 2003
Location: England
Posts: 304
 

Default

I thought this was already a feature. In the General Settings there is:
"List products in reversed order" with a tick box. (I've got 3.3.4 IIRC) Dunno if this is what it does though.
Reply With Quote
  #3  
Old 04-22-2003, 03:07 AM
 
Alan Alan is offline
 

Advanced Member
  
Join Date: Feb 2003
Posts: 83
 

Default

Hello Magnumkp,

Actually this small tweak is for the pre-checkout cart page.

Customer JonDoe buys "some candles", the cart will show
---------------
Some Candles
---------------

He then add to cart "K-Y-Jelly", and then add to cart "Hand Cuffs".

The cart will now show
-----------------
Some Candles
K-Y-Jelly
Hand Cuffs
-----------------

JonDoe might get frustrated because he have to scroll down to see his newly added products. If we make the cart display products like
-----------------
Hand Cuffs
K-Y-Jelly
Some Candles
-----------------

It'd be more convenient for our customers, in my H. opinion

So JonDoe happily purchases his goods, and off he goes to do stuff that we won't disguss in this thread.

***Disclaimer*** GoodOrient does not in anyway, any circumstances, sell hand cuffs and K-Y-Jellies. However we do have some lovely candles if it fancies you.
__________________
Best Regards!
Alan
Search is my friend
Reply With Quote
  #4  
Old 07-23-2005, 04:18 AM
 
bluecat bluecat is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 674
 

Default

Works in 4.0.14, thanks.
__________________
--------------------
X-Cart Gold 4.1.11
Linux/Apache
--------------------
Reply With Quote
  #5  
Old 02-04-2007, 01:13 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 477
 

Default Re: Display Added Products in Cart, in Reverse -- one line code.

nice, thanks!
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:48 AM.

   

 
X-Cart forums © 2001-2020