MMaTT Posted December 5, 2018 Share Posted December 5, 2018 Hello I have products with two attributes type "color" (one for material {$group.name}="Kolor" and one for printing {$group.name}="Nadruk"). I want to show them on mailn page / category page only with material colors {$group.name}="Kolor" Now it's mixed - every colors (material and printing) displays together: How to change this code to show only colors from group "Kolor" ( {$group.name}="Kolor" ) {block name='variant_links'} <div class="variant-links"> {foreach from=$variants item=variant} {block name='variant_link_item'} <a href="{$variant.url}" class="{$variant.type}" {if $variant.type === "color"} style="background-color: {$variant.html_color_code}" {/if} > {$variant.name} </a> {/block} {/foreach} </div> {/block} Regards Link to comment Share on other sites More sharing options...
MMaTT Posted December 8, 2018 Author Share Posted December 8, 2018 (edited) Thanks but i found $group.name in product-variants.tpl file. But i need change variant-links.tpl where $group.name doesn't work. {block name='variant_links'} <div class="variant-links"> {foreach from=$variants item=variant} {block name='variant_link_item'} <a href="{$variant.url}" class="{$variant.type}" {if $variant.type === "color"} style="background-color: {$variant.html_color_code}" {/if} > {$variant.name} </a> {/block} {/foreach} </div> {/block} Edited December 8, 2018 by MMaTT edit html code (see edit history) Link to comment Share on other sites More sharing options...
laqmarc Posted October 1, 2020 Share Posted October 1, 2020 Did you find the solution? Regards Link to comment Share on other sites More sharing options...
MMaTT Posted October 1, 2020 Author Share Posted October 1, 2020 Unfortunately no Because i have the same color materials for every product i put it manually in code - without using attributes. 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