Jump to content

Achat par déclinaison


Recommended Posts

Bonjour,

 

j'y suis presque, j'ai juste besoin d'un petit déblocage. Je tente de parvenir pour chaque fiche produit un achat par déclinaison sous forme de liste :

 

déclinaison --- j'achète

déclinaison2 --- j'achète

 

L'affichage marche mais seul la déclinaison par défaut a droit à son petit bouton d'achat. Je vous joins mon code afin de m'aider à résoudre ce soucis :)

 

{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
	{foreach from=$groups key=id_attribute_group item=group}
	{if $group.attributes|@count}
	{assign var="groupName" value="group_$id_attribute_group"}
	{foreach from=$group.attributes key=id_attribute item=group_attribute}
	<form id="buy_block" {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}class="hidden"{/if} action="{$link->getPageLink('cart.php')}" method="post">
	<p class="Buy">
	<span class="Title">{$group_attribute|escape:'htmlall':'UTF-8'}</span>
	<input type="hidden" name="token" value="{$static_token}" />
	<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
	<input type="hidden" name="add" value="1" />

	<input type="hidden" name="id_product_attribute" id="idCombination" value="{$id_attribute|intval}" />

	<p{if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} style="display: none;"{/if} id="add_to_cart" class="buttons_bottom_block">
	<input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" /></p>

	{if isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS}{$HOOK_PRODUCT_ACTIONS}{/if}

	</form>
	{/foreach}
	{/if}
		{/foreach}
	{/if}

 

Merci à tous ceux qui me donner un petit coup de pouce!

  • Like 1
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...