Jump to content

How to Have IN STOCK Items ONLY in Featured, Sale Items, Popular Boxes


Dirty Butter

Recommended Posts

Isn't there a setting for Hide Out-of-Stock Items in the Admin settings? (Not that I would know, but it only makes sense.)

Each item can be hidden individually, but there's no way to do it across the board in v5.0.6.

BUT I don't want to hide them from the catalog completely, only from the boxes and possibly the Latest Products. We run a free Lost Toy Search Service, so if we're out of stock we try to help people find it.

Link to comment
Share on other sites

  • 3 weeks later...

Basically you have to modifiy the SQL queries for those boxes to check if the product is using stock level and if so, is the stock level > 0. I've attached the modified files to make it easy (version 5.0.6). Both files should go in the "/classes" directory. I've tried the changes on a test store and I'm fairly sure I haven't broken anything.

If anyone needs to integrate this with other hacks, the changes are on the following lines:

Popular Products: gui.class.php, line 734

Random/Featured Product: gui.class.php, line 778

Sale Items: gui.class.php, line 854, line 879

Latest Products: cubecart.class.php, line 74

hack_boxes-in-stock.zip

Link to comment
Share on other sites

Basically you have to modifiy the SQL queries for those boxes to check if the product is using stock level and if so, is the stock level > 0. I've attached the modified files to make it easy (version 5.0.6). Both files should go in the "/classes" directory. I've tried the changes on a test store and I'm fairly sure I haven't broken anything.

If anyone needs to integrate this with other hacks, the changes are on the following lines:

Popular Products: gui.class.php, line 734

Random/Featured Product: gui.class.php, line 778

Sale Items: gui.class.php, line 854, line 879

Latest Products: cubecart.class.php, line 74

Thanks as always for the help, Viola! I'll have to try it tomorrow though, and I'll let you know how it goes.

Link to comment
Share on other sites

Basically you have to modifiy the SQL queries for those boxes to check if the product is using stock level and if so, is the stock level > 0. I've attached the modified files to make it easy (version 5.0.6). Both files should go in the "/classes" directory. I've tried the changes on a test store and I'm fairly sure I haven't broken anything.

If anyone needs to integrate this with other hacks, the changes are on the following lines:

Popular Products: gui.class.php, line 734

Random/Featured Product: gui.class.php, line 778

Sale Items: gui.class.php, line 854, line 879

Latest Products: cubecart.class.php, line 74

It works beautifully!! I haven't had a chance to see if I've made any other mods to those files that I'll need to blend together, but for now it's working perfectly!! Do you do CC work for hire, Viola???

Link to comment
Share on other sites

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...