Jump to content
thirty bees forum
  • 0

Dealing with multiple out of stock products


Question

Posted

Hi,

I am currently creating a shop that has thousands of used books. Some of these only have one or two copies and will be in and out of stock regularly.

I know you can disable products using MYSQL triggers or thirty-party modules. However, is there a way to simply hide the product from the category listing? That way, users won't see the out of stock products but they will still display in the search engines to attract traffic.

If not, how do other people deal with this issue. Any help is greatly appreciated.

Kind regards,

Luke

6 answers to this question

Recommended Posts

  • 0
Posted

Thanks very much for your help. I tried adapting a MYSQL trigger based on dosbiner's suggestion for use with combinations:

BEGIN UPDATE tbproductshop SET visibility="search" WHERE idproduct IN (SELECT idproduct FROM tbstockavailable WHERE 1 GROUP BY idproduct HAVING SUM(quantity)=0); UPDATE tbproductshop SET visibility="both" WHERE idproduct IN (SELECT idproduct FROM tbstockavailable WHERE 1 GROUP BY idproduct HAVING SUM(quantity)>0) END

At the moment it doesn't seem to be working. I will post again if I manage to make it work.

Thanks again.

  • 0
Posted

Thanks so much dosbiner, I couldn't get it to work for a while. What worked for me was changing double to quotes to single quotes for the trigger. In case anyone else has the same problem, this worked for me:

BEGIN UPDATE tbproductshop SET visibility='search' WHERE idproduct IN (SELECT idproduct FROM tbstockavailable WHERE quantity=0); UPDATE tbproductshop SET visibility='both' WHERE idproduct IN (SELECT idproduct FROM tbstockavailable WHERE quantity>0); END

  • 0
Posted

@lukewood actually that is exactly, what I did some weeks ago for our store. You should change the behaviour of product listings and internal search results... The files are classes: - Category.php -> getProducts() - Search.php -> find()

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...