Опубликовано: 30 июня 2015
Как сделать из двух вкладок "Описание" и "Характеристики" одну? Есть решение
Добрый день!
Каждый второй посетитель сайта задаёт один и тот же вопрос: а какой размер изделия?
Они не догадываются, что нужно нажать на вкладку "Характеристики". Можно ли объединить вкладки "Описание" и "Характеристики", например так, что сначала идет блок "Описание", а ниже блок "Характеристики" ?
Комментарии (7)
В файле "product.html" (магазин-витрина-шаблоны)
1. замените строку
{if $product.features}<li data-tab="2"><h2>[`Features`]</h2></li>{/if}
на
{*if $product.features}<li data-tab="2"><h2>[`Features`]</h2></li>{/if*}
2. замените блок
{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}
{if $features[$f_code].code != 'tip_vidoiskatelya'}
<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>
{/if}
{/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}
{if $features[$f_code].code != 'tip_vidoiskatelya'}
<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>
{/if}
{/foreach}
</table>
</div>
{/if*}
3. после строки
<div class="description" id="product-description" itemprop="description">{$product.description}</div>
вставьте блок
<table class="features" id="product-features">
{foreach $product.features as $f_code => $f_value}
{if $features[$f_code].code != 'tip_vidoiskatelya'}
<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>
{/if}
{/foreach}
</table>
4. замените строку
{if $product.description}<li data-tab="1" class="selected"><h2>[`Description`]</h2></li>{/if}
на
{if $product.description || $product.features}<li data-tab="1" class="selected"><h2>[`Description`]</h2></li>{/if}
5. замените строку
{if $product.description}
на
{if $product.description || $product.features}
Огромное спасибо! Всё получилось.
Только у меня почему-то немного другой код был. Пришлось немного по-разбираться, чтобы вставить нужный код в нужное место.
Версия шаблона 2.3.1
Извиняюсь - решение написал для "купить просто"
исправил
День добрый!
А где исправления!? В теме "удобная покупка я так и не нашел пункт
1. замените строку
{if $product.features}<li data-tab="2"><h2>[`Features`]</h2></li>{/if}
на
{*if $product.features}<li data-tab="2"><h2>[`Features`]</h2></li>{/if*}
Искали там где написано
В файле "product.html" (магазин-витрина-шаблоны)?
Добрый день, сделали все как написанно, но в случаи отсутствия описания, характеристики, также не отображаются.
дописал 4 и 5-й пункты
Спасибо! Мне тоже было это актуально.