sarah0173 Posted June 29, 2014 Share Posted June 29, 2014 Bonjour à tous, Voilà, j'aimerai ajouter la liste déroulante pour les attributs "couleur" des fiches produits. Exemple, sur cette page http://www.funstuffetcompagnie.com/451-boxer-stared-propriete-privee.html, j'aimerai aussi afficher la liste déroulante, comme sur mon ancienne boutique. Est-ce que quelqu'un aurait la solution ? Merci. Link to comment Share on other sites More sharing options...
Col&gram Posted June 29, 2014 Share Posted June 29, 2014 Bonjour, De mémoire il faut aller modifier l'affichage dans l'attribut concerné, en choisissant liste déroulante. Link to comment Share on other sites More sharing options...
sarah0173 Posted June 29, 2014 Author Share Posted June 29, 2014 Bonjour, De mémoire il faut aller modifier l'affichage dans l'attribut concerné, en choisissant liste déroulante. Si je mets liste déroulante, les couleurs ne s'affichent plus et je souhaite l'affichage des deux (liste déroulante + affichage des couleurs). J'ai modifié le code de product.tpl, j'arrive à afficher les deux, mais lorsque je sélectionne une couleurs sur les carrés de couleur, cela ne se répercute pas sur la liste déroulante. J'ai modifié ça : {if ($group.group_type == 'select')} <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option> {/foreach} </select> {elseif ($group.group_type == 'color')} <ul id="color_to_pick_list" class="clearfix"> {assign var="default_colorpicker" value=""} {foreach from=$group.attributes key=id_attribute item=group_attribute} <li{if $group.default == $id_attribute} class="selected"{/if}> <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value|escape:'html':'UTF-8'};" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}"> {if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')} <img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" /> {/if} </a> </li> {if ($group.default == $id_attribute)} {$default_colorpicker = $id_attribute} {/if} {/foreach} </ul> <input type="hidden" class="color_pick_hidden" name="{$groupName|escape:'html':'UTF-8'}" value="{$default_colorpicker|intval}" /> {elseif ($group.group_type == 'radio')} <ul> {foreach from=$group.attributes key=id_attribute item=group_attribute} <li> <input type="radio" class="attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} /> <span>{$group_attribute|escape:'html':'UTF-8'}</span> </li> {/foreach} </ul> {/if} En ça : {if ($group.group_type == 'select' || $group.group_type == 'color')} <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option> {/foreach} </select> {if ($group.group_type == 'color')} <br/> <ul id="color_to_pick_list" class="clearfix"> {assign var="default_colorpicker" value=""} {foreach from=$group.attributes key=id_attribute item=group_attribute} <li{if $group.default == $id_attribute} class="selected"{/if}> <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value|escape:'html':'UTF-8'};" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}"> {if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')} <img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" /> {/if} </a> </li> {if ($group.default == $id_attribute)} {$default_colorpicker = $id_attribute} {/if} {/foreach} </ul> <input type="hidden" class="color_pick_hidden" name="{$groupName|escape:'html':'UTF-8'}" value="{$default_colorpicker|intval}" /> {/if} {elseif ($group.group_type == 'radio')} <ul> {foreach from=$group.attributes key=id_attribute item=group_attribute} <li> <input type="radio" class="attribute_radio" name="{$groupName|escape:'html':'UTF-8'}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} /> <span>{$group_attribute|escape:'html':'UTF-8'}</span> </li> {/foreach} </ul> {/if} Link to comment Share on other sites More sharing options...
laure-c2c Posted June 6, 2016 Share Posted June 6, 2016 Bonjour, Avez-vous trouvé la solution à ce problème ? J'ai également besoin de faire afficher les deux: liste déroulante et color picker. Merci d'avance. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now