anil1590 Posted February 12, 2016 Share Posted February 12, 2016 (edited) up vote1down votefavorite I am using hookActionProductUpdate I am getting all data updated but not attribtues, This is the code inside hook functionpublic function hookActionProductUpdate($params) {$prestaObject = new ProductCore($params['id_product'], false, Context::getContext()->language->id);$arrrs = $prestaObject->getFrontFeatures(1);}Everything else is updated but the front features I am getting are the older one. Any IDEA? I am trying in prestashop 1.6 Hello I tried this too here is my new functionpublic function hookActionProductUpdate($params) {$product = $params['product'];$arrrs = $product->getFrontFeatures(1);pr($arrrs);die("No updating :(");} here is stackoverflow linkhttp://stackoverflow.com/questions/35317819/prestashop-product-update-hook-is-not-updating-product-attributes-in-the-hook-fu Edited February 12, 2016 by anil1590 (see edit history) Link to comment Share on other sites More sharing options...
java2dev Posted October 19, 2016 Share Posted October 19, 2016 Hi, did You resolve this issue , I have the same issue. I have my function like this. public function hookActionProductAttributeUpdate($params) { echo "test1"; die; if ($params['id_product_attribute']) { $idp = $params['id_product']; $ida = $params['id_product_attribute']; $api = new LinioApi(); $pr = new LinioProduct($idp, false, Context::getContext()->language->id); $sku = $pr->getSku($ida); $xml = simplexml_load_string($api->getProductBySku(array($sku))); $api->updateProduct($pr->getXmlDesc($ida)); } /*ob_start(); p($params); $content = ob_get_contents(); file_put_contents('update-pr.txt', $content, FILE_APPEND); ob_end_clean();*/ } this my function for xml public function getXmlDesc($attribute = null) { $sku = (!$attribute || !$this->attributes) ? $this->reference : $this->attributes[$attribute]['SellerSku']; //$qty = StockAvailable::getQuantityAvailableByProduct($this->id, $attribute); $xml = '<?xml version="1.0" encoding="UTF-8" ?><Request><Product>'; $xml .= $this->getXmlProperty('SellerSku', $sku); $xml .= $this->getXmlProperty('Description', $this->description); $xml .= '</Product></Request>'; return $xml; } I use the hook quantity and it works perfectly , but this one I cannot print echo test 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