MG Markets Posted May 8, 2020 Share Posted May 8, 2020 Hello everybody, I want to create a trigger which should deactivate all new inserted products. Also add those new products to a hidden category only visible in Backend. So i made this... CREATE TRIGGER deactivate_new_after_insert AFTER INSERT ON ps_product FOR EACH ROW BEGIN UPDATE ps_product_shop SET active=0 WHERE id_product=NEW.id_product; <-----does it affect only new inserted rows? INSERT INTO ps_category_product (id_category, id_product, position) VALUES ('741', NEW.id_product, ???) WHERE id_product=NEW.id_product; <---- which value for position? END My goal is that i can list and check all new products imported before activating them. Does the Trigger affect only new inserted rows? Which value should i use for position? Are there better options than a trigger to reach my goal? Thank you very much! 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