Опубликовано: 27 октября 2015

Как установить характеристики товара рядом с фото товара? Есть решение

день добрый!

Что необходимо сделать в файле product.html, чтобы получить вид указанный в приложенным фото?


И как добавить блок с триггерами продаж как на примере фото:


Комментарии (1)

  • Решение
    Игорь Колмаков +30 27 октября 2015 17:00 #

    1. в файле "product.html"

    а) замените строку

    {if $product.features}<li data-tab="2"><h2>[`Features`]</h2></li>{/if}

    на

    {*if $product.features}<li data-tab="2"><h2>[`Features`]</h2></li>{/if*}

    б) замените код

    {if $product.features}
    <!-- product features -->
    <div class="tab-name-print show-print"><h2>[`Features`]</h2></div>
    <div id="tab2" class="tab-content show-print">
    <table class="features" id="product-features">
    {foreach $product.features as $f_code => $f_value}
    <tr class="{if $f_value@iteration is div by 2}new-background{/if}{if $f_value@last} no-border{/if}{if $features[$f_code].type == 'divider'} divider{/if}">
    <td class="name">
    {$features[$f_code].name|escape}
    </td>
    <td class="value" 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>
    </div>
    {/if}

    на

    {*if $product.features}
    <!-- product features -->
    <div class="tab-name-print show-print"><h2>[`Features`]</h2></div>
    <div id="tab2" class="tab-content show-print">
    <table class="features" id="product-features">
    {foreach $product.features as $f_code => $f_value}
    <tr class="{if $f_value@iteration is div by 2}new-background{/if}{if $f_value@last} no-border{/if}{if $features[$f_code].type == 'divider'} divider{/if}">
    <td class="name">
    {$features[$f_code].name|escape}
    </td>
    <td class="value" 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>
    </div>
    {/if*}

    2. в файле "product.cart.html"

    после кода

    <div class="product-price">
    {if $product.compare_price > 0}<span class="compare-at-price nowrap"> {if empty($theme_settings.sumbolRUB)}{shop_currency($product.compare_price)}{else}{shop_currency_html($product.compare_price)}{/if} </span>{/if}
    <span data-price="{shop_currency($product.price, null, null, 0)}" class="price nowrap{if $product.compare_price > 0} red{/if}">{if empty($theme_settings.sumbolRUB)}{shop_currency($product.price)}{else}{shop_currency_html($product.price)}{/if}</span>
    </div>

    пропишите

    {if $product.features}
    <table class="features" id="product-features" style="margin:20px 0 0 0;" rel="margin:20px 0 0 0;">
    {foreach $product.features as $f_code => $f_value}
    <tr class="{if $f_value@iteration is div by 2}new-background{/if}{if $f_value@last} no-border{/if}{if $features[$f_code].type == 'divider'} divider{/if}">
    <td class="name">
    {$features[$f_code].name|escape}
    </td>
    <td class="value" 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}


    1
    • Александр Тирон Александр Тирон +23 13 октября 2016 13:59 #

      Инструкция требует дополнения, перед строкой:

      {if $product.features}

      следует добавить строки:

      {if $wa->get('cart')}

      {$_tmp = ["`$product.id`" => $wa->shop->product($product.id)]}

      {$features = $wa->shop->features($_tmp)}

      {/if}

      1

Добавить ответ

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

Услуги

Контакты

Дорогие друзья!

К сожалению, Ваш браузер не поддерживает современные технологии используемые на нашем сайте.

Пожалуйста, обновите браузер, скачав его по ссылкам ниже, или обратитесь к системному администратору, обслуживающему Ваш компьютер.

Internet Explorer

от Microsoft

Chrome

от Google

Safari

от Apple

Opera

от Opera Software

Firefox

от Mozilla

Вверх