Dirty Butter Posted December 14, 2011 Share Posted December 14, 2011 What code needs to be added so only items that are in stock show in the Featured Items, Sale Items, and Popular Items Boxes? And would that also work for Latest Items? Quote Link to comment Share on other sites More sharing options...
bsmither Posted December 14, 2011 Share Posted December 14, 2011 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.) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted December 14, 2011 Author Share Posted December 14, 2011 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. Quote Link to comment Share on other sites More sharing options...
Guest Viola Posted January 2, 2012 Share Posted January 2, 2012 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 74hack_boxes-in-stock.zip Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted January 3, 2012 Author Share Posted January 3, 2012 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. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted January 3, 2012 Author Share Posted January 3, 2012 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??? Quote Link to comment Share on other sites More sharing options...
Guest mrdave Posted November 12, 2012 Share Posted November 12, 2012 this should be a standard setting built in to cc5 controlled from the admin section, works great. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.