I'd like to generate a custom reference after the product is created. I looked up and found the trigger slq option.
Something like this.
CREATE TRIGGER product_add_reference
After INSERT ON ps_product_lang
FOR EACH ROW
update ps_product set reference = id_product
My understanding is that when we click on "create product" the prodct in the data base is already created.
I would like to add the trigger after the full product is update because the reference is based on the catgory the product will be.
Example :
Woman
Shirt
Pens
If the product is in Pens the reference would be P-001. If the product is in Shirt, the reference should be S-001.
I'm blocked because the trigger is actually generated when clicking on "create a new product" but it should be trigger after the full product submittion.