kate66 Posted April 2, 2019 Share Posted April 2, 2019 Bonjour, je souhaite afficher le nom des couleurs sur mes déclinaisons couleurs sur 1.7? quelqu'un aurai une solution? Merci Link to comment Share on other sites More sharing options...
PECHECERISE Posted April 25, 2019 Share Posted April 25, 2019 bonjour avez vous trouvé une solution? pareil j ai que les carrés de couleurs, aucun nom de couleur s affiche. je ne sais pas si c est lié au thème que j ai acheté ou si c est prestashop 1.7 qui fait ça. le client ne sait pas quelle couleur il selectionne en gros! Link to comment Share on other sites More sharing options...
cyssoo Posted April 25, 2019 Share Posted April 25, 2019 Bonjour, Dans votre thème Prestashop 1.7, vous avez un fichier /httpdocs/themes/yourtheme/templates/catalog/_partials/product-variant.tpl Dedans, vous trouverez la variable $group_attribute.name et une condition {elseif $group.group_type == 'color'}. Selon votre thème (et child theme fortement recommandé pour le coup) vous pourrez afficher le nom de la couleur en plus de son picto. Link to comment Share on other sites More sharing options...
PECHECERISE Posted April 25, 2019 Share Posted April 25, 2019 merci pour votre aide, j ai bien trouvé le fichier product-variant.tpl et j ai trouvé $group_attribute.name mais je sais pas ce que je dois faire ? Link to comment Share on other sites More sharing options...
PECHECERISE Posted April 25, 2019 Share Posted April 25, 2019 (edited) j ai ceci: <div class="product-variants"> {foreach from=$groups key=id_attribute_group item=group} {if !empty($group.attributes)} <div class="clearfix product-variants-item"> <span class="control-label">{$group.name}</span> {if $group.group_type == 'select'} <select class="form-control form-control-select" id="group_{$id_attribute_group}" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute}" title="{$group_attribute.name}"{if $group_attribute.selected} selected="selected"{/if}>{$group_attribute.name}</option> {/foreach} </select> {elseif $group.group_type == 'color'} <ul id="group_{$id_attribute_group}"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <li class="pull-xs-left input-container"> <label> <input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}> <span {if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if} {if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if} ><span class="sr-only">{$group_attribute.name}</span></span> </label> </li> {/foreach} </ul> {elseif $group.group_type == 'radio'} <ul id="group_{$id_attribute_group}"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <li class="input-container pull-xs-left"> <label> <input class="input-radio" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}> <span class="radio-label">{$group_attribute.name}</span> </label> </li> {/foreach} </ul> {/if} </div> {/if} {/foreach} </div> Edited April 25, 2019 by PECHECERISE (see edit history) Link to comment Share on other sites More sharing options...
cyssoo Posted April 25, 2019 Share Posted April 25, 2019 En fait il faudrait voir comment intégrer le code dans votre thème, cela dépend un peu de votre design. Un truc du genre : {elseif $group.group_type == 'color'} <ul id="group_{$id_attribute_group}"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <li class="pull-xs-left input-container"> <label> <input class="input-color" type="radio" data-product-attribute="{$id_attribute_group}" name="group[{$id_attribute_group}]" value="{$id_attribute}"{if $group_attribute.selected} checked="checked"{/if}> <span class="evername">{$group_attribute.name}</span> <span {if $group_attribute.html_color_code}class="color" style="background-color: {$group_attribute.html_color_code}" {/if} {if $group_attribute.texture}class="color texture" style="background-image: url({$group_attribute.texture})" {/if} ><span class="sr-only">{$group_attribute.name}</span></span> </label> </li> {/foreach} </ul> Et avec ceci, vous auriez la class evername en CSS pour faire un peu de design sur cela. Par contre, je n'ai absolument rien testé pour tout vous avouer. Link to comment Share on other sites More sharing options...
PECHECERISE Posted April 25, 2019 Share Posted April 25, 2019 vous me conseillez de rajouter <span class="evername">{$group_attribute.name}</span> a l endroit où vous l avez noter? Link to comment Share on other sites More sharing options...
cyssoo Posted April 26, 2019 Share Posted April 26, 2019 Je vous ai répondu ici J'ai testé, ça fonctionne bien. <p class="col-xs-12">{$group_attribute.name}</p> Link to comment Share on other sites More sharing options...
PECHECERISE Posted April 26, 2019 Share Posted April 26, 2019 bonjour je comprends pas ce que je dois faire? 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