Littlepants Posted September 6, 2013 Share Posted September 6, 2013 I have not come across hooks before, so don't really understand what they are or how they work. But I think this is hooks related. In the front office, I only want the add to basket logo to show on the details page of a product, as many products have combinations, and I don't want customers to accidentally add the default, because they didn't view the details. So can anyone explain (in detail, because I am wet behind the ears at this!) how to do this. I am guessing it is hook related, but haven't a clue how to control hooks! Thanks Link to comment Share on other sites More sharing options...
vekia Posted September 6, 2013 Share Posted September 6, 2013 no, it isn't hook related. everything depends on your theme and where you've got "add to cart" buttons it's necessary to change css styles or theme template files. Link to comment Share on other sites More sharing options...
Littlepants Posted September 6, 2013 Author Share Posted September 6, 2013 Thanks so much. As far as I know, ( I am completely new too prestashop - just transferred my cart to it) I have the basic default theme. Can you tell me exactly how to change css styles or theme template files (bearing in mind that I am pretty clueless on programming, and only have pretty basic IT skills. I'm game to try anything, if I have detailed instructions though! Link to comment Share on other sites More sharing options...
vekia Posted September 6, 2013 Share Posted September 6, 2013 but i don't know where you want to disable these buttons, everything depends on it. css styles are located in: themes/default/css/global.csstpl files of template in: themes/default/ Link to comment Share on other sites More sharing options...
Littlepants Posted September 6, 2013 Author Share Posted September 6, 2013 I want to disable all the add to basket buttons except on the final 'view' page. I've attached a screen shot of where I DON"T want the button. I don't want it to show until customer clicks on the blue 'view' links which show in the screen shot So I guess that would be that I want to remove it from all category and sub category pages, and just leave it on the product final information pages. See, when I go to themes, (under preferences in the back office - that's the only themes I can find) I can see default, fine but how do I move on from there? I can't see any css, let alone global.css. There's an add new button. Is that what I need to do? And if I add a new one will this affect what is showing at the moment? I don't want to risk making a mess of the last week's work! If I add new, what name do I use for the name of the theme's directory? e.g.. if I call the new theme 'My theme' do I call the name of the directory 'My Theme's directory'? Sorry to be so dim, but I'm getting all tied up in knots here! And thanks so much for your help so far grab LP category.tiff Link to comment Share on other sites More sharing options...
vekia Posted September 7, 2013 Share Posted September 7, 2013 thanks, now it's clear to remove add to cart button from page you mentioned you will need to edit product-list.tpl file located in your theme directory you've got there code like: {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)} {if isset($static_token)} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {else} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {/if} {else} <span class="exclusive"><span></span>{l s='Add to cart'}</span><br /> {/if} {/if} change it to: {* {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)} {if isset($static_token)} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {else} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {/if} {else} <span class="exclusive"><span></span>{l s='Add to cart'}</span><br /> {/if} {/if} *} i added comment symbols {* *} it mean that code between these symbols will not be executed. 1 Link to comment Share on other sites More sharing options...
Littlepants Posted September 7, 2013 Author Share Posted September 7, 2013 Thanks. That's really explicit, except that I don't know how to get to my theme directory. In themes all I have is the attached screen shot. I'll also try to attached a screen shot of what I get when I select the edit button in the 1 default Grab themes.tiff Grab edit.tiff Link to comment Share on other sites More sharing options...
vekia Posted September 7, 2013 Share Posted September 7, 2013 to open file i mentioned you need to use FTP service or files manager located in your webhosting control panel (of course only when your hoster allows to use it) there is no other way to edit this file Link to comment Share on other sites More sharing options...
Littlepants Posted September 7, 2013 Author Share Posted September 7, 2013 Ah! OK. Thank you. I wondered whether perhaps I needed to add a new theme or something, I'll contact my new host (which I'm just changing) and see what can be done from there. Thank you for all your efforts Link to comment Share on other sites More sharing options...
Recommended Posts