Page 1 of 1

How to extend customer shopping cart duration?

Posted: Sun Apr 17, 2016 7:18 pm
by JGAN
How can I set the shopping cart for customers who are not logged in to last a week instead of a day?

Re: How to extend customer shopping cart duration?

Posted: Mon Apr 18, 2016 9:20 pm
by oc-extensions
Hi,

In last versions of opencart, cart is considered expired if is older than 1 hours and is not set customer_id

Check system/library/cart/cart.php and will find:

Code: Select all

// Remove all the expired carts with no customer ID
		$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR)");
So, if you want to keep this "expired carts" for 7 days then change

Code: Select all

// Remove all the expired carts with no customer ID
		$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 7 DAY)");

Re: How to extend customer shopping cart duration?

Posted: Wed Apr 20, 2016 1:07 am
by JGAN
Thanks!!