Jump to content

Edit History

aleaallee

aleaallee

Hi, I'm not a prestashop developer but have been tasked with adding a new functionality to one of my employer's client prestashop websites, I want to get the reference from both the product and all of its possible (only if it has) combinations and then do something with them after I update or create a product. I made a module and implemented the actionProductUpdate, actionProductAttributeUpdate and actionProductAdd hooks with the following code while trying to get a product and its combinations/attributes' refferences:

 

public function hookActionProductUpdate($params)
    {
        $product_ref = $params["product"]->reference;
        $prod = $this->getProducts($product_ref);
        print_r($params["product"]);
    }

All I've managed to do is to show the print_r's content in the devtools' network tab.

aleaallee

aleaallee

Hi, I'm not a prestashop developer but have been tasked with adding a new functionality to one of my employer's client prestashop websites, I want to get the reference from both the product and all of its possible (only if it has) combinations and then do something with them after I update or create a product. I made a module and implemented the actionProductUpdate, actionProductAttributeUpdate and actionProductAdd hooks with the following code while trying to get a product and its combinations/attributes' refferences:

 

public function hookActionProductUpdate($params)
    {
        $product_ref = $params["product"]->reference;
        $prod = $this->getProducts($product_ref);
        print_r($params["product"]);
    }

All I've managed to do is to show the print_r's content in the devtools' network tab.

×
×
  • Create New...