Post by rbelusa » Tue Feb 14, 2012 6:18 am

Hello Everyone,

i really want to show the products in the basket ordered by date. Version 1.5.1.3

in the Cart.tpl the products should look like:


1. Product A added to cart on: 17.02.2012 18:14
ProductOptions ....
2. Product B added to cart on: 15.02.2012 11:22
ProductOptions ....

Hope somebody knows how to do this update to the cart.

best
Ralf

Newbie

Posts

Joined
Fri Sep 16, 2011 2:38 am

Post by d7a7z7e7d » Tue Feb 14, 2012 11:21 am

Hi Ralf,

Open /system/library/cart.php and look at the add function. You see how it's writing the cart data to a session variable, where the $key is basically the product id and the value ends up being the quantity added? Well, you could accomplish what you want by adding another session variable along side this one, maybe something like:

Code: Select all

$this->session->data['cart_date'][$key] = date('y-m-d',time());
Then, in the getProducts function, you could retrieve this date and pass it back along with the rest of the product data. From there, you'd edit /catalog/controller/checkout/cart.php and pass this data to the view. In the view (catalog/view/theme/default/template/common/cart.tpl) you'd just echo out the date value there.

Hope this helps!

Image
OpenCart Extensions, Technical Support & Custom Development | Have I helped you?


User avatar
Active Member

Posts

Joined
Fri Sep 17, 2010 5:51 am
Location - USA

Post by rbelusa » Wed Feb 15, 2012 7:56 am

many thanks. Wonderful. nearly covers what i need. Have to do further investigations how to solve my problem.

Newbie

Posts

Joined
Fri Sep 16, 2011 2:38 am
Who is online

Users browsing this forum: No registered users and 4 guests