Jump to content

cacher déclinaison afficher dans un tableau


Recommended Posts

bonjour,

je suis débutante en prestashop , et dans ma page produit j'ai afficher un tableau de déclinaison avec le bouton ajouter au panier et ce que je cherche c'est de ne pas afficher tous les déclinaisons je veux choisir quelque pour les afficher je sais pas comment le faire merci de me guider :)

 

voila le code du table

 

<table border="1">
  <caption>Liste des déclinaisons</caption>
 <thead> <!-- En-tête du tableau -->
	   <tr>
	  <th>Réference</th>
  {foreach from=$groups item='attributearray' key='groupindex'}
  <th>{$attributearray.name}</th>
  {/foreach}
  <th>Prix</th>
<th> Réference</th>
	   </tr>
<tbody> <!-- Corps du tableau -->
 {foreach from=$combinations item='combination' key='combinationId'}
 <tr>

  <td>{$combination.reference}</td>
  {foreach from=$combination.attributes_values item='a' key='groupindex'}
  <td>{$a}</td>
  {/foreach}
  {if $priceDisplay >= 0 && $priceDisplay <= 2}
    {if $combination.price != 0}
	 <td>{convertPrice price=$combination.price + $product->price}</td>
    {else}
	 <td>{convertPrice price=$productPrice}</td>
    {/if}
  {/if}
<td>
<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{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></td>
 </tr>
 {/foreach}
</tbody>
  </thead>

</table>

Link to comment
Share on other sites

  • 1 month later...

Bonjour,

Merci beaucoup d'avoir partagé ce tableau, c'est exactement ce que je voulais faire !

Je n'ai malheureusement pas de répondre à votre problème, mais je me demandais si vous aviez réussi à faire en sorte que chaque bouton "ajouter" corresponde bien à la déclinaison souhaitée ?

Link to comment
Share on other sites

  • 3 years later...

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