Jump to content

Does anyone have any idea how to 'switch off' the prices of sold items?


Recommended Posts

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.

 

post-1201935-0-67096200-1470937931_thumb.jpg

 

Does anyone have any idea how to 'switch off' the prices of sold items?

Edited by mallrat (see edit history)
Link to comment
Share on other sites

product should be marked as product "not available to order" with unmarked option "show price"

llgcMKj.png

 

 

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:

  1. hide out of stock products (you can enable / disable it)
  2. disable "price" (you can enable / disable it)
  3. "available to order" (you can enable / disable it)

once the product is out of stock.

Link to comment
Share on other sites

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.

 

post-1201935-0-02457900-1471463963_thumb.jpg

 

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 by mallrat (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...