laurens Posted December 14, 2012 Share Posted December 14, 2012 Bonjour, je n'arrive pas a positionner le titre " couleurs disponibles" devant les carrés de couleurs , voici le bout de code que j'ai mis {if !empty($product.colors)} <span>{l s='Couleurs disponibles :'}</span> <ul> {foreach from=$product.colors key=id_attribute item=color} <span class="color_picker" style="background: {$color.value};" title="{$color.name}"></span> {/foreach} </ul> {/if} Link to comment Share on other sites More sharing options...
laurens Posted December 15, 2012 Author Share Posted December 15, 2012 Bonjour, personne pour m'aider Link to comment Share on other sites More sharing options...
MayMo design Posted December 19, 2012 Share Posted December 19, 2012 1) il faut du <li> dans une balise <ul> et non pas du <span> 2) pour mettre couleurs disponibles" devant les carrés de couleurs, il faut jouer sur les CSS, donc soit nous donner un lien du site, soitsi tu as un peu de connaissance en CSS, tu trouveras la solution. utilise firebug avec firefox. Link to comment Share on other sites More sharing options...
laurens Posted December 20, 2012 Author Share Posted December 20, 2012 (edited) Bonjour et merci de me répondre, j'essai de comprendre un peut les bases donc faut pas m'en vouloir pour mes erreurs,voila ce que j'ai mis et ça marche pourriez vous me corriger correctement {if !empty($product.colors)} <span class="color_text">Couleurs disponibles :</span> {foreach from=$product.colors key=id_attribute item=color} <span class="color_picker" style="background: {$color.value};" title="{$color.name}"></span> {/foreach} {/if} dans le css : #product_list .color_text {float: left; #product_list .color_picker { display: block; float: left; width: 10px; height: 10px; margin: 5px 2px 5px 2px; cursor: pointer; border: 1px solid #000000; } Edited December 20, 2012 by laurens (see edit history) Link to comment Share on other sites More sharing options...
MayMo design Posted December 20, 2012 Share Posted December 20, 2012 {if !empty($product.colors)} <span class="color_text">Couleurs disponibles :</span> <ul id="color_picker"> {foreach from=$product.colors key=id_attribute item=color} <li class="color_picker" style="background: {$color.value};" title="{$color.name}"></li> {/foreach} <ul> {/if} dans les css : #product_list .color_text {float: left;} #product_list ul#color_picker {float: left;} #product_list li.color_picker { display: block; float: left; width: 10px; height: 10px; margin: 5px 2px 5px 2px; cursor: pointer; border: 1px solid #000000; } Link to comment Share on other sites More sharing options...
laurens Posted December 20, 2012 Author Share Posted December 20, 2012 Merci et bonne journée Link to comment Share on other sites More sharing options...
laurens Posted December 22, 2012 Author Share Posted December 22, 2012 Bonjour, je relance ce post car j'ai pas tout résolu et j'ai encore besoin de vous voila j'ai bien mes couleurs qui s'affiche sur mes articles (image1) mais quand j'active la navigation à facettes les carrés de couleurs disparaissent (image2) j'ai mis ce bout de code dans blocklayered.php foreach ( $products as $key => $cat_product ) { $product = new Product ( intval ( $cat_product[ 'id_product' ] ), true ,$cookie -> id_lang); $colors = array(); $attributesGroups = $product->getAttributesGroups($cookie -> id_lang); if ( Db :: getInstance ()-> numRows ()) { foreach ( $attributesGroups AS $k => $row ) { /* Color management */ if (isset( $row[ 'attribute_color' ] ) AND $row[ 'attribute_color' ] ) { $colors[$row[ 'id_attribute' ]][ 'value' ] = $row[ 'attribute_color' ] ; $colors[$row[ 'id_attribute' ]][ 'name' ] = $row[ 'attribute_name' ] ; if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) $colors[$row['id_attribute']]['attributes_quantity'] = 0; $colors[$row['id_attribute']]['attributes_quantity'] += (int)($row['quantity']); } } } $products[$key][ 'colors' ] = $colors ; } mais voila ça m'affiche bien les couleurs mais aussi les tailles sous forme de carré noir (image3) Merci image1.bmp image2.bmp image3.bmp 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