Guest Posted October 16, 2006 Posted October 16, 2006 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
ComicWisdom Posted October 16, 2006 Posted October 16, 2006 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!
Guest Posted October 17, 2006 Posted October 17, 2006 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
boxtel Posted October 17, 2006 Posted October 17, 2006 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
Guest Posted October 17, 2006 Posted October 17, 2006 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 !
Guest Posted October 17, 2006 Posted October 17, 2006 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 !
Recommended Posts
Archived
This topic is now archived and is closed to further replies.