Dirty Butter Posted April 3, 2021 Share Posted April 3, 2021 I currently have his Random Homepage Products extension active. But I can't figure out how to keep it from showing sold items. Hopefully this is going to be easy to fix. I don't know if the code change would be in the skin file or the class file, and nothing I have guessed at has worked. https://plushmemories.com/lovie-shoppe/index.php Link to comment Share on other sites More sharing options...
bsmither Posted April 3, 2021 Share Posted April 3, 2021 We assume you already have code in place to exclude "sold" items, other than relying on the stock level being 0 or less? Link to comment Share on other sites More sharing options...
Dirty Butter Posted April 4, 2021 Author Share Posted April 4, 2021 If it's there I can't find it. We have not added any new stock since 2019, but we sold a lot in 2020. So the Sold items in a random assortment are much more obvious. This is the store where we DO intentionally continue to show sold items to customers, as we send them to our free FaceBook group for help finding one in stock. But I don't want them showing on the homepage. You provided this code some years ago to keep the sold ones off the Latest Items homepage: {foreach from=$LATEST_PRODUCTS item=product} {* BSMITHER ADDED LINE BELOW TO SHOW ONLY IN-STOCK ITEMS *} {if $product.stock_level lt 1}{continue}{/if} But when tried to put it in the skin file for the extension I get no products showing at all. Link to comment Share on other sites More sharing options...
bsmither Posted April 9, 2021 Share Posted April 9, 2021 If you are putting all of the above code in the module's skin code verbatim, then that is not a correct approach. If you are just adding: {if $product.stock_level lt 1}{continue}{/if} into the module's skin code, then the name of the variable needs to be adjusted: {if $homepage_random_product.stock_level lt 1}{continue}{/if} This is how I see it. (I haven't tested.) Link to comment Share on other sites More sharing options...
Dirty Butter Posted April 10, 2021 Author Share Posted April 10, 2021 And just like magic, it's fixed!!! And the magic is your wonderful help!! Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.