Commit 103e8126a0d6c77f6cb7ae73135e00c3a32127dd
1 parent
65eb3e51
Remove ITEMS_COUNT elements from options and brands
Showing
3 changed files
with
9 additions
and
16 deletions
Show diff stats
common/modules/product/models/BrandSearch.php
... | ... | @@ -133,7 +133,7 @@ class BrandSearch extends Brand |
133 | 133 | } |
134 | 134 | // $query->addSelect("(SELECT COUNT(product_option.product_id) AS products FROM product_option INNER JOIN tax_option ON tax_option.tax_option_id = product_option.option_id INNER JOIN tax_group ON tax_group.tax_group_id = tax_option.tax_group_id WHERE tax_group.alias LIKE '$group' AND tax_option.alias IN (" . implode(',', $options) . ")) AS _items_count"); |
135 | 135 | } |
136 | - $query->addSelect(['_items_count' => $queryCount]); | |
136 | +// $query->addSelect(['_items_count' => $queryCount]); | |
137 | 137 | |
138 | 138 | // if ($productQuery) { |
139 | 139 | // $productQuery->select(['COUNT(product.product_id)']); | ... | ... |
frontend/models/ProductFrontendSearch.php
... | ... | @@ -153,7 +153,7 @@ class ProductFrontendSearch extends Product { |
153 | 153 | $queryCount->andWhere(['<=', 'pv.price', $params['prices']['max']]); |
154 | 154 | } |
155 | 155 | } |
156 | - $query->addSelect(['_items_count' => $queryCount]); | |
156 | +// $query->addSelect(['_items_count' => $queryCount]); | |
157 | 157 | |
158 | 158 | return $query; |
159 | 159 | } | ... | ... |
frontend/views/catalog/products.php
... | ... | @@ -120,13 +120,9 @@ $this->registerJsFile(Yii::getAlias('@web/js/ion.rangeSlider.js'),[ |
120 | 120 | $checked = !empty($filter['brands']) && in_array($brand->alias, $filter['brands']); |
121 | 121 | $option_url = Url::to(['catalog/category', 'category' => $category, 'filter' => ProductHelper::getFilterForOption($filter, 'brands', $brand->alias, $checked)]); |
122 | 122 | ?> |
123 | - <li<?= (empty($brand->_items_count) ? ' class="hidden"' : '')?>> | |
124 | - <input type="checkbox"<?= (empty($brand->_items_count) ? ' disabled' : ' onchange="document.location=\''. $option_url .'\'"')?> class="brands-option" <?= $checked ? ' checked' : ''?> /> | |
125 | - <?php if (empty($brand->_items_count)) :?> | |
126 | - <?= $brand->name?> (<?= $brand->_items_count?>) | |
127 | - <?php else :?> | |
128 | - <a href="<?= $option_url?>"><?= $brand->name?> (<?= $brand->_items_count?>)</a> | |
129 | - <?php endif?> | |
123 | + <li> | |
124 | + <input type="checkbox" onchange="document.location='<?= $option_url?>'" class="brands-option" <?= $checked ? ' checked' : ''?> /> | |
125 | + <a href="<?= $option_url?>"><?= $brand->name?></a> | |
130 | 126 | </li> |
131 | 127 | <?php endforeach?> |
132 | 128 | </ul> |
... | ... | @@ -142,13 +138,10 @@ $this->registerJsFile(Yii::getAlias('@web/js/ion.rangeSlider.js'),[ |
142 | 138 | $checked = (isset($filter['options'][$group->alias]) && in_array($option->alias, $filter['options'][$group->alias])); |
143 | 139 | $option_url = Url::to(['catalog/category', 'category' => $category, 'filter' => ProductHelper::getFilterForOption($filter, 'options', [$option->group->alias => [$option->alias]], $checked)]); |
144 | 140 | ?> |
145 | - <li<?= (empty($option->_items_count) ? ' class="hidden"' : '')?>> | |
146 | - <input type="checkbox"<?= (empty($option->_items_count) ? ' disabled' : ' onchange="document.location=\''. $option_url .'\'"')?> class="features-option" <?php /* name="option[<?= $group->alias?>][]"value="<?= $option->alias?>"*/?><?= $checked ? ' checked' : ''?> /> | |
147 | - <?php if (empty($option->_items_count)) :?> | |
148 | - <?= $option->ValueRenderHTML?> (<?= $option->_items_count?>) | |
149 | - <?php else :?> | |
150 | - <a href="<?= $option_url?>"><?= $option->ValueRenderHTML?> (<?= $option->_items_count?>)</a> | |
151 | - <?php endif?> | |
141 | + <li> | |
142 | + <input type="checkbox" onchange="document.location='<?= $option_url?>'" class="features-option" <?php /* name="option[<?= $group->alias?>][]"value="<?= $option->alias?>"*/?><?= $checked ? ' checked' : ''?> /> | |
143 | + | |
144 | + <a href="<?= $option_url?>"><?= $option->ValueRenderHTML?></a> | |
152 | 145 | </li> |
153 | 146 | <?php endforeach?> |
154 | 147 | </ul> | ... | ... |