Jump to content

ajout champ product combination hook


Recommended Posts

salut ,
j'ai ajouté  à la partie combinaison une zone de texte gràce au hook  "hookDisplayAdminProductsCombinationBottom"  et "hookActionAttributeCombinationSave" .
le champ apparît pour chaque combinaison , mais l'enregistrement de sa valeur n'est pas pris en compte 

    public function hookDisplayAdminProductsCombinationBottom($params) {
        $combination = new Combination($params['id_product_attribute']);
        $this->context->smarty->assign(array(
        'custom_field_attribute' => $combination->custom_field_attribute,
        )
        );
        
        
        return $this->display(__FILE__, 'views/templates/hook/combinationfields.tpl');
    }


    public function hookActionAttributeCombinationSave($params) {
        $combination = new Combination($params['id_product_attribute']);
        $this->context->smarty->assign(array(
        'custom_field_attribute' => $combination->custom_field_attribute,
        )
        );

        $combination->custom_field_attribute = Tools::getValue('custom_field_attribute');

        $combination->save();

        return $this->display(__FILE__, 'views/templates/hook/combinationfields.tpl');

        
        
        return $this->display(__FILE__, 'views/templates/hook/combinationfields.tpl');
    }

 

une idée svp ?

Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...