Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

reverse shopping cart product list


Guest

Recommended Posts

Posted

Hi,

 

I would like to reverse the order of the products displayed in the clients shoppping cart, so the latest added product is displayed first.

 

If somebody could give a hint what code I need to modify, I would appriciate very much.

 

thank you in advance

 

David

Posted

Remember to bakup first.

 

In shopping_cart.php at approximately line 77 fin this.

 

[/code]

for ($i=0, $n=sizeof($products); $i<$n; $i++)

 

Instead of 0 set $i to sizeof($products), equvalancy now has to be $i > 0 so that it will stop at 0. You have to decremtn $i instead of incrementing it.

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

Posted

hi

 

i tried to set

 

"for ($i=sizeof($products), $n=sizeof($products); $i>0; $i--)"

 

as proposed, but no result. (or did i understand something wrong)

The shopping cart displays exactly as before...

 

 

The shopping_cart.php file I use is modified by 1 contrib:

http://www.oscommerce.com/community/contri...inimum+quantity

 

 

Am i doing something wrong in this ?

 

thanks for feedabck

Posted
hi

 

i tried to set

 

"for ($i=sizeof($products), $n=sizeof($products); $i>0; $i--)"

 

as proposed, but no result. (or did i understand something wrong)

The shopping cart displays exactly as before...

The shopping_cart.php file I use is modified by 1 contrib:

http://www.oscommerce.com/community/contri...inimum+quantity

Am i doing something wrong in this ?

 

thanks for feedabck

 

for ($i=($n-1); $i>=0; $i--) {

Treasurer MFC

Posted

ok

 

it's solved now:

 

solution was on line 103, where the same string was found.

 

so

 

replaced

line103

 

" for ($i=0, $n=sizeof($products); $i<$n; $i++) "

 

with

 

" for ($n=sizeof($products), for ($i=($n-1); $i>=0; $i--) "

 

 

thanks for your help !

Posted

ok

 

it's solved now:

 

solution was on line 103, where the same string was found.

 

so

 

replaced

line103

 

" for ($i=0, $n=sizeof($products); $i<$n; $i++) "

 

with

 

" for ($n=sizeof($products), $i=($n-1); $i>=0; $i--) "

 

 

thanks for your help !

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...