update database when product number decrease

  • Posts: 846
  • Thank you received: 92
9 years 7 months ago #197509

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 2.5.8
-- PHP version -- : 5.5.8

Which is the best way to update some data in the table when a product has been buy and we want that event launch a php file to modify some data ?
The mass action documentation say that mass action can be use after a product has been create . Does this occur automaticly ? Does it mean we can when a product has been buy use/call wit h dynamic parameter ( product properties) a precreate a php file ( I think it is a module ) that ll launch mass action ?

Does Mass action can be a handwriting php file instead create it using the mass action GUI backend ? Does the file generate by mass action is declarative or is a php file ?

I have some clue about the anwsers but ask to have confirmation . I think HKS and joomla are great for developper when need custom extension .
regard's

Last edit: 9 years 7 months ago by lionel75.

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

  • Posts: 82865
  • Thank you received: 13373
  • MODERATOR
9 years 7 months ago #197524

Hi,

I don't think that there is a need to use mass actions for what you want to do.
Simply create a plugin of the group "hikashop" and implement the "onAfterOrderUpdate" trigger. Check the $order->order_status variable and the $order->old->order_status variable so that the new one is confirmed and the old one is created and you'll know that the order has just been confirmed. At that point, just run your PHP and do whatever you need to.

The following user(s) said Thank You: lionel75

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

Time to create page: 0.038 seconds
Powered by Kunena Forum