Dirty Butter Posted October 12, 2012 Share Posted October 12, 2012 I remember that someone provided the code soon after v5 was released that made it possible to have only in stock items show in Featured, Sale Items, and Latest Items. If possible could someone explain how to do that again, based on 5.1.4 code? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 12, 2012 Share Posted October 12, 2012 From my experiments, two things need to be set: Store Settings, Stock tab, Hide out-of-stock product: green tick Product Add/Edit screen, Use Stock Level: green tick Then (I think) any out-of-stock item simply will not show anywhere, not even if you specifically call for it via ?_a=product&product_id=1 Are you still wanting the ability to directly browse to an out-of-stock item? (I'll be working on that shortly for another post.) Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 12, 2012 Author Share Posted October 12, 2012 i'm sorry, I didn't stress enough - I do NOT want to hide all out of stock items. I just don't want them to show in the "featured" areas, like Featured, Latest, and Sales Items. I DO want them to show in the Categories and search, as part of our business model is helping people find things we don't have in stock. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 12, 2012 Share Posted October 12, 2012 We could try a display logic approach. If any product amongst the Latest Products has zero-level stock (actually, less than one), skip creating the HTML for it. Using {debug} on the content.homepage.php file, we see that $product.stock_level is available. So, find: {foreach from=$LATEST_PRODUCTS item=product} and add after {if $product.stock_level lt 1}{continue}{/if} Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 12, 2012 Share Posted October 12, 2012 The Featured Item in box.featured.php is a single item. So we must wrap the whole <div> block in the If/Then: {if $featured.stock_level gt 0}<div>...</div>{/if} And box.sale_items.php. {if $product.stock_level lt 1}{continue}{/if} Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 12, 2012 Author Share Posted October 12, 2012 Thanks, Bsmither! This seems much more logical to me than "featuring" something that is out of stock. Latest Items worked perfectly for me, but I'm using a mod for Homepage Sale Items and my Fusion skin is not letting me use your Featured code, either. But this will certainly help someone else! Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 12, 2012 Share Posted October 12, 2012 Well, we'll have to discuss third-party skins elsewhere, but my initial impressions are that the same approach will work there too. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 12, 2012 Author Share Posted October 12, 2012 I'm going to ask Fusion skin developer for help. He's been really good about such things. And the mod developer for Homepage Sale Items will probably help out, too. Hopefully I won't need to ask you for more help on this one. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 23, 2012 Author Share Posted October 23, 2012 Going to have to ask Fusion skin developer for Latest Product as well. Weirdly - it leaves a blank space holder area where the sold latest item would have been. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 28, 2012 Author Share Posted October 28, 2012 Blueprint solution has been moved to 3rd party forum. Quote Link to comment Share on other sites More sharing options...
Robsta Posted October 28, 2012 Share Posted October 28, 2012 Please note third-party skins are not supported in this forum, only files supplied with CubeCart. Please visit CubeCartForums.org, thanks. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 28, 2012 Author Share Posted October 28, 2012 Sorry, Robsta. I moved the Fusion solution to the 3rd party forum and unlocked this thread, in case someone else has a comment on the CC skin solutions offered here. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 8, 2013 Author Share Posted September 8, 2013 Revisiting this again - sorry. On our 5.2.2 kurouto store we do not show out of stock items. But I just noticed the Featured Item was an out of stock one. Any ideas why that would happen?I tried the {if... solution for box.featured.php shown above, just to see what it would do. It skips the Featured box completely if the random happens to land on an out of stock item - doesn't show the Featured Product heading at all and does not leave a space of the box, either - which is better than showing something as featured we don't even have.But it's strange that this would be necessary. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2013 Share Posted September 9, 2013 "we do not show out of stock items", "it's strange that this would be necessary." Â And you are sure that the product that did show up in Featured is using stock level control? Â Please expand on what "this" is that you are referring to. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 9, 2013 Author Share Posted September 9, 2013 Account Settings are set to not show out of stock items. The item is out of stock, but the actual settings on the item are still showing green checks on Status, Include in Latest Items, and Use Stock Level."This" referred to having to use the same Post#4 edit for a store set to not show out of stock items. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2013 Share Posted September 9, 2013 Keep in mind that when viewing the storefront as a logged-in admin, there are things that get displayed when they would otherwise not be displayed to a customer: out-of-stock items is one of those things. Â Is it the case that you are viewing the storefront as a logged-in admin? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 9, 2013 Author Share Posted September 9, 2013 Yes I am. I didn't know that. I'll log out and try it again.Evidently that was it. I learned something new today. As a teaching moment - What else shows up in the store for a logged in admin that does not show for a customer? Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 9, 2013 Share Posted September 9, 2013 An "export list" of products is downloadable -- the URL to "pull" these lists is accepted by CubeCart from the "public", such as a Google store, provided there is an accesskey included in the request. But a logged in admin can also use these "public pull" URLs to get the list so that the list can be examined for errors. Â Hiding prices until logged in (a store general setting) is overridden for admins. Â Hiding out-of-stock items can be overridden. Â The store can be put into "Offline Mode", and is overridden for admins. Â The language pack displayed by the store will be that of the logged-in admin instead of the default language. Â The function that determines the currentPage is affected by a logged-in admin, but I'm not sure exactly how. Â The function that creates search-engine-friendly URLs is affected somehow. Â These are the features that initially come to mind. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted September 9, 2013 Author Share Posted September 9, 2013 Thanks, as always, Bsmither! Quote Link to comment Share on other sites More sharing options...
AlanCooper Posted October 9, 2013 Share Posted October 9, 2013 cool! thanks for info! 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.