Не получается вывести товары в виде слайдера ModxRevo из minishop2
Столкнулся с парой вопросов. Тыкаюсь несколько дней и пока безуспешно.
- Задача вывести в слайдере товары. Каждый слайд обернут в контейнер, внутри которого выводятся по 4 товара. Соответственно, если сделать вызов msProducts или pdoPage сначала сладов, в чанках которых будет еще по вызову товаров это неправильно. К тому же, надо, чтобы товары в своем количестве выводились по 4 штуки. В первом слайде с1-4, во втором с 5-8 и т.д. Как это можно сделать? Задача вывести товары в болоке магазина на minishop2 с меткой «Новинка».
Вывожу так:
[ [! msProducts?
&limit=18
&parents=5,6,17
&depth=10
&includeThumbs=medium
&includeTVs=1
&processTVs=1
&tpl=smallSlidesTpl
&includeContent=1
&where={ " Data.new ": " 1 " }
] ]
При нажатии на кнопки ДЛЯ НЕЕ, ДЛЯ НЕГО и ЭКСКЛЮЗИВ должны выводится под ними товары из соответствующей категории. Верстка с вызовом такая:
<div class="product-tab-nav mb-35">
<div class="row align-items-center">
<div class="col-12">
<div class="section-title text-center mb-30">
<h2 class="title text-dark">Категории товаров</h2>
<p class="text mt-10">Найди подходящий вариант</p>
</div>
</div>
<div class="col-12">
<nav class="product-tab-menu theme1">
<ul class="nav nav-pills justify-content-center" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="pills-home-tab" data-toggle="pill" href="#for-her"
role="tab" aria-controls="pills-home" aria-selected="true">Для нее</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-profile-tab" data-toggle="pill" href="#for-him"
role="tab" aria-controls="pills-profile" aria-selected="false">Для него</a>
</li>
<li class="nav-item">
<a class="nav-link" id="pills-contact-tab" data-toggle="pill" href="#exclusive"
role="tab" aria-controls="pills-contact" aria-selected="false">Эксклюзив</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- product-tab-nav end -->
<div class="row">
<div class="col-12">
<div class="tab-content" id="pills-tabContent">
<!-- first tab-pane -->
<div class="tab-pane fade show active" id="for-her" role="tabpanel"
aria-labelledby="pills-home-tab">
<div class="product-slider-init theme1 slick-nav">
[ [ ! msProducts?
&groupby=`msCategory.id`
&parents=`5`
&includeThumbs=`medium`
&includeTVs=`1`
&tpl=`slideProductTplUp`
&tplOdd=`slideProductTplDown`
&includeContent=`1`
] ]
</div>
</div>
<!-- second tab-pane -->
<div class="tab-pane fade" id="for-him" role="tabpanel" aria-labelledby="pills-profile-tab">
<div class="product-slider-init theme1 slick-nav">
[ [ ! msProducts?
&groupby=`msCategory.id`
&limit=`50`
&parents=`6`
&includeThumbs=`medium`
&includeTVs=`1`
&tpl=`slideProductTplUp`
&tplOdd=`slideProductTplDown`
&includeContent=`1`
] ]
</div>
</div>
<!-- third tab-pane -->
<div class="tab-pane fade" id="exclusive" role="tabpanel" aria-labelledby="pills-contact-tab">
<div class="product-slider-init theme1 slick-nav">
[ [ ! msProducts?
&groupby=`msCategory.id`
&limit=`50`
&parents=`17`
&includeThumbs=`medium`
&includeTVs=`1`
&tpl=`slideProductTplUp`
&tplOdd=`slideProductTplDown`
&includeContent=`1`
] ]
</div>
</div>
</div>
</div>
</div>
Почему-то не выводятся, либо не реагируют на нажатие кнопки табов. Может не допустимо делать несколько вызовов? Чанки slideProductTplUp
<div class="slider-item">
<div class="ms2_product product-list mb-30">
<form method="post" class="ms2_form d-flex flex-column flex-md-row align-items-center no-gutters">
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="count" value="1">
<input type="hidden" name="options" value="[]">
<div class="card product-card">
<div class="card-body p-0">
<div class="media flex-column">
<div class="product-thumbnail position-relative">
{if $new?}
<span class="badge badge-danger top-right">{'ms2_frontend_new' | lexicon}</span>
{/if}
{if $popular?}
<span class="badge badge-danger top-right">{'ms2_frontend_popular' | lexicon}</span>
{/if}
{if $favorite?}
<span class="badge badge-danger top-right">{'ms2_frontend_favorite' | lexicon}</span>
{/if}
<a href="{$id | url}">
{if $medium?}
<img src="{$medium}" class="first-img" alt="{$pagetitle}" title="{$pagetitle}"/>
{else}
<img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png"
srcset="{'assets_url' | option}components/minishop2/img/web/[email protected] 2x"
class="mw-100" alt="{$pagetitle}" title="{$pagetitle}"/>
{/if}
</a>
<!-- product links -->
<ul class="product-links d-flex justify-content-center">
<li>
<a href="wishlist.html">
<span data-toggle="tooltip" data-placement="bottom"
title="add to wishlist" class="icon-heart"> </span>
</a>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#compare">
<span data-toggle="tooltip" data-placement="bottom"
title="Add to compare" class="icon-shuffle"></span>
</a>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#quick-view">
<span data-toggle="tooltip" data-placement="bottom"
title="Quick view" class="icon-magnifier"></span>
</a>
</li>
</ul>
<!-- product links end-->
</div>
<div class="media-body">
<div class="product-desc">
<h3 class="title" style="10px;font-size: 20px;font-weight: bold;min-height: 56px;"><a href="{$id | url}">{$pagetitle}</a></h3>
<div style="min-height: 75px;margin-bottom: 20px;line-height: 1.5em;">
[[+description:ellipsis=`90`:default=`[[+content:ellipsis=`90`:striptags]]`]]
</div>
<!--<div class="star-rating">
<span class="ion-ios-star"></span>
<span class="ion-ios-star"></span>
<span class="ion-ios-star"></span>
<span class="ion-ios-star"></span>
<span class="ion-ios-star de-selected"></span>
</div>-->
<div class="d-flex align-items-center justify-content-between">
<h6 class="product-price">
{if $old_price?}
<del class="del">{$old_price} {'ms2_frontend_currency' | lexicon}</del>
{/if}
<span class="onsale">{$price} {'ms2_frontend_currency' | lexicon}</span>
</h6>
<button class="pro-btn" data-toggle="modal" data-target="#add-to-cart" type="submit" name="ms2_action" value="cart/add"><i
class="icon-basket"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- product-list End -->
</form>
</div>
и slideProductTplDown
<div class="ms2_product product-list">
<form method="post" class="ms2_form d-flex flex-column flex-md-row align-items-center no-gutters">
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="count" value="1">
<input type="hidden" name="options" value="[]">
<div class="card product-card">
<div class="card-body p-0">
<div class="media flex-column">
<div class="product-thumbnail position-relative">
<span class="badge badge-success top-left">-10%</span>
{if $new?}
<span class="badge badge-danger top-right">{'ms2_frontend_new' | lexicon}</span>
{/if}
{if $popular?}
<span class="badge badge-danger top-right">{'ms2_frontend_popular' | lexicon}</span>
{/if}
{if $favorite?}
<span class="badge badge-danger top-right">{'ms2_frontend_favorite' | lexicon}</span>
{/if}
<a href="{$id | url}">
{if $medium?}
<img src="{$medium}" class="first-img" alt="{$pagetitle}" title="{$pagetitle}"/>
{else}
<img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png"
srcset="{'assets_url' | option}components/minishop2/img/web/[email protected] 2x"
class="mw-100" alt="{$pagetitle}" title="{$pagetitle}"/>
{/if}
</a>
<!-- product links -->
<ul class="product-links d-flex justify-content-center">
<li>
<a href="wishlist.html">
<span data-toggle="tooltip" data-placement="bottom"
title="add to wishlist" class="icon-heart"> </span>
</a>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#compare">
<span data-toggle="tooltip" data-placement="bottom"
title="Add to compare" class="icon-shuffle"></span>
</a>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#quick-view">
<span data-toggle="tooltip" data-placement="bottom"
title="Quick view" class="icon-magnifier"></span>
</a>
</li>
</ul>
<!-- product links end-->
</div>
<div class="media-body">
<div class="product-desc">
<h3 class="title" style="10px;font-size: 20px;font-weight: bold;min-height: 56px;"><a href="{$id | url}">{$pagetitle}</a></h3>
<div style="min-height: 75px;margin-bottom: 20px;line-height: 1.5em;">
[[+description:ellipsis=`90`:default=`[[+content:ellipsis=`90`:striptags]]`]]
</div>
<!--<div class="star-rating">
<span class="ion-ios-star"></span>
<span class="ion-ios-star"></span>
<span class="ion-ios-star"></span>
<span class="ion-ios-star"></span>
<span class="ion-ios-star de-selected"></span>
</div>-->
<div class="d-flex align-items-center justify-content-between">
<h6 class="product-price">
{if $old_price?}
<del class="del">{$old_price} {'ms2_frontend_currency' | lexicon}</del>
{/if}
<span class="onsale">{$price} {'ms2_frontend_currency' | lexicon}</span>
</h6>
<button class="pro-btn" data-toggle="modal" data-target="#add-to-cart" type="submit" name="ms2_action" value="cart/add"><i
class="icon-basket"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- product-list End -->
</form>
</div>
</div>
Пробовал через pdoPage и тоже не получилось. Прежде как-то раз получилось, но во всех категориях выводились все товары магазина без разбора. Что я делаю не так? Спасибо.

