Psytanium Posted November 12, 2020 Posted November 12, 2020 Hello, Is there a way or addon to make the special price change when the original price change ? For e.g. I added 20% discount on a product priced 1000$, now the special price is 800$, but when I increase the original price to 2000$ the special price is still 800$ instead of 1600$. Trying to make the special price change automatically if the discount is percentage. Thanks
burt Posted November 12, 2020 Posted November 12, 2020 Special Price is stored as a price. It does not know it is a percentage: CREATE TABLE specials ( specials_id int NOT NULL auto_increment, products_id int NOT NULL, specials_new_products_price decimal(15,4) NOT NULL, specials_date_added datetime, specials_last_modified datetime, expires_date datetime, date_status_change datetime, status int(1) NOT NULL DEFAULT '1', PRIMARY KEY (specials_id), KEY idx_specials_products_id (products_id) ) CHARACTER SET utf8 COLLATE utf8_unicode_ci; Therefore what you want, cannot (easily) happen.
Psytanium Posted November 12, 2020 Author Posted November 12, 2020 Hi @burt, If I add new column to the specials table, storing the percentage what else should i modify ? You think this can be done on the level of listing_query in index.php ? I mean by changing the final_price value.
♥ecartz Posted November 12, 2020 Posted November 12, 2020 30 minutes ago, Psytanium said: If I add new column to the specials table, storing the percentage This would not be a small change. It might be easier to add a categories.preAction hook that checked if the product price changed and updated the specials price appropriately. This could involve a new column that would be a boolean for update or not. Or it could happen always. Then the catalog code would not need to change, only the admin behavior. Always back up before making changes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.