Jump to content

Hook to modify the creation of product


Recommended Posts

Hi All,

 

Actually when I create a new product with my PS 1.6.1, I need the reference is the same of the ID (which I don't know at this stage due to the auto-increment. )

 

So what should be the best way to do that ?

Overriding AdminProductController ? The class ? I saw the function add and the hook actionProductSave called.

But where is this hook ?

 

Or maybe I have to create a module with this kind of hook  :

public function hookActionProductSave()
{
  
    $id = Tools::getValue('id_product');
    $product = new Product($id);
    $product->reference = ($id;
    
   
    $product->save();
 

} 

Could you give me some indications ? Thanks !

Link to comment
Share on other sites

  • 3 years later...
  • 2 years 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...