- Posts: 846
- Thank you received: 92
update database when product number decrease
11 years 5 months ago - 11 years 5 months ago #197509
by lionel75
update database when product number decrease was created by lionel75
-- 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
-- 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: 11 years 5 months ago by lionel75.
Please Log in or Create an account to join the conversation.
11 years 5 months ago #197524
by nicolas
Replied by nicolas on topic update database when product number decrease
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.
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.161 seconds