Jump to content

product-list: 'view more' instead of 'add to cart' button


Recommended Posts

Hello everyone,

 

Am trying to make a change to the product-list pages. Instead of the add-to-cart button, i would like to add a 'view more' button (on the spot of the add-to-cart button. I'm aware that when a product has features you can set the item to go to the specific product page and not to display the add-to-cart button but i would like to add a 'view more' button instead on that spot when the item has extra features/options.

 

At the homepage of the shop i'm displaying 'new items' in this overview all items have a 'view more' button and I would like to make the looks of these product listings uniform throughout the site.

 

I will attach 2 images, one of an item placed at the homepage and the other one of an item from the standard product list (of which i would like to replace the cart button).

 

Hope this makes sense and that someone can point me in the right direction.

post-378971-0-85977000-1373927098_thumb.png

post-378971-0-70839900-1373927099_thumb.png

Link to comment
Share on other sites

well, you're using non-default template so it is hard to say what you have to change.

if it is possible, please share the url to your store, also the contents of the product-list.tpl file will be realy helpfull

Link to comment
Share on other sites

  • 1 year later...

Hello,
 
I would like to achieve the same thing. Any ideas would be appreciated. From product-list.tpl (not default template), the code for "Add to Cart" which I want to change to "View" (got it to partially work, but am doing something wrong). Here is the unedited code:

					<div class="button-container">
						{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 btn btn-default alt" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}">
										<span>{l s='Add to cart'}</span>
									</a>
								{else}
									<a class="button ajax_add_to_cart_button btn btn-default alt" href="{$link->getPageLink('cart',false, NULL, 'add=1&id_product={$product.id_product|intval}', false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}">
										<span>{l s='Add to cart'}</span>
									</a>
								{/if}						
							{else}
								<span class="button ajax_add_to_cart_button btn btn-default disabled">
									<span>{l s='Add to cart'}</span>
								</span>
							{/if}
							{else}
							<div class="replae_add_to_cart_catalog_mode"></div>
						{/if}
Link to comment
Share on other sites

I think you should replace:

 

<a class="button ajax_add_to_cart_button btn btn-default alt" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}"

 

 

with: 

<a class="button ajax_add_to_cart_button btn btn-default alt" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">

 

 

This only changes the functionality of the button, it's up to you to change the code/css to aquire the desired look :).

Link to comment
Share on other sites

Thanks Anoshka, what got it working properly was:

                        <a class="button.ajax_add_to_cart_button btn btn-default" href="{$product.link|escape:'html':'UTF-8'}" title="{l s='View'}" itemprop="url" >
                        <span>{l s='More'}</span>

                        </a>

edit: this worked without CSS editing.

Edited by jetx (see edit history)
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...