Jump to content

Changer d'état un couple d'attribut prestashop

Recommended Posts


Je suis sur presta,

J'ai une variante taille / couleur.

et chaque variante a un stock différent

taile 46/noir, 48, noir, 50, noir

taille 46 bleu, 48, bleu, 50 bleu

par exemple

lors ce que l'une de ses variante n'as plus de stock, j'aimerai que cela soit avec un css different

donc, j'ai fait ceci, mais, cela ne passe pas.

il me donne des chiffres et je ne sais pas d'ou il les sort!


        {if $group.group_type == 'color'}
          <ul id="group_{$id_attribute_group}" class="variant-links list-inline">
            {foreach from=$group.attributes key=id_attribute item=group_attribute}

            {if ( $group.attributes_quantity[{$id_attribute|intval}] == '0' )}
                {$notshow = "desactive"}
                {$notshow = ""}

              <li class="list-inline-item d-inline-block">
                <div class="custom-control custom-checkbox">
                  <label class="{$notshow} {if $group.name == 'Taille' } custom-control-label-taille {else} custom-control-label {/if}{if $group_attribute.selected} active{/if}" 
                        {if $group_attribute.html_color_code}style="background-color: {$group_attribute.html_color_code}"{/if}
                        {if $group_attribute.texture}style="background-image: url({$group_attribute.texture})"{/if}
                    <input  class="custom-control-input input-color" 
                            value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}
                    <span class="{if $group.name == 'Taille' } sr-only-taille {else} sr-only {/if}">{$group_attribute.name}</span>







Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More