Jump to content

Module dev : hookActionProductUpdate not working ?


Recommended Posts

Hey everybody,

i'm developping my first module for Prestashop 1.6.0.8. It adds a tab on the product admin page (hookDisplayAdminProductsExtra) & at the moment i'm only displaying a tpl file with an input.

Everything is Okay, the input displays my field in database.

The problem is here : public function hookActionProductUpdate($params) doesn't seem to be called when I update the product... My function isn't called. I tried to placed an "error_log" to be sure (& an exit(), nothing happened).
 

public function hookActionProductUpdate($params) {
        $id_product = Tools::getValue('id_product');
        error_log('hookActionProductUpdate');
        $fdbBundleObj = ObjectModel::loadByIdProduct($id_product);
        var_dump($fdbBundleObj);
        $fdbBundleObj->qty_max = Tools::getValue('fdbab_qty_max');
        $fdbBundleObj->id_product = $id_product;
        if(!empty($fdbBundleObj) && isset($fdbBundleObj->id_product)){
            $fdbBundleObj->update();
        } else {
            $fdbBundleObj->add();
        }
    }

Would you have an idea ?

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...