Red One Posted November 9, 2009 Share Posted November 9, 2009 In the product list page, We can hide/disable "Add to cart" button if we add a customizable field that is required.For the moment, I modified this page as follow :BEFORE {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} AFTER {if ($product.allow_oosp OR $product.quantity > 0) && ($product.customizable != 1 AND $product.customizable != 2)} The result is that the "Add to cart" is disable if there is a customized filed, even if it's not mandatory.But this cannot solve my problem, since I want to hide/disable the "Add to cart" button if the product has attributes.Has somebody any idea on how to modify the page product-list.tpl, so that I can test if the product has attributes.Thanks Link to comment Share on other sites More sharing options...
Red One Posted November 10, 2009 Author Share Posted November 10, 2009 Found : If the product has no attributes, the variable $product.id_product_attribute = 0 {if ($product.quantity > 0 OR $product.allow_oosp) AND ($product.customizable != 1 AND $product.customizable != 2) && $product.id_product_attribute == 0} Link to comment Share on other sites More sharing options...
REFO.cz Posted March 30, 2010 Share Posted March 30, 2010 Nice! Can I have a question - which file have you modified ? Link to comment Share on other sites More sharing options...
Luiz Posted April 4, 2010 Share Posted April 4, 2010 homefeatured.tpl or/and product-list.tpl, and others tpl`s Link to comment Share on other sites More sharing options...
markstone Posted December 28, 2010 Share Posted December 28, 2010 homefeatured.tpl or/and product-list.tpl, and others tpl`s Can somebody please specify which other TPL's need to be changed?? Link to comment Share on other sites More sharing options...
pel024 Posted August 18, 2012 Share Posted August 18, 2012 (edited) I want to do a similar thing - I want to hide the buy_block from the product page when a product has attributes. The section of product.tpl looks like this: <!-- add to cart form--> <form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart.php')}" method="post"> I've tried applying the same logic as the "Add to cart"button above but I either get a smarty error or nothing happens. Could anyone help please? Cheers Edited August 18, 2012 by pel024 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now