Странность в выводе количества товаров

Я не знаю, это глюк или мои кривые руки, но вроде копировала из исходника.
Прошу помощи.

Когда заходишь на
makivi2.wowstudio.pro/catalog/kollekczii-iz-kamnej/
выдает «Всего результатов: 4», хотя товаров 7. А берет он 4 из количества товаров joxi.ru/brRO3aTJ1pXjm1

В чанке mFilter2.outer стоит строка, как и в исходнике.
<h3>
[[%mse2_filter_total]] <span id="mse2_total">[[+total:default=`0`]]</span>
</h3>
Начинаю фильтровать, все ОК

Что не так? Почему подставляет не то значение?
Елена Бредова
28 июня 2017, 23:19
modx.pro
2 023
0

Комментарии: 17

Олег
30 июня 2017, 11:53
0
Я думаю стоит включить лог и посмотреть, что происходит.
Володя
30 июня 2017, 21:03
0
скорее всего у вас еще какой то сниппет отрабатывает на этой странице и выставляет плейсхолдер total
    Елена Бредова
    30 июня 2017, 21:05
    0
    Как выяснить какой?
      Володя
      30 июня 2017, 21:07
      0
      посмотреть что в шаблонах, чанках…
        Володя
        30 июня 2017, 21:11
        0
        больше похоже на то что вы вызывате для блока популярне товары сниппет msProduct и как раз их 4
        joxi.ru/v297pD5h3lVXpr
          Елена Бредова
          30 июня 2017, 21:51
          0
          да, там стоит вывод
          [[!msProducts?
                                              &parents=`12`
                                              &tpl=`msProducts.row.top_tpl`
                                              &limit=`1`
                                              &sortby=`RAND()`
                                              &where=`{"Data.popular":"1"}`
                                          ]]
          заменила на
          [[!pdoResources?
                                              &element=`msProducts`
                                              &parents=`12`
                                              &tpl=`msProducts.row.top_tpl`
                                              &limit=`1`
                                              &sortby=`RAND()`
                                              &where=`{"Data.popular":"1"}`
                                          ]]
          Перестал работать вывод топ-товара
            Володя
            30 июня 2017, 21:54
            +1
            Верните как было. Зайдите в документацию и найдите параметр с total. Вот вам нужно в вызове этого снипета его сменить чтобы он не перебивал предыдущее значение
              Елена Бредова
              30 июня 2017, 22:05
              0
              А на что его сменить? В документации ничего не могу найти
                Володя
                30 июня 2017, 22:09
                +1
                totalVar по умолчанию total. Вот этот параметр и задайте в этом вызове сменив на другое значение. Например total2
                  Елена Бредова
                  30 июня 2017, 22:20
                  0
                  Спасибо-спасибо-спасибо!!!

                  Выставила у Топ-товара
                  [[!msProducts?
                                                      &parents=`12`
                                                      &tpl=`msProducts.row.top_tpl`
                                                      &limit=`1`
                                                      &sortby=`RAND()`
                                                      &where=`{"Data.popular":"1"}`
                                                      &showLog=`0`
                                                      &totalVar=`total2`
                                                  ]]
                  и все стало ОК :)
                    Елена Бредова
                    30 июня 2017, 22:22
                    0
                    А можно еще вопрос? :)
                      Елена Бредова
                      30 июня 2017, 22:33
                      0
                      makivi2.wowstudio.pro/ есть популярные товары

                      выводятся
                      [[!msProducts?
                                                          &parents=`12`
                                                          &tpl=`msProducts.row.main_tpl`
                                                          &limit=`8`
                                                          &sortby=`RAND()`
                                                          &showLog=`0`
                                                          &where=`{"Data.popular:=":"1", "OR:Data.new:=":"1", "OR:Data.favorite:=":"1"}`
                                                      ]]
                      но при нажатии на «в корзину» — закидывает в корзину и переводит на страницу товара.

                      сам чанк
                      <div class="col-md-6 col-lg-3 col-xs-12 col-sm-6 {if $new?}new{/if}{if $popular?}popular{/if}{if $favorite?}favorite{/if}">
                                                      <div class="product-box">
                                                          <div class="product-image">
                                                              {if $thumb?}
                                                                  <a href="[[~[[+id]]]]"><img src="{$thumb}" alt="{$pagetitle}" title="{$pagetitle}" /></a>
                                                              {else}
                                                                  <a href="[[~[[+id]]]]"><img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png"
                                                                       srcset="{'assets_url' | option}components/minishop2/img/web/ms2_small@2x.png 2x"
                                                                       alt="{$pagetitle}" title="{$pagetitle}"/></a>
                                                              {/if}
                                                          </div>
                                                          <form method="post">
                                                                      <input type="hidden" name="id" value="{$id}">
                                                                      <input type="hidden" name="count" value="1">
                                                                      <input type="hidden" name="options" value="[]">
                                                                      
                                                                      <div class="product-price">
                                                                      {$price} {'ms2_frontend_currency' | lexicon}
                                                                      
                                                                      {if $old_price?}
                                                                          <strike>{$old_price} {'ms2_frontend_currency' | lexicon}</strike>
                                                                      {/if}
                       												</div>
                       
                       
                                                          			<h3><a href="{$id | url}">{$pagetitle}</a>
                                                                      <span class="flags">
                                                                          {if $new?}
                                                                              <i class="fa fa-star" title="{'ms2_frontend_new' | lexicon}"></i>
                                                                          {/if}
                                                                          {if $popular?}
                                                                              <i class="fa fa-bookmark" title="{'ms2_frontend_popular' | lexicon}"></i>
                                                                          {/if}
                                                                          {if $favorite?}
                                                                              <i class="fa fa-thumbs-o-up" title="{'ms2_frontend_favorite' | lexicon}"></i>
                                                                          {/if}
                                                                      </span>
                                                                      </h3>
                                                                      <div class="product-buy"><button class="btn btn-success" type="submit" name="ms2_action" value="cart/add"><i class="fa fa-shopping-cart" aria-hidden="true"></i> {'ms2_frontend_add_to_cart' | lexicon}</button></div>
                                                                  </form>
                                                      </div>
                                                  </div>


                      Уже пробовала подключать другие чанки, но дело не в кнопке.

                      Уже третий день разбираюсь :((( и никак
                        Володя
                        30 июня 2017, 22:40
                        +2
                        У вас у формы не хватает класса. В любой непонятной ситуации пробуйте стандартные чанки и ищите отличия.
              Елена Бредова
              30 июня 2017, 22:04
              0
              Да, Вы правы, нашла как включить логи, пишет

              0.0001040: pdoTools loaded.
              0.0001900: Conditions prepared
              0.0000250: xPDO query object created
              0.0001671: leftJoined msProductData as Data
              0.0000780: leftJoined msVendor as Vendor
              0.0000010: Grouped by msProduct.id
              0.0000279: Added selection of msProduct: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
              0.0000150: Added selection of msProductData: `article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`
              0.0000131: Added selection of msVendor: `name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`
              0.0005810: Processed additional conditions
              0.0007300: Added where condition: class_key=msProduct, Data.popular=1, msProduct.parent:IN(12,16,17,33,18,19,20,23,24,25,26,21,22), msProduct.published=1, msProduct.deleted=0
              0.0000410: Sorted by RAND(), ASC
              0.0000019: Limited to 1, offset 0
              0.0002232: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`article`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties` FROM `modx_site_content` AS `msProduct` LEFT JOIN `modx_ms2_products` `Data` ON `msProduct`.`id` =  `Data`.`id` LEFT JOIN `modx_ms2_vendors` `Vendor` ON Data.vendor=Vendor.id WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `Data`.`popular` = '1' AND `msProduct`.`parent` IN (12,16,17,33,18,19,20,23,24,25,26,21,22) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id ORDER BY RAND() ASC LIMIT 1 "
              0.0006771: SQL executed
              0.0000679: Total rows: 4
              0.0000169: Rows fetched
              0.0000379: Returning raw data
              0.0006270: Checked the active modifiers
              0.0011339: Loaded "modChunk" with name "msProducts.row.top_tpl"
              0.0056610: Compiled Fenom chunk with name "modchunk/111"
              0.0004289: Time to load products options
              0.0109930: Total time
              18 874 368: Memory usage
          Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
          17