Abandoned carts are not deleted

  • Posts: 196
  • Thank you received: 15
  • Hikashop Business
6 days 1 hour ago #372945

Hi,
Despite setting the cart expiration to 30 days, abandoned carts are not being deleted. Thousands of records have accumulated. How do I restore functionality and delete the outdated carts? The cron job is running.
Tom

Please Log in or Create an account to join the conversation.

  • Posts: 86027
  • Thank you received: 14170
  • MODERATOR
5 days 11 hours ago #372950

Hi Tom,

The removal of the old carts is not done by the cron. It is done when a page of the HikaShop backend is displayed, and only once per period configured in the "Frequency of the check for the carts" setting, in the Advanced tab of the HikaShop configuration. The "Last check" date displayed just below that setting tells you when it ran for the last time.

And each check only removes a limited number of carts, 200 by default, so that it does not slow down the page. With thousands of old carts, it therefore takes many checks to catch up. You can raise that limit by adding an entry with the namekey cart_batch_removal_quantity and the value you want, for example 5000, in the hikashop_config table of your database with phpMyAdmin.

To remove the backlog in one go instead, make a backup of your database and run these two queries with phpMyAdmin, after adapting the prefix of the tables and, if needed, the 2592000 seconds which correspond to your 30 days:

DELETE FROM jos_hikashop_cart_product WHERE cart_id IN (SELECT cart_id FROM jos_hikashop_cart WHERE cart_type = 'cart' AND cart_modified < UNIX_TIMESTAMP() - 2592000);
DELETE FROM jos_hikashop_cart WHERE cart_type = 'cart' AND cart_modified < UNIX_TIMESTAMP() - 2592000;

We're going to improve this for the next version of HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 196
  • Thank you received: 15
  • Hikashop Business
4 days 2 hours ago #372964

Thank you, I'm waiting for the update :)
Tom

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum