Jump to content

Removing 'Add to basket' link - hooks related I think


Recommended Posts

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

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

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

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.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...