Geronimo2012 Posted September 6, 2012 Share Posted September 6, 2012 Hello, I'm setting up a webshop with 1.5.0.15. We mostly have items to sell for which we only have 1 piece. Is there a way to hide products when there are no more products available? Thanks in advance, Jeroen Link to comment Share on other sites More sharing options...
Geronimo2012 Posted October 20, 2012 Author Share Posted October 20, 2012 Anyone? Link to comment Share on other sites More sharing options...
[email protected] Posted December 15, 2012 Share Posted December 15, 2012 try this add following line in your product-list.tpl file after this line {foreach from=$products item=product name=products} add this {if ($product.allow_oosp || $product.quantity > 0)} // around line 31 and finish around line no 72 before this {/foreach} add this {/if} 2 Link to comment Share on other sites More sharing options...
davidtaubmann Posted December 16, 2012 Share Posted December 16, 2012 (edited) Excelent template-level solution! Thanks barkamlesh! It even hides products that have combinations and there is none in stock for any combination! Edited December 16, 2012 by davidtaubmann (see edit history) Link to comment Share on other sites More sharing options...
Dahl99 Posted December 31, 2012 Share Posted December 31, 2012 (edited) Could you clarify this bit of code please. try this add following line in your product-list.tpl file after this line {foreach from=$products item=product name=products} add this {if ($product.allow_oosp || $product.quantity > 0)} // around line 31 and finish around line no 72 before this {/foreach} add this {/if} Am I right in thinking After this line (which is around line 31) {foreach from=$products item=product name=products} add this {if ($product.allow_oosp || $product.quantity > 0)} Before this line (which is around line 72) {/foreach} add this {/if} The reason I ask is there is // in the piece of code and not sure is that is part of it. Thanks, Dahl Edited January 2, 2013 by Dahl99 (see edit history) Link to comment Share on other sites More sharing options...
Dahl99 Posted January 2, 2013 Share Posted January 2, 2013 Anyone know? Link to comment Share on other sites More sharing options...
uspetznaz Posted January 13, 2013 Share Posted January 13, 2013 thanks Barkam! Link to comment Share on other sites More sharing options...
carelessoul Posted February 26, 2013 Share Posted February 26, 2013 How do we fix the pagination.tpl to match that of the fixed product-list.tpl? 1 Link to comment Share on other sites More sharing options...
masterblaster Posted March 28, 2013 Share Posted March 28, 2013 Hello, this solution works great , but, as carelessoul wrote, there is a major pagination issue , causing the count of the items-per-page to be screwed up as the out of stock items are still considered in the " $products " list sent to the template. I.E. if a category has a lot of zero-quantity products, it could happen that the first page shows products, the second not and the third yes. A fix would be really appreciated ! :) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted May 16, 2013 Share Posted May 16, 2013 Hello, this solution works great , but, as carelessoul wrote, there is a major pagination issue , causing the count of the items-per-page to be screwed up as the out of stock items are still considered in the " $products " list sent to the template. I.E. if a category has a lot of zero-quantity products, it could happen that the first page shows products, the second not and the third yes. A fix would be really appreciated ! :) gennolo , i have a idea about to solve this. i want to share , So that we can implement this to our upcoming theme. There will be a a module which have a cron page and in that cron page it will check a option from module where people can enable or disable stock product. there is two way one is from module they press diable all product which have out of stock or point the cron job which fire each day and disable the out of stock product. which method you all like. Link to comment Share on other sites More sharing options...
Recommended Posts