recurring discount

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
3 years 1 week ago #337031

-- HikaShop version -- : 4..1.1
-- Joomla version -- : 3.10.2
-- PHP version -- : 7.4.x

Hello,

Is there the option within Hikashop to set a recurring discount? For example, every Thursday a 10% discount on a certain category or product?
Or is there a specific plugin for this?

Regards,
Michiel

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 1 week ago #337051

Hi,

There is no direct option to do that.
However, you could create a mass action with a trigger "every week" and an action "run MySQL query" and the MySQL query being:

UPDATE #__hikashop_discount SET discount_start = discount_start + 604800, discount_end = discount_end + 604800 WHERE discount_code = 'XXX';
and you need to replace XXX by the code of the discount you wish to make recurring.
Note that 604800 is the number of seconds in 1 week.
Note also that this require the cron task to be running : www.hikashop.com/support/documentation/5...ashop-cron-task.html
Note also that this mass action will run once directly after the next tic of the cron task. So you should create that mass action when the validity of the discount is in the past, less than 1 week.
For example, if I create a discount for tomorrow and I want it to be recurring, I need to wait 2 days to create the mass action.
Finally, note also that after you create the mass action, it won't run immediately since it will run on the next tic of the cron task. So I would recommend you to wait 1h after you created it to check that the discount dates were properly updated.

The following user(s) said Thank You: easyconnect83

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

Time to create page: 0.055 seconds
Powered by Kunena Forum