clear all carts at midnight

  • Posts: 114
  • Thank you received: 4
7 years 5 months ago #270600

-- HikaShop version -- : 3.1
-- Joomla version -- : 3.7
-- PHP version -- : 7.1

How can I clear all carts at mightnight (server time) every day? Would that need a cronjob or can Hikashop handle that?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 5 months ago #270602

You would need a cron job to run a MySQL query to empty both the hikashop_cart and the hikashop_cart_product tables.
stackoverflow.com/questions/21196613/run...-query-as-a-cron-job

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

  • Posts: 114
  • Thank you received: 4
7 years 5 months ago #270706

So I cant use the built-in cron task in Hikashop?

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 5 months ago #270707

Hello,

The HikaShop cron system is there to call your website with a specific period but it cannot assure you that your cron-job will be called a exactly midnight.
It would be better for you to create a specific cron entry via your hosting so it will be executed at midnight (and only once a day).
Otherwise, you can do things thanks to custom plugin but you'll need to introduce checks and "securities" in order to be sure to clean your carts once a day, etc.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum