Jump to content

Remove/Hide Add to cart button on homepage [SOLVED]


christian93bc

Recommended Posts

Im using Prestashop 1.6.1.4. 

Im trying to remove or hide add the cart button button from homepage. I dont want to allow adding products to cart before opening the actual product page or at at least the quick view one, which it can barely be seen, because it only show op upon hovering over product image .

Ive looked on file over my host, but cant find the responsible file for product on homepage design.

 

Is it possible?

 

Also I already looked on internet, found only how to completely remove it, spent over 8 hours and no right answer.

Edited by christian93bc (see edit history)
Link to comment
Share on other sites

Do you want to remove the "Add to cart" button from just the featured products or the category pages too? If you want to remove it from both, you can edit product-list.tpl and {* comment out *} lines 155-165 (assuming you're using the default theme in PrestaShop v1.6.1.5):

							{if (!isset($product.customization_required) || !$product.customization_required) && ($product.allow_oosp || $product.quantity > 0)}
								{capture}add=1&id_product={$product.id_product|intval}{if isset($product.id_product_attribute) && $product.id_product_attribute}&ipa={$product.id_product_attribute|intval}{/if}{if isset($static_token)}&token={$static_token}{/if}{/capture}
								<a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart', true, NULL, $smarty.capture.default, false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product-attribute="{$product.id_product_attribute|intval}" data-id-product="{$product.id_product|intval}" data-minimal_quantity="{if isset($product.product_attribute_minimal_quantity) && $product.product_attribute_minimal_quantity >= 1}{$product.product_attribute_minimal_quantity|intval}{else}{$product.minimal_quantity|intval}{/if}">
									<span>{l s='Add to cart'}</span>
								</a>
							{else}
								<span class="button ajax_add_to_cart_button btn btn-default disabled">
									<span>{l s='Add to cart'}</span>
								</span>
							{/if}
                        {/if}

If you want to remove the "Add to cart" button from the featured products, but still display it on category pages, you'll have to add the following line before the above code:

                            {if !isset($id) || (isset($id) && $id != 'homefeatured')}

and the following after the code:

						{/if}
  • Like 1
  • Thanks 2
Link to comment
Share on other sites

Commenting out method just crashes my site completly. Dont know the reason

Removing only the on the feature product works just fine. The answer was yes, i want it both. There is any way i can add in that if statement also for $page_name != 'category'

or something like that in the code. I tried to modify myself but the only result was crashing the site, again. 

Thanks for your help for erlier and in advance.

 

Later Edit: Turn out i wasnt comenting out the right line. But after i put corectly betwin line 155-167 - Worked like a charm.

 

Thanks

Edited by christian93bc (see edit history)
Link to comment
Share on other sites

  • 8 months later...
  • 6 months later...

A reply to the comment above:

 

"Do you want to remove the "Add to cart" button from just the featured products or the category pages too? If you want to remove it from both, you can edit product-list.tpl and {* comment out *} lines 155-165 (assuming you're using the default theme in PrestaShop v1.6.1.5):"

 

I wanted to update that I needed to comment lines 155-164.  If I commented out line 165, it prevent my site from rendering. 

@rocky, other than a slight adjustment, perfect post and thank you for taking the time to share.

 

I needed this information to get my customers to get to the product detail pages. 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...