mallrat Posted August 11, 2016 Share Posted August 11, 2016 (edited) Hi there I am setting up a shop that sells one off, individual items. When an item is sold, it needs to stay visible in the store BUT I need all reference to the price to be removed. When I mark quantity - 0 in the back end, it shows 'sold' and on the product page 'This product is no longer in stock.' But the price is still showing on the quick view and on the add to cart section on the product page. Does anyone have any idea how to 'switch off' the prices of sold items? Edited August 11, 2016 by mallrat (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 11, 2016 Share Posted August 11, 2016 product should be marked as product "not available to order" with unmarked option "show price" in this case you can create some mysql trigger that changes the value of fields: available_for_order, show_price to 0 (in table ps_shop_order) UPDATE ps_product_shop SET available_for_order=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0); UPDATE ps_product_shop SET show_price=0 WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0); optionally you can use seo redirect module that has option to: hide out of stock products (you can enable / disable it) disable "price" (you can enable / disable it) "available to order" (you can enable / disable it) once the product is out of stock. Link to comment Share on other sites More sharing options...
mallrat Posted August 17, 2016 Author Share Posted August 17, 2016 (edited) Thank you Vekia. You truly are a legend! I have done exactly what you have said and the mysql trigger works! One problem, when I mark an item as sold in the back end I get an error message when it saves. I am worried this may cause a problem when someone buys an item in the shopping cart and it goes out of stock, will prestashop fall over at this point? By the way, I am using some of your modules and they are great, thank you. Edited August 17, 2016 by mallrat (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 17, 2016 Share Posted August 17, 2016 i dont think that prestashop will generate some troubles after this change, are you able to edit product settings once mysql trigger will mark it as a product with hidden price and product that is not available to order? 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