{extends 'file:layouts/layout.tpl'} {block 'css'} {/block} {block 'js'} {/block} {block 'seo'} {set $delimeter = (($height | parse_float) >= 9.5 && ($height | parse_float) <= 15.5) ? 'x' : '/'} {set $dimensions = (($width | parse_float) >= 6.5 && ($width | parse_float) <= 15.5) ? $width : $width~$delimeter~$height} {set $options = $dimensions~' R'~$diameter~' '~$load_index~$speed_index} {set $title = $_pls['vendor.name']~' '~$model~' '~$options} {$title} - купить в Самаре, цена шины - {$price} ₽ | Вираж-Шинторг {/block} {block 'main'} {set $vendor_name = $_pls['vendor.resource'] | resource : 'pagetitle'} {set $model_name = $_modx->resource.parent | resource : 'pagetitle'} {set $delimeter = (($height | parse_float) >= 9.5 && ($height | parse_float) <= 15.5) ? 'x' : '/'} {set $dimensions = (($width | parse_float) >= 6.5 && ($width | parse_float) <= 15.5) ? $width : $width~$delimeter~$height} {set $options = $dimensions~' R'~$diameter~' '~$load_index~$speed_index} {set $title = $_pls['vendor.name']~' '~$model~' '~$options} {'@FILE chunks/heading.tpl' | chunk : [ 'title' => 'Шины '~ $title ~' в Самаре' ]} {set $only_even = 'pdoField' | snippet : ['id' => $_modx->resource.id, 'top' => 2, 'field' => 'only_even']}
{if $article?}
Артикул
{$article}
{/if} {if $_pls['vendor.name']?}
Производитель
{$_pls['vendor.name']} {if $_pls['vendor.country']?}({$_pls['vendor.country']}){/if}
{/if}
Модель
Ширина
Высота
Диаметр
{if $season?}
Сезон
{'!sfLink' | snippet : [ 'category' => 5, 'rules' => 5, 'season' => $season, 'tpl' => '@INLINE {$name}' ]}
{/if} {if $car_type?}
Тип автомобиля
{'!sfLink' | snippet : [ 'category' => 5, 'rules' => 4, 'car_type' => $car_type, 'tpl' => '@INLINE {$name}' ]}
{/if} {if $spikes?}
Шипы
{'!sfLink' | snippet : [ 'category' => 5, 'rules' => 6, 'spikes' => $spikes, 'tpl' => '@INLINE {$name}' ]}
{/if} {if $load_index?}
Индекс нагрузки
{$load_index}
{/if} {if $speed_index?}
Индекс скорости
{$speed_index}
{/if} {if $country_of_origin?}
Страна производства
{$country_of_origin}
{/if}
Наличие
{if !$remains} Нет в наличии {else} в наличии {$remains | declension : 'штука|штуки|штук' : true} {/if}
{if $old_price?}
{$old_price} ₽
{/if}
{$price}
{if !$remains} {else} {/if}
{set $raw_price = $price | replace : ' ' : ''}
{set $miltipler = 4} {if $remains < 4} {set $miltipler = $remains} {/if} {($raw_price * $miltipler) | price_format} ₽ — 
{if $b2b && $store == 'base_order'?}
Доставка
до 14 дней
{/if}
{if $remains?} {else} Заказать {/if}
Описание
Доставка и оплата
{$title}
{if $_modx->resource.content?} {$_modx->resource.content | strip_tags | truncate : 500 : '...' } {else} {($_modx->resource.parent | resource : 'content') | replace : '{brand}' : $_pls['vendor.name'] | replace : '{model}' : $model | strip_tags | truncate : 500 : '...' } {/if}

{$title}

{if $_modx->resource.content?} {$_modx->resource.content | userdata} {else} {($_modx->resource.parent | resource : 'content') | replace : '{brand}' : $_pls['vendor.name'] | replace : '{model}' : $model | userdata } {/if}
{10 | resource : 'delivery_payment_intro'}
{10 | resource : 'delivery_payment_intro' | userdata}
{10 | resource : 'content' | userdata}
{set $alternatives = '!pdoPage' | snippet : [ 'parents' => 0, 'element' => 'msProducts', 'limit' => 4, 'includeThumbs' => 'medium', 'tpl' => '@FILE chunks/product.tpl', 'resources' => '-'~$_modx->resource.id, 'where' => ['Data.width = '~$width~' AND Data.height = '~$height~' AND Data.diameter = '~$diameter], 'ajaxMode' => 'button', 'ajaxTplMore' => '@INLINE
' ]} {if $alternatives?}
Альтернатива
{$_modx->getPlaceholder('page.nav')}
{$alternatives}
{/if} {/block}