How to add product to category on zero stock?

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
4 years 4 months ago #325744

-- HikaShop version -- : 4.4.0 [2011031346]
-- Joomla version -- : 3.9.22
-- PHP version -- : 7.3.18

We are looking for a way of automatically add a product to a category when the stock level drops to zero. I tried using a mass action triggered by 'After a product is updated' but couldn't figure how to set the action to take. Is there a way to do it?

regards
Trevor

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

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 4 months ago #325756

Hi,

The "after a product is updated" trigger is not triggered when the stock is modified when the status of an order is changed (it's done for performance issues).
What you can do instead is to use a trigger "every minute" instead and configure your cron task:
www.hikashop.com/support/documentation/5...ashop-cron-task.html
You'll have a delay of a few minutes (based on your cron task triggering rate) between the stock changing and the category being added to the product.

The following user(s) said Thank You: trevsmiff

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

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
4 years 4 months ago #325778

Thanks Nicholas, it's working fine now.
Regards
Trevor

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

Time to create page: 0.040 seconds
Powered by Kunena Forum