Ricky Blunda Posted June 8, 2016 Share Posted June 8, 2016 Hello good people I could need some advice here. I sell second hand clothing, meaning I often only have one (1) out of each item. I need to create a cronjob so that when a customer buys an item, that item should be removed from the catalog. I'm wondering two things: 1. The item in-stock counter will reach 0. If the buying customer logs into his/her account, does this mean that he/she will see the order showing "0 in stock"? This could be confusing for the customer if this is the case. 2. Whats the best practise in removing an out of stock item from the catalog? Should I simply make it non-visible? Or is it better to make it inactive? Pros and cons? Many thanks for and advice or suggestions! BR, Ricardo Link to comment Share on other sites More sharing options...
shokinro Posted June 9, 2016 Share Posted June 9, 2016 1. The stock should be managed by PrestaShop automatically, there no necessary to use cronjob to change the quantity. 2. I do not think the stock will should affect existing orders. 3. You disable the product if it will never re-stock. and you can also set "Not allow to order when out of stock". Link to comment Share on other sites More sharing options...
musicmaster Posted June 9, 2016 Share Posted June 9, 2016 The best way to hide products that are no longer in stock is using database triggers that check whether the quantity is 0 and then deactivate the product. If you search the forum you will find more information about that. Link to comment Share on other sites More sharing options...
vekia Posted August 11, 2016 Share Posted August 11, 2016 whole process with mysql triggers is described in this free tutorial: disabling the out of stock products Link to comment Share on other sites More sharing options...
samverdyck Posted January 18, 2017 Share Posted January 18, 2017 whole process with mysql triggers is described in this free tutorial: disabling the out of stock products Hi Vekia I followed your tutorial and created a trigger in phpmyadmin. See screenshot for configuration. I have something strange. For example I have product X and Y. They both have a stock of 0, and are not visible. If you change the stock of product X to 10 and save, it still stays on status invisible, in stead of change to visible. If I change the stock off product Y to 10, this producs also stays unvisible, BUT product X is visible now. It seems the status only changes after a change in another product. Is this normal behaviour? Please give a sign if you need more info of my problem. Link to comment Share on other sites More sharing options...
joseantgv Posted November 7, 2018 Share Posted November 7, 2018 Check this module https://addons.prestashop.com/en/order-management/26993-hide-price-and-disallow-purchase-of-products.html 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