Commit 464d2610242e2b03cc1642ed1f3db3d77943c68c
1 parent
3e703aac
add variantSku
Showing
3 changed files
with
12 additions
and
21 deletions
Show diff stats
CatalogUrlManager.php
@@ -119,10 +119,10 @@ | @@ -119,10 +119,10 @@ | ||
119 | ) ? $params[ 'category' ]->lang->alias : strtolower( | 119 | ) ? $params[ 'category' ]->lang->alias : strtolower( |
120 | $params[ 'category' ] | 120 | $params[ 'category' ] |
121 | ); | 121 | ); |
122 | - $url = 'catalog/' . $category_alias . '/'; | 122 | + $url = 'catalog/' . $category_alias ; |
123 | unset( $params[ 'category' ] ); | 123 | unset( $params[ 'category' ] ); |
124 | } else { | 124 | } else { |
125 | - $url = 'catalog/'; | 125 | + $url = 'catalog'; |
126 | } | 126 | } |
127 | 127 | ||
128 | $this->setFilterUrl($params, $url); | 128 | $this->setFilterUrl($params, $url); |
controllers/TaxOptionController.php
@@ -42,16 +42,18 @@ | @@ -42,16 +42,18 @@ | ||
42 | $group = $this->findGroup(Yii::$app->request->queryParams[ 'group' ]); | 42 | $group = $this->findGroup(Yii::$app->request->queryParams[ 'group' ]); |
43 | $searchModel = new TaxOptionSearch(); | 43 | $searchModel = new TaxOptionSearch(); |
44 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); | 44 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
45 | + | ||
45 | /** | 46 | /** |
46 | * @var ActiveQuery $query | 47 | * @var ActiveQuery $query |
47 | */ | 48 | */ |
48 | $query = $dataProvider->query; | 49 | $query = $dataProvider->query; |
49 | $query->andWhere([ 'tax_group_id' => $group->id ]); | 50 | $query->andWhere([ 'tax_group_id' => $group->id ]); |
50 | - if ($group->level) { | ||
51 | - $query->with('productVariants'); | ||
52 | - } else { | ||
53 | - $query->with('products'); | ||
54 | - } | 51 | +// if ($group->level) { |
52 | +// $query->with('productVariants'); | ||
53 | +// } else { | ||
54 | +// $query->with('products'); | ||
55 | +// } | ||
56 | + | ||
55 | return $this->render( | 57 | return $this->render( |
56 | 'index', | 58 | 'index', |
57 | [ | 59 | [ |
views/tax-option/index.php
@@ -32,11 +32,12 @@ | @@ -32,11 +32,12 @@ | ||
32 | ], | 32 | ], |
33 | ]; | 33 | ]; |
34 | $this->params[ 'breadcrumbs' ][] = $this->title; | 34 | $this->params[ 'breadcrumbs' ][] = $this->title; |
35 | + | ||
35 | ?> | 36 | ?> |
36 | <div class="tax-option-index"> | 37 | <div class="tax-option-index"> |
37 | 38 | ||
38 | <h1><?= Html::encode($this->title) ?></h1> | 39 | <h1><?= Html::encode($this->title) ?></h1> |
39 | - | 40 | + |
40 | <p> | 41 | <p> |
41 | <?= Html::a( | 42 | <?= Html::a( |
42 | Yii::t('rubrication', 'Create Option'), | 43 | Yii::t('rubrication', 'Create Option'), |
@@ -44,7 +45,7 @@ | @@ -44,7 +45,7 @@ | ||
44 | [ 'class' => 'btn btn-success' ] | 45 | [ 'class' => 'btn btn-success' ] |
45 | ) ?> | 46 | ) ?> |
46 | </p> | 47 | </p> |
47 | - | 48 | + |
48 | <?php echo GridView::widget( | 49 | <?php echo GridView::widget( |
49 | [ | 50 | [ |
50 | 'dataProvider' => $dataProvider, | 51 | 'dataProvider' => $dataProvider, |
@@ -58,18 +59,6 @@ | @@ -58,18 +59,6 @@ | ||
58 | ], | 59 | ], |
59 | 'imageUrl:image', | 60 | 'imageUrl:image', |
60 | [ | 61 | [ |
61 | - 'label' => $group->level ? \Yii::t('rubrication', 'Variants count') : \Yii::t( | ||
62 | - 'rubrication', | ||
63 | - 'Products count' | ||
64 | - ), | ||
65 | - 'value' => function ($model) use ($group) { | ||
66 | - /** | ||
67 | - * @var TaxOption $model | ||
68 | - */ | ||
69 | - return count($group->level ? $model->productVariants : $model->products); | ||
70 | - }, | ||
71 | - ], | ||
72 | - [ | ||
73 | 'class' => 'yii\grid\ActionColumn', | 62 | 'class' => 'yii\grid\ActionColumn', |
74 | 'template' => '{update} {delete}', | 63 | 'template' => '{update} {delete}', |
75 | ], | 64 | ], |