Jump to content

[Résolu] Ajout D'un Bouton 'personnaliser' Sur La Product-List.tpl En Cas De Personnalisable.


Recommended Posts

Bonjour,

 

Tout est dans le titre. Sur la product-list.tpl est-il possible de remplacer le bouton "ajouter au panier" par "personnaliser", et de changer le lien pour pointer vers le produit, dans le cas où un produit est personnalisable. Ce remplacement de bouton s'effectue déjà si les quantités sont nulles, le bouton est changé en "voir le produit".

 

Merci pour votre aide !

 

Voici mon code :

 

{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&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}">{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}", true)}" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
  {/if}	
 {else}
	<a class="button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
 {/if}
				{else}
				  <a class="button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Add to cart'}">{l s='Add to cart'}</a>
{/if}

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

Cela devrait faire l'affaire

 {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)}
   {if $product.customizable == 1}
   <a class="exclusive" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Customized'}">{l s='Customized'}</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}&token={$static_token}", false)}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a>
   {/if}
   {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}	 
 {else}
  <a class="exclusive" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>
 {/if}
   {/if}

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