martin_88 Posted September 15, 2019 Share Posted September 15, 2019 (edited) 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. Edited September 15, 2019 by martin_88 (see edit history) Link to comment Share on other sites More sharing options...
martin_88 Posted September 24, 2019 Author Share Posted September 24, 2019 up Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now