Плагин "Картинки как на Али" тема "Дизайн со вкусом 2"

1. В бекенде магазина в разделе «Витрина» → вкладка «Оформление» → блок «Выбор характеристик» → отметить опцию «Показать все значения в ряд».

2. Создать файл под названием alaali.css в том же разделе «Витрина» во вкладке «Шаблоны» с кодом

.options .inline-select a.alaali{ 
  padding: 1px; 
} 
.options .inline-select a.alaali > span.alaali_hint{ 
  /*display: none;*/
} 
.alaali_img{
  border-radius: 3px; 
  width: 39px; 
  height: 32px; 
} 
.alaali_img2{ 
  border: 1px solid rgba(0,0,0,0.2); 
}

Примечание: в файле alaali.css строки

.options .inline-select a.alaali > span.alaali_hint{
/*display: none;*/
}

означают «Показывать названия характеристик под выбранной картинкой».

Если наши названия значений характеристик слишком длинные, можно раскомментировать строку «display: none;»

.options .inline-select a.alaali > span.alaali_hint{
display: none;
}

и названия характеристик НЕ будут отображаться под выбранной картинкой.

3. Отредактировать файл head.html.

Найти код

<link rel="stylesheet" href="{$wa_active_theme_url}dsv.shop.min.css?v{$wa_theme_version}">

Сразу после этой строки добавить код

<link rel="stylesheet" href="{$wa_active_theme_url}alaali.css?v{$wa_theme_version}">

Сохранить изменения.

4. Отредактировать файл product.cart.html.

В файле product.cart.html найдите код

<!-- SELECTABLE FEATURES selling mode -->
{$default_sku_features = $product.sku_features}
{if $theme_settings.selectable_features_control == 'inline'}
    <strong style="margin-bottom-5">[`Please select`]:</strong>
    <div class="options">
        {foreach $features_selectable as $f}
            <div class="inline-select{if $f.type == 'color'} 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} rel="nofollow">
                        {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}
{$feature_images = shopAlaaliHelper::getFeaturesImg($product.id)}
{if $theme_settings.selectable_features_control == 'inline'}
    <strong style="margin-bottom-5">[`Please select`]:</strong>
    <div class="options">
        {foreach $features_selectable as $f}
            <div class="inline-select{if $f.type == 'color'} color{/if}">
                {$f.name}:<br>
                {foreach $f.values as $v_id => $v}
                    {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'>"}
                    {/if}
                    {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'])}
                        <a data-value="{$v_id}" href="#" class="alaali {if $v_id == ifset($default_sku_features[$f.id])}selected{/if}" rel="nofollow">
                        {$v_img}
                        <span class="color_name alaali_hint">{strip_tags($v)}</span>
                    {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} rel="nofollow">
                        {if $f.type == 'color'} <span class="color_name">{strip_tags($v)}</span>{else}{$v}{/if}
                    {/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}

5.

- Для версии темы < 2.5 Отредактировать файл product.html.

Найдите код

<!-- Характеристики / Features -->
<div class="tab-pane fade" id="features">
    {if $product.features}
        <table class="table table-striped table-hover table-dsv" id="product-features">
            {foreach $product.features as $f_code => $f_value}
                <tr{if $features[$f_code].type == 'divider'} class="divider"{/if}>
                    <td class="name col-md-4">
                        {$features[$f_code].name|escape}
                    </td>
                    <td class="value col-md-8" itemprop="{$f_code|escape}">
                        {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>
    {/if}
</div>

Замените его на код

<!-- Характеристики / Features -->
<div class="tab-pane fade" id="features">
    {if $product.features}
        {$feature_images = shopAlaaliHelper::getFeaturesImg_code($product.id, false)}
        <table class="table table-striped table-hover table-dsv" id="product-features">
            {foreach $product.features as $f_code => $f_value}
                <tr{if $features[$f_code].type == 'divider'} class="divider"{/if}>
                    <td class="name col-md-4">
                        {$features[$f_code].name|escape}
                    </td>
                    <td class="value col-md-8" itemprop="{$f_code|escape}">
                        {if is_array($f_value)}
                            {if $features[$f_code].type == 'color'}
                                {foreach $f_value as $v_id => $value}
                                    {if in_array($v_id,$feature_images[$f_code]['id'])}
                                        {$v_img = "<img src='"|cat:$feature_images[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images[$f_code]['value'][$v_id]|cat:"' class='alaali_img2' >"}               {$v_img} {$feature_images[$f_code]['value'][$v_id]}<br />
                                    {else}
                                        {$value}<br />
                                    {/if}
                                {/foreach}
                            {else}
                                {foreach $f_value as $v_id => $value}
                                    {if in_array($v_id,$feature_images[$f_code]['id'])}
                                        {$v_img = "<img src='"|cat:$feature_images[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images[$f_code]['value'][$v_id]|cat:"' class='alaali_img2' >"}
                                        {$v_img} <span>{$feature_images[$f_code]['value'][$v_id]}</span><br />
                                    {else}
                                        {$value|escape}<br />
                                    {/if}
                                {/foreach}
                            {/if}
                        {else}
                            {assign var=v_id value=$f_value}
                            {if in_array($v_id,$feature_images[$f_code]['id']) || in_array($v_id,$feature_images[$f_code]['value'])}
                                {$v_img = "<img src='"|cat:$feature_images[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images[$f_code]['value'][$v_id]|cat:"' class='alaali_img2' >"}
                                {$v_img}<br />
                            {else}
                                {$f_value|escape}<br />
                            {/if}
                        {/if}
                    </td>
                </tr>
            {/foreach}
        </table>
    {/if}
</div>


- Для версии темы > 2.5 Отредактировать файл product.features.html.

Код файла

<div id="{$tab.name}" class="{$tab_class|default:'tab-pane fade'}{if $active_tab[$tab.name]} in active{/if}">
    {if $product.features}
    <div class="table-responsive">
        <table class="table table-striped table-hover table-dsv" id="product-features">
            {foreach $product.features as $f_code => $f_value}
                <tr{if $features[$f_code].type == 'divider'} class="divider"{/if}>
                    <td class="name col-md-4">
                        {$features[$f_code].name|escape}
                    </td>
                    <td class="value col-md-8">
                        {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}
</div>

Замените на

<div id="{$tab.name}" class="{$tab_class|default:'tab-pane fade'}{if $active_tab[$tab.name]} in active{/if}">
    {if $product.features}
    <div class="table-responsive">
        <table class="table table-striped table-hover table-dsv" id="product-features">
            {foreach $product.features as $f_code => $f_value}
                <tr{if $features[$f_code].type == 'divider'} class="divider"{/if}>
                    <td class="name col-md-4">
                        {$features[$f_code].name|escape}
                    </td>
                    <td class="value col-md-8" itemprop="{$f_code|escape}">
                        {if is_array($f_value)}
                            {if $features[$f_code].type == 'color'}
                                {foreach $f_value as $v_id => $value}
                                    {if in_array($v_id,$feature_images[$f_code]['id'])}
                                        {$v_img = "<img src='"|cat:$feature_images[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images[$f_code]['value'][$v_id]|cat:"' class='alaali_img2' >"}               {$v_img} {$feature_images[$f_code]['value'][$v_id]}<br />
                                    {else}
                                        {$value}<br />
                                    {/if}
                                {/foreach}
                            {else}
                                {foreach $f_value as $v_id => $value}
                                    {if in_array($v_id,$feature_images[$f_code]['id'])}
                                        {$v_img = "<img src='"|cat:$feature_images[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images[$f_code]['value'][$v_id]|cat:"' class='alaali_img2' >"}
                                        {$v_img} <span>{$feature_images[$f_code]['value'][$v_id]}</span><br />
                                    {else}
                                        {$value|escape}<br />
                                    {/if}
                                {/foreach}
                            {/if}
                        {else}
                            {assign var=v_id value=$f_value}
                            {if in_array($v_id,$feature_images[$f_code]['id']) || in_array($v_id,$feature_images[$f_code]['value'])}
                                {$v_img = "<img src='"|cat:$feature_images[$f_code]['img'][$v_id]|cat:"' title='"|cat:$feature_images[$f_code]['value'][$v_id]|cat:"' class='alaali_img2' >"}
                                {$v_img}<br />
                            {else}
                                {$f_value|escape}<br />
                            {/if}
                        {/if}
                    </td>
                </tr>
            {/foreach}
        </table>
    </div>
    {/if}
</div>
Опубликовано: 15 февраля 2017
Эта статья была полезна? Да Нет

0 комментариев


    Добавить комментарий

    Чтобы добавить комментарий, зарегистрируйтесь или войдите