Jump to content

Récupérer ID variant image


Recommended Posts

Bonjour,

je souhaite modifier la couleur de mes déclinaisons par des images produits.

Je bloque pour récupérer l'id de l'image.

{foreach from=$group.attributes key=id_attribute item=group_attribute}
    <div class="custom-control custom-option custom-control-inline mb-2">
      <input class="custom-control-input" type="radio" id="group_{$id_attribute_group}_{$id_attribute}" name="group[{$id_attribute_group}]" value="{$id_attribute}" data-product-attribute="{$id_attribute_group}" {if $group_attribute.selected}checked{/if}>
      <label class="custom-option-label" for="group_{$id_attribute_group}_{$id_attribute}">
        {assign var="image_url" value=$link->getImageLink($product.link_rewrite, $coverImage.id_image|intval, 'small_default')}{$id_attribute}
        <img src="{$image_url}" alt="{$group_attribute.name}" class="custom-option-image rounded-circle">{$combinationImages.id_image}{$id_image}{$imageId}
		{foreach from=$product.images item=image}
		{if $image.id_image == $product.default_image.id_image}{/if}
		 {/foreach}
      </label>
    </div>
  {/foreach}

Le lien se fait bien, mais l'id renvoi à 0

auriez-vous une solution ?

Merci pour votre aide sous ps 1.7.8

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