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
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:
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!
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());
Hope this helps!
OpenCart Extensions, Technical Support & Custom Development | Have I helped you?
Who is online
Users browsing this forum: No registered users and 4 guests