- Posts: 114
- Thank you received: 4
clear all carts at midnight
9 years 4 months ago #270600
by peteo
clear all carts at midnight was created by peteo
-- 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?
-- 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.
9 years 4 months ago #270602
by nicolas
Replied by nicolas on topic clear all carts at midnight
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
stackoverflow.com/questions/21196613/run...-query-as-a-cron-job
Please Log in or Create an account to join the conversation.
9 years 4 months ago #270706
by peteo
Replied by peteo on topic clear all carts at midnight
So I cant use the built-in cron task in Hikashop?
Please Log in or Create an account to join the conversation.
9 years 4 months ago #270707
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic clear all carts at midnight
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,
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.
Please Log in or Create an account to join the conversation.
Time to create page: 0.186 seconds