mima9506 Posted January 21, 2018 Share Posted January 21, 2018 Mam problem na liście produktów z danej kategorii. Potrzebuję mieć możliwość wyboru atrybutu i dodania go do koszyka. Wyświetlanie atrybutów jest bez problemowe, tylko podczas dodawania do koszyka nie jest brany pod uwagę atrybut. Przesyłam kod który używam. W załączniku przesyłam o co mi chodzi. <div class="col-md-8 col-sm-8 col-xs-8"> <div class="choose-size text-left"> {foreach from=$combinations key=k item=comb} {* because the array key are id_product, we can separate the product combinations in here with if/else statement compared with the id_product from the foreach loop of products-list *} {if $k == $product.id_product} <span class="size-text" {if empty($comb)} style="display: none;"{/if}>rozmiar:</span> <span class="styled-select" {if empty($comb)} style="display: none;"{/if}> <select> {foreach from=$comb item=attr} <option value="{$attr.id_attribute}">{$attr.attribute_name}</option> {/foreach} </select> </span> {/if} {/foreach} </div> </div> 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