Commit 01d06e32c2fcf6ad91b09aea67dae0964b6bf80b
1 parent
13b04c5b
add variantSku
Showing
1 changed file
with
10 additions
and
12 deletions
Show diff stats
models/Category.php
@@ -244,12 +244,11 @@ | @@ -244,12 +244,11 @@ | ||
244 | ) | 244 | ) |
245 | ->innerJoin('product', 'product.id = product_variant.product_id') | 245 | ->innerJoin('product', 'product.id = product_variant.product_id') |
246 | ->innerJoin('product_category', 'product_category.product_id = product.id') | 246 | ->innerJoin('product_category', 'product_category.product_id = product.id') |
247 | - ->where( | ||
248 | - [ | ||
249 | - 'product_category.category_id' => $this->id, | ||
250 | - 'tax_group.is_filter' => true, | ||
251 | - ] | ||
252 | - ) | 247 | + ->innerJoin('tax_group_to_category', 'tax_group.id = tax_group_to_category.tax_group_id') |
248 | + ->where(['product_category.category_id' => $this->id, | ||
249 | + 'tax_group.is_filter' => TRUE, | ||
250 | + 'tax_group_to_category.category_id'=>$this->id, | ||
251 | + ]) | ||
253 | ->andWhere( | 252 | ->andWhere( |
254 | [ | 253 | [ |
255 | '!=', | 254 | '!=', |
@@ -273,12 +272,11 @@ | @@ -273,12 +272,11 @@ | ||
273 | ->innerJoin('product', 'product.id = product_option.product_id') | 272 | ->innerJoin('product', 'product.id = product_option.product_id') |
274 | ->innerJoin('product_category', 'product_category.product_id = product.id') | 273 | ->innerJoin('product_category', 'product_category.product_id = product.id') |
275 | ->innerJoin('product_variant', 'product_variant.product_id = product.id') | 274 | ->innerJoin('product_variant', 'product_variant.product_id = product.id') |
276 | - ->where( | ||
277 | - [ | ||
278 | - 'product_category.category_id' => $this->id, | ||
279 | - 'tax_group.is_filter' => true, | ||
280 | - ] | ||
281 | - ) | 275 | + ->innerJoin('tax_group_to_category', 'tax_group.id = tax_group_to_category.tax_group_id') |
276 | + ->where(['product_category.category_id' => $this->id, | ||
277 | + 'tax_group.is_filter' => TRUE, | ||
278 | + 'tax_group_to_category.category_id'=>$this->id, | ||
279 | + ]) | ||
282 | ->andWhere( | 280 | ->andWhere( |
283 | [ | 281 | [ |
284 | '!=', | 282 | '!=', |