Добрый день, есть шаблон товаров, который выводится в списке по шаблону product_items.tpl его код:
{set:ignore $tpl}
    {set $items = []}
    {set $thumbs = $thumbs | split : ','}
    {set $images = $images | split : ','}
    {foreach $thumbs as $idx => $current_thumb}
        {set $current_image = $images[$idx]}
        {if !$current_image || !$current_thumb}{continue}{/if}
        {set $items[] = [
            'thumb' => $current_thumb,
            'image' => $current_image,
        ]}
    {/foreach}
    {if count($items) == 0}
        {set $items[] = [
            'thumb' => ('assets/img/no-image.png' | phpthumbon : 'w=600&h=330&zc=1&q=95'),
            'image' => 'assets/img/no-image.png',
        ]}
    {/if}

    <div class="col-12 mb-3 mb-xl-4 squared-item" data-id="{$idx}">
        <div class="bg-white">
            <div class="h-100 border p-3">
                <div class="row">
                    <div class="col-sm-7">
                        {foreach $items as $idx => $item}
                            <a class="position-relative h-100 {if !$item@first}d-none{else}d-block{/if}" data-fancybox="gallery{$id}" href="{$item['image']}">
                                <img src="{$item['thumb']}" class="d-sm-none" />
                                <div class="loop">
                                    <img class="loop-img" src="{'assets_url' | config}img/icons/loop.svg" height="25" />
                                </div>
                                <div class="d-none d-sm-block block-product-image bg-top inner h-100" style="background-image: url('{$item['thumb']}')"></div>
                            </a>
                        {/foreach}
                    </div>
                    <div class="col-sm-5">
                        <div class="my-3 d-flex flex-column justify-content-center block-product-data">
                            <div>
                                <div class="f7 font-weight-bold mb-4 squared-title">
                                    <a class="black-link" href="{$uri}">
                                        {($text_preview ?: $pagetitle) | nl2br}
                                    </a>
                                </div>
                                <div class="my-2">
                                    {if $scope}
                                        <div>
                                            <div class="f10 text-gray1">
                                                Сфера применения:
                                            </div>
                                            <div class="fw-400 f11">
                                                {$scope}
                                            </div>
                                        </div>
                                    {/if}
                                </div>
                                <div class="my-2">
                                    {if $vendor}
                                        <div>
                                            <div class="f10 text-gray1">
                                                Производитель:
                                            </div>
                                            <div class="fw-400 f11 text-uppercase">
                                                {$vendor}
                                            </div>
                                        </div>
                                    {/if}
                                </div>
                                <div class="my-2">
                                    {if $cost}
                                        <div>
                                            <div class="f10 text-gray1">
                                                Цена:
                                            </div>
                                            <div class="fw-400 f11">
                                                {$cost}
                                            </div>
                                        </div>
                                    {/if}
                                </div>
                                
                                
<div class="my-2">
{if $accordeon}
<div>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
  Посмотреть прайс
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModalCenter"  role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLongTitle">{$pagetitle}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
          <div class="fw-400 f11">
        {$accordeon}
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal">Закрыть</button>
      </div>
    </div>
  </div>
</div>
</div>
{/if}
</div>
                                
                            </div>
                            <div class="mt-3">
                                <a class="linked-a" href="#" data-callback data-title="{$pagetitle | escape}">
                                    Оставить заявку
                                </a>
                            </div>
                            
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{/set}

{set:ignore $tplWrapper}
    <div class="row no-gutters mb-5 animatedParent animateOnce" data-sequence='250'>
        {$output}
    </div>
{/set}

{var $config = [
    'parents' => 'id' | resource,
    'limit' => 0,
    'depth' => 0,
    'includeTVs' => [
        'text_preview',
        'scope',
        'vendor',
        'accordeon',
        'cost',
    ] | join : ',',
    'leftJoin' => [
        'Gal' => [
            'alias' => 'Gal',
            'class' => 'msResourceFile',
            'on' => 'modResource.id = Gal.resource_id AND Gal.parent = 0',
        ],
        'GalPreview' => [
            'alias' => 'GalPreview',
            'class' => 'msResourceFile',
            'on' => 'modResource.id = GalPreview.resource_id AND GalPreview.path LIKE "%medium2%"',
        ],
    ],
    'select' => [
        'modResource.uri as uri',
        'modResource.id as id',
        'modResource.pagetitle as pagetitle',
        "GROUP_CONCAT(DISTINCT GalPreview.url ORDER BY GalPreview.rank ASC) as thumbs",
        "GROUP_CONCAT(DISTINCT Gal.url ORDER BY Gal.rank ASC) as images"
    ],
    'loadModels' => 'ms2gallery',
    'tvPrefix' => '',
    'groupby' => 'modResource.id',
    'sortby' => 'menuindex',
    'sortdir' => 'ASC',
    'where' => [
        'modResource.template' => 10
    ],
    'tpl' => '@INLINE'~$tpl,
    'tplWrapper' => '@INLINE'~$tplWrapper,
    'setTotal' => true,
    'totalVar' => 'totalProducts'
]}
{'pdoResources' | snippet : $config}
{var $total = 'totalProducts' | placeholder}
{if $total}
    {set:ignore $js | jsToBottom}
        
    {/set}
{/if}

все поля цена (cost), производитель (vendor), сфера применения (scope) выводятся корректно для каждого товара из списка, а вот прайс-лист (accordeon) всегда берется из первого по списку товара. Помогите, чтобы у каждого товара по списку выводился свой accordeon. Спасибо