Jump to content

(PS 1.5.3) Comment sélectionner un attribut avant de mettre au panier


Recommended Posts

Bonjour,

 

Ma boutique étant maintenant en ligne http://www.smartphone-access.fr, je souhaiterais pouvoir obliger le client à faire le choix d'un attribut (dans mon cas une couleur avant de mettre les articles au panier?

 

J'ai fait des recherches sur le forum mais je ne trouve pas d'infos clair sur PS 1.5.3 j'ai fais des tests de modifications sur le fichier Product-list.tpl mais rien ne fonctionne.

 

Quelqu'un a-t-il une solution ou une module?

 

Merci à tous

Link to comment
Share on other sites

voici le code ajouté dans product_list.tpl:

 

 

{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.id_product_attribute > 0}

<a class="button exclusive" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Choice'}"><span></span>{l s='Choice'}</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="button exclusive" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>

{/if}

{else}

{/if}

</div>

</li>

{/foreach}

</ul>

<!-- /Products list -->

{/if}

Link to comment
Share on other sites

{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.id_product_attribute > 0}
  <a class="button exclusive" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='Choice'}"><span></span>{l s='Choice'}</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="button 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

Quoi qu'il arrive ca ne fonctionne pas.

Nouveau test:

Quand je mets "ajouter au panier" lorsque le produit a des attributs sur non, dans mes nouveaux produits sur la page d'accueil il y a bien écrit "VOIR".

Quand je passe par la catégorie j'ai "Ajouter au panier" qui apparait alors qu'il devrais y avoir "voir" je pense.

 

MAJ 15:50

J'ai trouvé d'ou venait mon problème, c'est la navigation à facette qui fout le bordel et empêche la fonction.

Je vais essayer comme ca et aprèsje chercherais le problème avec la navigation à facette.

 

Merci Vectorus

Edited by vpaban (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...