Proze Posted September 5, 2012 Share Posted September 5, 2012 Hi, I need to change the product-list.tpl in the way that there will be no "More info" (about product) button, instead there will be just "Add to cart" button. But if the product has any attributes to select from, the "Add to cart button" would change to "Choose options" and it will link to detail of product. I tried it with: {if $product.id_product_attribute > 0} <a class="button ajax_add_to_cart_button exclusive" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Choose options'}"><span></span>{l s='Choose options'}</a> {/if} {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity == 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {if ($product.allow_oosp || $product.quantity > 0)} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart.php')}?add&id_product={$product.id_product|intval}{if isset($static_token)}&token={$static_token}{/if}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {else} <span class="exclusive"><span></span>{l s='Add to cart'}</span><br /> {/if} But its not working..... Anyone can help me ? Thanks in advance...... Link to comment Share on other sites More sharing options...
shacker Posted September 6, 2012 Share Posted September 6, 2012 go to preferences, product and you see this option Display "add to cart" button when product has attributes: Link to comment Share on other sites More sharing options...
Proze Posted September 6, 2012 Author Share Posted September 6, 2012 Hi, thanks for the response, the thing is that i actually need to hide button View details, if there are no attributes to choose from, if yes i just want to change button from "add to cart" to Choose options (which will link to product detail)... If i use the option in product references its not working,..... i m using customized theme, but its not working when i use the default one either........ Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 6, 2012 Share Posted September 6, 2012 Hello Proze, thank you for the message. What version of PrestaShop are you using? I do believe that this would require some slight code modification. Link to comment Share on other sites More sharing options...
Proze Posted September 6, 2012 Author Share Posted September 6, 2012 I use v. 1.4.8.2..... Thanks for looking on this..... well i think there has to be some smarty selector for attributes to use in product list tpl.... But i cant find anything thats working.......... Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 6, 2012 Share Posted September 6, 2012 Hi, thanks for the information. I certainly trust that the forum would be the best place to get this answer. What is your URL? If people wanted to see how customized your website is. Thanks! Link to comment Share on other sites More sharing options...
Proze Posted September 6, 2012 Author Share Posted September 6, 2012 (edited) Well i m still doing it on local..... But it will be online soon, will post URL afterwards........ Ok so in product-list.tpl i tried: {if isset($product.groups)} {if isset($groups)} {if ($product.id_product_attribute > 0)} and some more, but no success.... any idea ? Edited September 6, 2012 by Proze (see edit history) Link to comment Share on other sites More sharing options...
benjamin utterback Posted September 6, 2012 Share Posted September 6, 2012 Hello Proze, I personally, do not know how to code that task. Maybe somebody else on the Forum could help? Link to comment Share on other sites More sharing options...
Proze Posted September 6, 2012 Author Share Posted September 6, 2012 Yes i hope so , it will take some time i guess..... thanks for interest anyway Link to comment Share on other sites More sharing options...
ianstudio Posted November 8, 2012 Share Posted November 8, 2012 Same issue here, the preference does not work for me My "Add to cart" buttons all show even though my products have several attributes. I'm using 1.5.1. In the template product.tpl this seem to be what I need to find there from what I read in other threads: line 271 <form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart')}" method="post"> Any idea anyone ? Is there any real centralized support for Prestashop btw or is it just geeks helping one antoher here an there ? Thanks. Link to comment Share on other sites More sharing options...
melksog Posted March 19, 2014 Share Posted March 19, 2014 ianstudio Did you found the solution? Link to comment Share on other sites More sharing options...
Recommended Posts