Jump to content

[SOLVED] Product list - details instead of add to cart button


medred

Recommended Posts

Hello everyone.

The shop contains only products with attributes and the “display add to cart button when product has attributes” from the back office removes the button completely from the product list when the value is set to “no”. We wish to keep the button and lead to the product page.

So I changed line:60 from product-list.tpl  file

{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&id_product={$product.id_product|intval}&token={$static_token}", false)}" 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&id_product={$product.id_product|intval}", false)} title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a>
{/if}       
 

to

{if isset($static_token)}
<a class="button" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Detail'}">{l s='Details'}</a>
{/if}       

It works well but is it the right way to do it?

Thanks

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi,

Thank you for all your assistance through the matters, this is my first post and saw That Mr Veika is helping people a lot, I was wondering if you could help me as well :D

My questions are:

 

-As I have a website which is not in need of online sales I would like to change the add to cart botton to Contact us and when click on it drives you to contact form page and not cart.

-When I disabled 'available to order' or when changed to catalogue mode, the button doesnt show but the 'add to cart' still written even if it is not a link anymore.

Could you please advice the best solution to have a button ' Contact Us' only instead of add to cart, and View product when clicking on cart icon in product list as it is linking to cart as well

Thank you for your prompt reply and assistance.

Link to comment
Share on other sites

 

 

-As I have a website which is not in need of online sales I would like to change the add to cart botton to Contact us and when click on it drives you to contact form page and not cart.

you can simply edit template files (each file where the add to cart button appears) and then instead of add to cart button you can use button to contact page

 

 

 

 

-When I disabled 'available to order' or when changed to catalogue mode, the button doesnt show but the 'add to cart' still written even if it is not a link anymore.

you use default theme? im asking, because in non-default theme with catalog mode on this button should disappear.

Link to comment
Share on other sites

  • 2 months later...

I wanted in my shop to products without attributes have the add to cart button, and for product with attributes to have the "detalis" button, so I just simply added: 
 

{if ($product.id_product_attribute >= 1 || (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 isset($static_token)}
						<a class="button" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Detail'}">{l s='Details'}</a>{/if}	
					
				{/if}

i dont now if this is correct but this is working for now as i can see, so maybe it will be useful for someone.

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