[SOLVED] How to extend customer shopping cart duration?
Posted: Sun Apr 17, 2016 7:18 pm
How can I set the shopping cart for customers who are not logged in to last a week instead of a day?
OpenCart Community Forum - Discuss shopping cart and e-commerce solutions.
https://forum.opencart.com/
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)");
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)");
Code: Select all
// Remove all the expired carts with no customer ID
$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE (api_id > '0' OR customer_id = '0') AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR)");
Code: Select all
// Remove all the expired carts with no customer ID
$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE (api_id > '0' OR customer_id = '0') AND date_added < DATE_SUB(NOW(), INTERVAL 7 DAY)");