Jump to content

[SOLVED] how to use "View more" instead of "Add to cart"


kollek

Recommended Posts

Hi, 

How can I change "Add to cart" button on "View more"? 

I have prestashop 1.4.8.2 and products with attributes. I don't need "Add to cart" button on the top of product view. 

I would like to change it on home page and product list. 

 

Regards

Karol

Link to comment
Share on other sites

You use default theme?

 

homepage

everything depends on module that you use to display products on homepage

 

product list

in this case you have to edit product-list.tpl file located in your theme directory, or just css styles (just hide button with css command: display:none)

Link to comment
Share on other sites

i checked your website and i've noticed that you use non-default module for "featured" products. I don't know the module name and its contents/ You know what module you use there? if so, can you share module .tpl file? i will inspect code and show you which part of code you have to change

Link to comment
Share on other sites

ok, thanks, first filr (blockhomeproductslide.tpl)

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}
<a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='blockhomeproductslide'}"><span class="addtocard">{l s='Add to cart' mod='blockhomeproductslide'}</span></a>
{else}
<span class="exclusive"><span class="addtocard">{l s='Out of stock' mod='blockhomeproductslide'}</span></span>
{/if}

change it to:

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image">{l s='view more' mod='blockhomeproductslide'}</a>


in second file (product-list.tpl) change:

{if ($product.allow_oosp || $product.quantity > 0) && $product.customizable != 2}
<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 class="addtocard">{l s='Add to cart'}</span></a>
{else}
<span class="exclusive"><span class="addtocard">{l s='Out of stock'}</span></span>
{/if}

to:

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image">{l s='view more' mod='blockhomeproductslide'}</a>
Link to comment
Share on other sites

 

ok, thanks, first filr (blockhomeproductslide.tpl)

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}
<a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='blockhomeproductslide'}"><span class="addtocard">{l s='Add to cart' mod='blockhomeproductslide'}</span></a>
{else}
<span class="exclusive"><span class="addtocard">{l s='Out of stock' mod='blockhomeproductslide'}</span></span>
{/if}

One more thing. In this .tpl file I have this code three times. Change them all?

Link to comment
Share on other sites

 

 

ok, thanks, first filr (blockhomeproductslide.tpl)

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}
<a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='blockhomeproductslide'}"><span class="addtocard">{l s='Add to cart' mod='blockhomeproductslide'}</span></a>
{else}
<span class="exclusive"><span class="addtocard">{l s='Out of stock' mod='blockhomeproductslide'}</span></span>
{/if}

One more thing. In this .tpl file I have this code three times. Change them all?

 

 

that's right, change all instances of code i mentioned above

Link to comment
Share on other sites

so if you want to create a button instead of simple text, then use class="button" like here:

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="button">{l s='view more' mod='blockhomeproductslide'}</a>

unfortunately i don't know your css styles, but method above in default template creates a "button" efffect

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

I have installed this johnny Megastore template on blogger. This is good in all aspect but I require one thing extra. After installing this template you only need to give image url link, price and little description. All post will automatically have add to cart and view details coming in the website. But...I need to change the Add to Cart coming in the post for certain post where I need the check this out button instead So that it will take the user to affiliated network site.

But I am not able to change the Add to Cart appearing in such post even by using <b:if cond ..> </b:if> in blogger template. Its like every post calls the item_add and when clicked the add to cart it adds item in the post to Shopping Cart even I have not mentioned item_price.

 

I want 'add to Cart' button  replaced for 'Check this out' button for such post. The class item_add calls this add to cart appear and I don't know how to modify it.

My Blog Address: http://giveasample.blogspot.com/

 

          Please suggest how to make the desired change...?

Link to comment
Share on other sites

Hello,

 

When I click on a category, I would like to have a more uniform display. I wanted to get rid of that "add to cart" button for products that don't have any variations. I have attached a picture. I appreciate any help.

 

Thanks!

I might have solved it myself! Yay! I am definitely not an expert, but I will post my solution in case anyone needs to refer to it.

 

 I went to "themes/default/product-list.tpl"

 

I changed my code from: 

 

<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>
 
to:
 
{*<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>*}

 

I just added the {* *}

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...