|
6 | 6 | <div class="product__variants js-product-variants"> |
7 | 7 | {foreach from=$groups key=id_attribute_group item=group} |
8 | 8 | {if !empty($group.attributes)} |
| 9 | + {assign var=groupId value="group_{$id_attribute_group}_{$product.id}"} |
| 10 | + {assign var=legendId value="legend_{$id_attribute_group}_{$product.id}"} |
| 11 | + |
9 | 12 | <fieldset class="product-variant"> |
10 | 13 | <div class="product-variant__label"> |
11 | | - <legend class="form-label product-variant__legend" id="legend_{$product.id}_{$id_attribute_group}">{$group.name}</legend> |
| 14 | + <legend class="form-label product-variant__legend" id="{$legendId}">{$group.name}</legend> |
12 | 15 | <span class="selected-value product-variant__selected" aria-hidden="true"> |
13 | 16 | {l s=': ' d='Shop.Theme.Catalog'} |
14 | 17 | {foreach from=$group.attributes key=id_attribute item=group_attribute} |
|
20 | 23 | {if $group.group_type == 'select'} |
21 | 24 | <select |
22 | 25 | class="form-select" |
23 | | - id="group_{$product.id}_{$id_attribute_group}" |
24 | | - aria-labelledby="legend_{$product.id}_{$id_attribute_group}" |
| 26 | + id="{$groupId}" |
| 27 | + aria-labelledby="{$legendId}" |
25 | 28 | data-product-attribute="{$id_attribute_group}" |
26 | 29 | name="group[{$id_attribute_group}]"> |
27 | 30 | {foreach from=$group.attributes key=id_attribute item=group_attribute} |
28 | 31 | <option value="{$id_attribute}" {if $group_attribute.selected} selected="selected"{/if}>{$group_attribute.name}</option> |
29 | 32 | {/foreach} |
30 | 33 | </select> |
31 | 34 | {elseif $group.group_type == 'color'} |
32 | | - <div id="group_{$product.id}_{$id_attribute_group}" class="product-variant__colors" role="radiogroup" aria-labelledby="legend_{$product.id}_{$id_attribute_group}"> |
| 35 | + <div id="{$groupId}" class="product-variant__colors" role="radiogroup" aria-labelledby="{$legendId}"> |
33 | 36 | {foreach from=$group.attributes key=id_attribute item=group_attribute} |
34 | | - {assign var=optionId value="group_{$product.id}_{$id_attribute_group}_{$id_attribute}"} |
35 | | - {assign var=labelId value="label_{$product.id}_{$id_attribute_group}_{$id_attribute}"} |
36 | | - <div class="product-variant__color input-color"> |
| 37 | + {assign var=optionId value="{$groupId}_{$id_attribute}_{$product.id}"} |
| 38 | + {assign var=labelId value="label_{$id_attribute_group}_{$id_attribute}_{$product.id}"} <div class="product-variant__color input-color"> |
37 | 39 | <input |
38 | 40 | class="input-color__input" |
39 | 41 | type="radio" |
|
62 | 64 | {/foreach} |
63 | 65 | </div> |
64 | 66 | {elseif $group.group_type == 'radio'} |
65 | | - <div id="group_{$product.id}_{$id_attribute_group}" class="product-variant__radios" role="radiogroup" aria-labelledby="legend_{$product.id}_{$id_attribute_group}"> |
| 67 | + <div id="{$groupId}" class="product-variant__radios" role="radiogroup" aria-labelledby="{$legendId}"> |
66 | 68 | {foreach from=$group.attributes key=id_attribute item=group_attribute} |
67 | | - {assign var=optionId value="group_{$product.id}_{$id_attribute_group}_{$id_attribute}"} |
68 | | - {assign var=labelId value="label_{$product.id}_{$id_attribute_group}_{$id_attribute}"} |
| 69 | + {assign var=optionId value="group_{$id_attribute_group}_{$id_attribute}_{$product.id}"} |
| 70 | + {assign var=labelId value="label_{$id_attribute_group}_{$id_attribute}_{$product.id}"} |
69 | 71 | <div class="product-variant__radio form-check"> |
70 | 72 | <input |
71 | 73 | class="form-check-input" |
|
0 commit comments