Product import / update as hook to notify prestashop/modules quantity change

Product import / update as hook to notify prestashop/modules quantity change

Avatar image
Jan 21, 2014
Davide Manzoni wrote
Standard prestashop script for csv import uses hook in the script like this:

FYI, the default Prestashop import script is conform with this usage.
Developer Note :
In addition to your script, you must use a Hook to update the stock level :
Hook::exec('actionUpdateQuantity',
array(
'id_product' => $id_product,
'id_product_attribute' => $id_product_attribute,
'quantity' => $stock_available->quantity
)
);

This notifies prestashop and the modules of the product stock update. Many modules work like this and need to be notified about the change, or it's impossible for the modules to know that the stock has been updated. Importing products with magnetic one makes impossible to use connectors and modules that updates the stock from prestashop changes. In my opinion this is not a suggestion/request, but an issue.

Thanks in advance
New
2 votes
Vote
Reply
5 Answers
Avatar image
Jan 21, 2014
Alex Pryshlivskiy agent wrote
Hello Davide!
What kind of notification do you mean ? email ?
Avatar image
Feb 06, 2014
Davide Manzoni wrote
Hello Sergiy,

i explain the situation better:
i update via emagicone prestashop better my stock, with automatic updates from a csv file provided by the supplier scheduled daily.
At the same time, on my prestashop i have a module that connects prestashop stock with my ebay and amazon seller stock. This one is updated every time there is an "hook" updating the products qty (for example, a product is sold). Emagicone doesn't use hooks or scripts but for what i know changes the value of the stock directly. So everytime emagicone does its update it changes in prestashop but not in ebay and amazon. After knowing this situation, and re-reading better the previous post i did, you should understand the problem.

Thanks in advance
Best Regards

Davide Manzoni
Avatar image
Feb 06, 2014
Alex Pryshlivskiy agent wrote
ok , I see.
In this case let's wait for customer votes and comments for this suggestion.

Avatar image
Jul 05, 2016
Yosh M wrote
executing the module hooks defined in events such as product addition, product update, etc, would be a huge improvement, but I don't know if this is possible since it only works with the database, right?
Avatar image
Jul 21, 2016
Alex Pryshlivskiy agent wrote
it's better, in this case, to combine this information altogether (PrestaShop Store Manager + eBay + Amazon + Quickbooks).
I hope we are going to move this way soon.