java2dev Posted October 20, 2016 Share Posted October 20, 2016 (edited) Hi, I want to know the difference between both hooks, but I find installed only hookActionProductAttributeUpdate even if I declare the other hook. In the other side I need to print id_product but I can print only id_product_attribute using this hook public function hookActionProductUpdate($params) { //a verificar. if ($params['id_product_attribute']) { $idp = $params['id_product']; echo $idp; $ida = $params['id_product_attribute']; echo $ida; $api = new LinioApi(); $pr = new LinioProduct($idp, false, Context::getContext()->language->id); $sku = $pr->getSku($idp); echo $pr->getSku($idp); $xml = simplexml_load_string($api->getProductBySku(array($sku))); $api->updateProduct($pr->getXmlDesc($ida)); } echo "test9"; die; } thanks for the help. Edited October 20, 2016 by java2dev (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted October 21, 2016 Share Posted October 21, 2016 'actionProductAttributeUpdate' is called when you update an attribute, which are used in combinations 'actionProductUpdate' is called when you update a products stock, category position, or anytime the product object is updated. Link to comment Share on other sites More sharing options...
java2dev Posted October 21, 2016 Author Share Posted October 21, 2016 Hi, yes, I have a plugin to sync combinations to a marketplace. sometimes I need to update some data for example stock I can update using the prestashop quantity hook it's ok, but when I want to change description, short description, price, I save the new values(but nothing is happen in the other side (Marketplace)), so what I do is to click editing combination and then save to take in consideration the description and price update. it's look like fine, but the issue if I have for example 50 combinations I have to click one after one to update these data? Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now