From 464d2610242e2b03cc1642ed1f3db3d77943c68c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 29 Nov 2016 22:03:57 +0200 Subject: [PATCH] add variantSku --- CatalogUrlManager.php | 4 ++-- controllers/TaxOptionController.php | 12 +++++++----- views/tax-option/index.php | 17 +++-------------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/CatalogUrlManager.php b/CatalogUrlManager.php index 6e1616e..9856820 100755 --- a/CatalogUrlManager.php +++ b/CatalogUrlManager.php @@ -119,10 +119,10 @@ ) ? $params[ 'category' ]->lang->alias : strtolower( $params[ 'category' ] ); - $url = 'catalog/' . $category_alias . '/'; + $url = 'catalog/' . $category_alias ; unset( $params[ 'category' ] ); } else { - $url = 'catalog/'; + $url = 'catalog'; } $this->setFilterUrl($params, $url); diff --git a/controllers/TaxOptionController.php b/controllers/TaxOptionController.php index cd00b1f..6f78463 100755 --- a/controllers/TaxOptionController.php +++ b/controllers/TaxOptionController.php @@ -42,16 +42,18 @@ $group = $this->findGroup(Yii::$app->request->queryParams[ 'group' ]); $searchModel = new TaxOptionSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + /** * @var ActiveQuery $query */ $query = $dataProvider->query; $query->andWhere([ 'tax_group_id' => $group->id ]); - if ($group->level) { - $query->with('productVariants'); - } else { - $query->with('products'); - } +// if ($group->level) { +// $query->with('productVariants'); +// } else { +// $query->with('products'); +// } + return $this->render( 'index', [ diff --git a/views/tax-option/index.php b/views/tax-option/index.php index 12de0fe..06ad73c 100755 --- a/views/tax-option/index.php +++ b/views/tax-option/index.php @@ -32,11 +32,12 @@ ], ]; $this->params[ 'breadcrumbs' ][] = $this->title; + ?>

title) ?>

- +

'btn btn-success' ] ) ?>

- + $dataProvider, @@ -58,18 +59,6 @@ ], 'imageUrl:image', [ - 'label' => $group->level ? \Yii::t('rubrication', 'Variants count') : \Yii::t( - 'rubrication', - 'Products count' - ), - 'value' => function ($model) use ($group) { - /** - * @var TaxOption $model - */ - return count($group->level ? $model->productVariants : $model->products); - }, - ], - [ 'class' => 'yii\grid\ActionColumn', 'template' => '{update} {delete}', ], -- libgit2 0.21.4