1. В настройках темы дизайна магазина переключите "Выбор характеристик товара" на "Показывать все значения в ряд"
2. Добавьте в конец файла/шаблона user.css
/**ALAALI**/ .product .options .inline-select a{ vertical-align: top; } .options .inline-select a.alaali{ padding: 1px !important; width: 44px; height: 44px; display: inline-block; } .alaali_img{ border-radius: 2px; width: 40px; height: 40px; } .alaali_img2{ vertical-align: middle; border-radius: 3px; width: 30px; } /**\ALAALI**/
3. Отредактируйте шаблон product.cart.html
найдите код
<!-- SELECTABLE FEATURES selling mode --> {$default_sku_features = $product.sku_features} {$product_available = $product.status} {if $theme_settings.selectable_features_control == 'inline'} <div class="options"> {foreach $features_selectable as $f} <div class="inline-select{if $f.type == 'color'} color-fix{else} inline-no-color{/if}"> {foreach $f.values as $v_id => $v} {if !isset($default_sku_features[$f.id])}{$default_sku_features[$f.id]=$v_id}{/if} <a data-value="{$v_id}" href="#"{if $v_id == ifset($default_sku_features[$f.id])} class="selected"{/if}{if $f.type == 'color'} style="{$v->style}; margin-bottom: 20px;"{/if}> {if $f.type == 'color'} <i class="icon16 checkmark color_checkmark"></i>{/if} {if $f.type == 'color'} <span class="color_name">{strip_tags($v)}</span>{else}{$v}{/if} </a> {/foreach} <input type="hidden" data-feature-id="{$f.id}" class="sku-feature" name="features[{$f.id}]" value="{ifset($default_sku_features[$f.id])}"> </div> {/foreach} </div> {else}
и исправьте на
<!-- SELECTABLE FEATURES selling mode --> {$default_sku_features = $product.sku_features} {$product_available = $product.status} {$feature_images = shopAlaaliHelper::getFeaturesImg($product.id)} {if $theme_settings.selectable_features_control == 'inline'} <div class="options"> {foreach $features_selectable as $f} <div class="inline-select{if $f.type == 'color'} color-fix{else} inline-no-color{/if}"> {foreach $f.values as $v_id => $v} {if !isset($default_sku_features[$f.id])}{$default_sku_features[$f.id]=$v_id}{/if} {if in_array($v_id,$feature_images[$f.id]['id'])} {$v_img = "<img src='"|cat:$feature_images[$f.id]['img'][$v_id]|cat:"' title='"|cat:$feature_images[$f.id]['value'][$v_id]|cat:"' class='alaali_img'>"} <a data-value="{$v_id}" href="#" class="{if $v_id == ifset($default_sku_features[$f.id])}selected{/if} alaali"> {$v_img} {if $f.type == 'color'} <span class="color_name">{strip_tags($v)}</span>{else}{$v}{/if} </a> {else} <a data-value="{$v_id}" href="#"{if $v_id == ifset($default_sku_features[$f.id])} class="selected"{/if}{if $f.type == 'color'} style="{$v->style}; margin-bottom: 20px;"{/if}> {if $f.type == 'color'} <i class="icon16 checkmark color_checkmark"></i>{/if} {if $f.type == 'color'} <span class="color_name">{strip_tags($v)}</span>{else}{$v}{/if} </a> {/if} {/foreach} <input type="hidden" data-feature-id="{$f.id}" class="sku-feature" name="features[{$f.id}]" value="{ifset($default_sku_features[$f.id])}"> </div> {/foreach} </div> {else}
ТО ЖЕ САМОЕ НУЖНО СДЕЛАТЬ В ШАБЛОНЕ product.html! Найти точно такой же блок кода и исправить!
В этой теме дизайна product.cart.html используется только для "быстрого просмотра" товара из каталога. А такой же блок кода в pruduct.html - это основной шаблон "выбираемых характеристик" в карточке товара.
4. Дополнительно отредактируйте шаблон product.html(закладка характеристик)
найдите код
<!-- product features --> {if $product.features} <div id="features-tab" class="product-tab" style="display:none;"> <table class="features table-striped" id="product-features"> {foreach $product.features as $f_code => $f_value} <tr{if $features[$f_code].type == 'divider'} class="divider"{/if}> <td class="name"> <b>{$features[$f_code].name|escape}</b> </td> <td class="value"> {if is_array($f_value)} {if $features[$f_code].type == 'color'} {implode('<br /> ', $f_value)} {else} {implode(', ', $f_value)} {/if} {else} {$f_value} {/if} </td> </tr> {/foreach} </table> </div> {/if}
и исправьте на
<!-- product features --> {if $product.features} {$feature_images2 = shopAlaaliHelper::getFeaturesImg_code($product.id, false)} <div id="features-tab" class="product-tab" style="display:none;"> <table class="features table-striped" id="product-features"> {foreach $product.features as $f_code => $f_value} <tr{if $features[$f_code].type == 'divider'} class="divider"{/if}> <td class="name"> {$features[$f_code].name|escape} </td> <td class="value" itemprop="{$f_code|escape}"> {if is_array($f_value)} {foreach $f_value as $v_id => $value} {if in_array($v_id,$feature_images2[$f_code]['id'])} {$v_img = "<img src='"|cat:$feature_images2[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images2[$f_code]['value'][$v_id]|cat:"' class='alaali_img2'>"} {if $features[$f_code].type == 'color'} {$v_img} {$feature_images2[$f_code]['value'][$v_id]} {else} {$v_img} {/if} {else} {if $features[$f_code].type == 'color'} {$value}{else}{$value|escape}{/if} {/if} {/foreach} {else} {if is_object($f_value)} {assign var=v_id value=$f_value.id} {if in_array($v_id,$feature_images2[$f_code]['id'])} {$v_img = "<img src='"|cat:$feature_images2[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images2[$f_code]['value'][$v_id]|cat:"' class='alaali_img2'>"} {$v_img} {else} {$f_value|escape} {/if} {else} {assign var=v_id value=$f_value} {if in_array($v_id,$feature_images2[$f_code]['id']) || in_array($v_id,$feature_images2[$f_code]['value'])} {$v_img = "<img src='"|cat:$feature_images2[$f_code]['img'][$v_id]|cat:"' title='"|cat :$feature_images2[$f_code]['value'][$v_id]|cat:"' class='alaali_img2'>"} {$v_img} {else} {$f_value|escape} {/if} {/if} {/if} </td> </tr> {/foreach} </table> </div> {/if}
0 комментариев