DARKF3D3 Posted September 1, 2014 Share Posted September 1, 2014 I try to do that i modified the foreach cicle in product-list.tpl file, from: {foreach from=$products item=product name=products} {math equation... ... ... ... </li> {/foreach} To: {foreach from=$products item=product name=products} {if isset($product.available_for_order) && $product.available_for_order} {math equation... ... ... ... </li> {/if} {/foreach} As you can see I added the {if ...} into the foreach cicle. This partially works, in fact now products that from B.O. is not checked as "available for order" are not showed. But the problem is that this create problem with products grid, infact the lines where's there was a product not available for order now are uncomplete. For example if i have line with 4 products, when theres one not ordinable product, there's only 3 products per line. Link to comment Share on other sites More sharing options...
NemoPS Posted September 1, 2014 Share Posted September 1, 2014 Hi! This happens because it uses index to determine when to go next line, so I would use a custom variable instead, like assign var=currentiteration value=$smarty.foreach.products.indexOr the one it uses to assign the last element's class, which I currently forgot Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 1, 2014 Author Share Posted September 1, 2014 I'm thinking that maybe the best is to customizing directly the query involved il product list, because with my method on tpl file the product not showed are decreased from the total of products showed per page. So if i chose to show max 20 product per page, this number decreases based on products not available for order, so i'll have page with different product quantity showed. Link to comment Share on other sites More sharing options...
NemoPS Posted September 2, 2014 Share Posted September 2, 2014 well yes, that would be ideal, just keep in mind changes will be wiped out by any module upgrade Link to comment Share on other sites More sharing options...
Recommended Posts