From 871a734907eeacc25c625fbcf0fdabcab2905de8 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Mon, 15 Aug 2016 18:43:37 +0300 Subject: [PATCH] big commti --- backend/controllers/CategoryController.php | 4 ++-- backend/controllers/SiteController.php | 6 ++---- common/modules/product/controllers/ManageController.php | 3 --- common/modules/product/helpers/FilterHelper.php | 4 +--- common/modules/product/helpers/ProductHelper.php | 6 ++---- common/modules/product/models/Brand.php | 39 +-------------------------------------- common/modules/product/models/BrandName.php | 66 ------------------------------------------------------------------ common/modules/product/models/BrandSearch.php | 7 ++----- common/modules/product/models/Category.php | 82 +++++++++++++++++++++++----------------------------------------------------------- common/modules/product/models/CategoryName.php | 66 ------------------------------------------------------------------ common/modules/product/models/CategoryQuery.php | 1 - common/modules/product/models/CategorySearch.php | 4 +--- common/modules/product/models/Product.php | 2 +- common/modules/product/models/ProductSearch.php | 2 +- common/modules/product/models/ProductVariantSearch.php | 2 +- common/modules/product/widgets/brandsCarouselWidget.php | 2 +- common/modules/product/widgets/views/submenu.php | 8 ++++---- common/modules/rubrication/views/tax-group/_form.php | 2 +- console/controllers/ImportController.php | 3 --- frontend/controllers/CatalogController.php | 2 +- frontend/models/ProductFrontendSearch.php | 2 +- frontend/views/catalog/_product_item.php | 4 ++-- 22 files changed, 47 insertions(+), 270 deletions(-) delete mode 100755 common/modules/product/models/BrandName.php delete mode 100755 common/modules/product/models/CategoryName.php diff --git a/backend/controllers/CategoryController.php b/backend/controllers/CategoryController.php index 0556c9b..11c2b78 100755 --- a/backend/controllers/CategoryController.php +++ b/backend/controllers/CategoryController.php @@ -97,7 +97,7 @@ class CategoryController extends Controller } return $this->render('create', [ 'model' => $model, - 'categories' => ArtboxTreeHelper::treeMap(Category::find()->with('categoryName')->getTree(), 'category_id', 'categoryName.value', '.') + 'categories' => ArtboxTreeHelper::treeMap(Category::find()->getTree(), 'category_id', 'name', '.') ]); } } @@ -125,7 +125,7 @@ class CategoryController extends Controller } else { return $this->render('update', [ 'model' => $model, - 'categories' => ArtboxTreeHelper::treeMap(Category::find()->with('categoryName')->getTree(), 'category_id', 'categoryName.value', '.') + 'categories' => ArtboxTreeHelper::treeMap(Category::find()->getTree(), 'category_id', 'name', '.') ]); } } diff --git a/backend/controllers/SiteController.php b/backend/controllers/SiteController.php index ff13865..10b5c43 100755 --- a/backend/controllers/SiteController.php +++ b/backend/controllers/SiteController.php @@ -2,9 +2,7 @@ namespace backend\controllers; use developeruz\db_rbac\behaviors\AccessBehavior; use common\modules\product\models\Brand; -use common\modules\product\models\BrandName; use common\modules\product\models\Category; -use common\modules\product\models\CategoryName; use common\modules\product\models\Product; use common\modules\product\models\ProductVariant; use common\modules\product\models\ProductVariantType; @@ -199,7 +197,7 @@ class SiteController extends Controller } // ==== Set category ==== - if ( ($category = CategoryName::find()->filterWhere(['ilike', 'value', trim($catalog_name)])->one()) !== null ) { + if ( ($category = Category::find()->filterWhere(['ilike', 'name', trim($catalog_name)])->one()) !== null ) { $_product->categories = [$category->category_id]; } else { // Create category @@ -211,7 +209,7 @@ class SiteController extends Controller // ===== Set brand ==== if ( $brand_name ) { - if ( ($brand = BrandName::find()->filterWhere(['ilike', 'value', trim($brand_name)])->one()) !== null ) { + if ( ($brand = Brand::find()->filterWhere(['ilike', 'name', trim($brand_name)])->one()) !== null ) { $_product->brand_id = $brand->brand_id; } else { // Create brand diff --git a/common/modules/product/controllers/ManageController.php b/common/modules/product/controllers/ManageController.php index fcb5b10..1c04be5 100755 --- a/common/modules/product/controllers/ManageController.php +++ b/common/modules/product/controllers/ManageController.php @@ -8,7 +8,6 @@ use common\modules\product\models\Export; use common\modules\product\models\Import; use common\modules\product\models\ProductImage; use common\modules\product\models\ProductVariant; -use common\modules\product\models\RemoteProductsSearch; use Yii; use common\modules\product\models\Product; use common\modules\product\models\ProductSearch; @@ -16,8 +15,6 @@ use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; use common\modules\product\models\Brand; -use common\modules\product\models\BrandName; -use common\modules\product\models\RemoteProducts; use yii\web\UploadedFile; /** diff --git a/common/modules/product/helpers/FilterHelper.php b/common/modules/product/helpers/FilterHelper.php index e460691..9f4a573 100755 --- a/common/modules/product/helpers/FilterHelper.php +++ b/common/modules/product/helpers/FilterHelper.php @@ -2,9 +2,7 @@ namespace common\modules\product\helpers; -use common\modules\product\models\Product; -use common\modules\product\models\BrandName; -use common\modules\product\models\CategoryName; + use common\modules\rubrication\models\TaxGroup; use yii\base\Object; use Yii; diff --git a/common/modules/product/helpers/ProductHelper.php b/common/modules/product/helpers/ProductHelper.php index 992fabd..dfaecc7 100755 --- a/common/modules/product/helpers/ProductHelper.php +++ b/common/modules/product/helpers/ProductHelper.php @@ -6,8 +6,6 @@ use common\modules\product\models\Category; use common\modules\product\models\Product; use common\modules\product\models\ProductVariant; - use common\modules\product\models\BrandName; - use common\modules\product\models\CategoryName; use yii\base\Object; use Yii; use yii\db\ActiveQuery; @@ -202,12 +200,12 @@ ]); $query->orFilterWhere([ 'ilike', - BrandName::tableName() . '.value', + Brand::tableName() . '.name', $keyword, ]); $query->orFilterWhere([ 'ilike', - CategoryName::tableName() . '.value', + Category::tableName() . '.name', $keyword, ]); $query->orFilterWhere([ diff --git a/common/modules/product/models/Brand.php b/common/modules/product/models/Brand.php index 6836e94..07c61e2 100755 --- a/common/modules/product/models/Brand.php +++ b/common/modules/product/models/Brand.php @@ -19,6 +19,7 @@ use Yii; * @property string $meta_desc * @property string $meta_robots * @property string $seo_text + * @property string $name * * @property BrandName $brandName * @property BrandName[] $brandNames @@ -30,26 +31,6 @@ class Brand extends \yii\db\ActiveRecord public $_items_count = 0; - public function behaviors() - { - return [ - 'artboxsynonym' => [ - 'class' => ArtboxSynonymBehavior::className(), - 'keyNameValue' => 'brand_name_id', - 'valueModel' => BrandName::className(), - 'valueOptionId' => 'brand_id', - 'valueFields' => [ // postKey => DBFieldName - 'name' => 'value' - ], - 'slug' => [ - 'valueKeyName' => 'value', - 'slugKeyName' => 'alias', - 'translit' => true - ], - ], - ]; - } - /** * @inheritdoc */ @@ -94,21 +75,7 @@ class Brand extends \yii\db\ActiveRecord ]; } - /** - * @return \yii\db\ActiveQuery - */ - public function getBrandName() - { - return $this->hasOne(BrandName::className(), ['brand_name_id' => 'brand_name_id']); - } - /** - * @return \yii\db\ActiveQuery - */ - public function getBrandNames() - { - return $this->hasMany(BrandName::className(), ['brand_id' => 'brand_id']); - } /** * @return \yii\db\ActiveQuery @@ -118,10 +85,6 @@ class Brand extends \yii\db\ActiveRecord return $this->hasMany(Product::className(), ['brand_id' => 'brand_id']); } - public function getName() { - return empty($this->brand_name_id) ? null : $this->brandName->value; - } - public function getImageFile() { return empty($this->image) ? null : Yii::getAlias('@imagesDir/brands/'. $this->image); } diff --git a/common/modules/product/models/BrandName.php b/common/modules/product/models/BrandName.php deleted file mode 100755 index a495c95..0000000 --- a/common/modules/product/models/BrandName.php +++ /dev/null @@ -1,66 +0,0 @@ - 250], -// [['brand_id'], 'exist', 'skipOnError' => true, 'targetClass' => Brand::className(), 'targetAttribute' => ['brand_id' => 'brand_id']], - ]; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'brand_name_id' => Yii::t('product', 'Brand Name ID'), - 'brand_id' => Yii::t('product', 'Brand ID'), - 'value' => Yii::t('product', 'Value'), - ]; - } - - /** - * @return \yii\db\ActiveQuery - */ - public function getBrands() - { - return $this->hasMany(Brand::className(), ['brand_name_id' => 'brand_name_id']); - } - - /** - * @return \yii\db\ActiveQuery - */ - public function getBrand() - { - return $this->hasOne(Brand::className(), ['brand_id' => 'brand_id']); - } -} diff --git a/common/modules/product/models/BrandSearch.php b/common/modules/product/models/BrandSearch.php index f77d91f..2d1a204 100755 --- a/common/modules/product/models/BrandSearch.php +++ b/common/modules/product/models/BrandSearch.php @@ -81,8 +81,7 @@ class BrandSearch extends Brand ->andFilterWhere(['ilike', 'meta_robots', $this->meta_robots]) ->andFilterWhere(['ilike', 'seo_text', $this->seo_text]); if (!empty($this->brand_name)) { - $query->joinWith('brandName'); - $query->andFilterWhere(['ilike', 'brand_name.value', $this->brand_name]); + $query->andFilterWhere(['ilike', 'name', $this->brand_name]); } $query->orderBy('brand_id', 'asc'); @@ -110,8 +109,7 @@ class BrandSearch extends Brand Brand::tableName() .'.*' ]) ->innerJoin(Product::tableName(), Product::tableName() .'.brand_id='. Brand::tableName() .'.brand_id') - ->innerJoin(ProductCategory::tableName(), ProductCategory::tableName() .'.product_id='. Product::tableName() .'.product_id') - ->with(['brandName']); + ->innerJoin(ProductCategory::tableName(), ProductCategory::tableName() .'.product_id='. Product::tableName() .'.product_id'); // $queryCount = Product::find() @@ -157,7 +155,6 @@ class BrandSearch extends Brand public static function findByAlias($alias) { /** @var CategoryQuery $query */ $query = Brand::find() - ->with('brandName') ->andFilterWhere(['alias' => $alias]); if (($model = $query->one()) !== null) { return $model; diff --git a/common/modules/product/models/Category.php b/common/modules/product/models/Category.php index ae5b228..0b94a82 100755 --- a/common/modules/product/models/Category.php +++ b/common/modules/product/models/Category.php @@ -2,13 +2,13 @@ namespace common\modules\product\models; -use common\behaviors\RuSlug; + use common\components\artboxtree\ArtboxTreeBehavior; use common\components\artboxtree\ArtboxTreeHelper; -use common\modules\rubrication\behaviors\ArtboxSynonymBehavior; + use common\modules\rubrication\models\TaxGroup; use Yii; -use yii\base\ErrorException; + use yii\db\Query; /** @@ -28,6 +28,7 @@ use yii\db\Query; * @property integer $product_unit_id * @property string $alias * @property boolean $populary + * @property boolean $name * * @property CategoryName $categoryName * @property Product[] $products @@ -46,21 +47,7 @@ class Category extends \yii\db\ActiveRecord 'class' => ArtboxTreeBehavior::className(), 'keyNameGroup' => null, 'keyNamePath' => 'path', - ], - 'artboxsynonym' => [ - 'class' => ArtboxSynonymBehavior::className(), - 'keyNameValue' => 'category_name_id', - 'valueModel' => CategoryName::className(), - 'valueOptionId' => 'category_id', - 'valueFields' => [ // postKey => DBFieldName - 'name' => 'value' - ], - 'slug' => [ - 'valueKeyName' => 'value', - 'slugKeyName' => 'alias', - 'translit' => true - ] - ], + ] ]; } @@ -87,7 +74,6 @@ class Category extends \yii\db\ActiveRecord [['alias', 'name'], 'string', 'max' => 250], [['populary'], 'boolean'], [['group_to_category', 'remote_category'], 'safe'], - [['category_name_id'], 'exist', 'skipOnError' => true, 'targetClass' => CategoryName::className(), 'targetAttribute' => ['category_name_id' => 'category_name_id']], [['imageUpload'], 'safe'], [['imageUpload'], 'file', 'extensions' => 'jpg, gif, png'], ]; @@ -137,13 +123,6 @@ class Category extends \yii\db\ActiveRecord // return $this->getRelations('product_categories'); } - /** - * @return \yii\db\ActiveQuery - */ - public function getCategoryNames() - { - return $this->hasMany(CategoryName::className(), ['category_id' => 'category_id']); - } /** * @return \yii\db\ActiveQuery @@ -153,10 +132,6 @@ class Category extends \yii\db\ActiveRecord return $this->hasMany(ProductCategory::className(), ['category_id' => 'category_id']); } - public function getTaxGroups() - { - return $this->getRelations('tax_group_to_category'); - } public function getTaxGroupsByLevel($level) { @@ -177,14 +152,8 @@ class Category extends \yii\db\ActiveRecord } } - public function getCategoryName() - { - return $this->hasOne(CategoryName::className(), ['category_name_id' => 'category_name_id']); - } - public function getName() { - return empty($this->categoryName) ? null : $this->categoryName->value; - } + public function getImageFile() { return empty($this->image) ? '/images/no_photo.png' : Yii::getAlias('@imagesDir/categories/'. $this->image); @@ -216,22 +185,13 @@ class Category extends \yii\db\ActiveRecord } } ProductCategory::deleteAll(['category_id' => $this->category_id]); - CategoryName::deleteAll(['category_id' => $this->category_id]); return true; } - public function getActiveFilters() { $query1 = (new Query()) ->distinct() ->select([ - 'option_id', - 'tax_option.*', - 'tax_group.*', - 'tax_option.alias as option_alias', - 'tax_group.alias as group_alias', - 'tax_value_string.value as value', - 'tax_option.sort AS tax_option_sort', - 'tax_group.sort AS tax_group_sort', + 'option_id' ]) ->from('tax_option') ->innerJoin('product_variant_option', 'tax_option.tax_option_id = product_variant_option.option_id') @@ -242,18 +202,11 @@ class Category extends \yii\db\ActiveRecord ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') ->where(['product_category.category_id' => $this->category_id, 'tax_group.is_filter' => TRUE]) ->andWhere(['!=', 'product_variant.stock', 0]); - + $query2 = (new Query()) ->distinct() ->select([ - 'option_id', - 'tax_option.*', - 'tax_group.*', - 'tax_option.alias as option_alias', - 'tax_group.alias as group_alias', - 'tax_value_string.value as value', - 'tax_option.sort AS tax_option_sort', - 'tax_group.sort AS tax_group_sort', + 'option_id' ]) ->from('tax_option') ->innerJoin('product_option', 'tax_option.tax_option_id = product_option.option_id') @@ -265,9 +218,20 @@ class Category extends \yii\db\ActiveRecord ->where(['product_category.category_id' => $this->category_id, 'tax_group.is_filter' => TRUE]) ->andWhere(['!=', 'product_variant.stock', 0]); $query3 = (new Query()) - ->select('*') - ->from(['subquery' => $query1->union($query2)]) - ->orderBy('tax_group_sort, tax_option_sort'); + ->select([ + 'tax_option.*', + 'tax_group.*', + 'tax_option.alias as option_alias', + 'tax_group.alias as group_alias', + 'tax_value_string.value as value', + 'tax_option.sort AS tax_option_sort', + 'tax_group.sort AS tax_group_sort', + ]) + ->from(['tax_option' ]) + ->where(['tax_option.tax_option_id'=>$query1->union($query2)]) + ->innerJoin('tax_group','tax_group.tax_group_id = tax_option.tax_group_id') + ->innerJoin('tax_value_string', 'tax_value_string.tax_option_id = tax_option.tax_option_id') + ->orderBy('tax_option.sort, tax_group.sort'); return $query3; } diff --git a/common/modules/product/models/CategoryName.php b/common/modules/product/models/CategoryName.php deleted file mode 100755 index e55331e..0000000 --- a/common/modules/product/models/CategoryName.php +++ /dev/null @@ -1,66 +0,0 @@ - 250], - [['category_id'], 'exist', 'skipOnError' => true, 'targetClass' => Category::className(), 'targetAttribute' => ['category_id' => 'category_id']], - ]; - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return [ - 'category_name_id' => Yii::t('product', 'Category Name ID'), - 'category_id' => Yii::t('product', 'Category ID'), - 'value' => Yii::t('product', 'Value'), - ]; - } - - /** - * @return \yii\db\ActiveQuery - */ - public function getCategories() - { - return $this->hasMany(Category::className(), ['category_name_id' => 'category_name_id']); - } - - /** - * @return \yii\db\ActiveQuery - */ - public function getCategory() - { - return $this->hasOne(Category::className(), ['category_id' => 'category_id']); - } -} diff --git a/common/modules/product/models/CategoryQuery.php b/common/modules/product/models/CategoryQuery.php index 7a941c3..b7abeaa 100755 --- a/common/modules/product/models/CategoryQuery.php +++ b/common/modules/product/models/CategoryQuery.php @@ -23,7 +23,6 @@ class CategoryQuery extends \yii\db\ActiveQuery */ public function all($db = null) { - $this->with('categoryName'); return parent::all($db); } diff --git a/common/modules/product/models/CategorySearch.php b/common/modules/product/models/CategorySearch.php index 9e29a9a..e2ccfd1 100755 --- a/common/modules/product/models/CategorySearch.php +++ b/common/modules/product/models/CategorySearch.php @@ -56,7 +56,7 @@ class CategorySearch extends Category */ public function search($params) { - $query = Category::find()->with('categoryName'); + $query = Category::find(); // add conditions that should always apply here @@ -90,7 +90,6 @@ class CategorySearch extends Category public static function findByAlias($alias) { /** @var CategoryQuery $query */ $query = Category::find() - ->with('categoryName') ->andFilterWhere(['alias' => $alias]); if (($model = $query->one()) !== null) { return $model; @@ -102,7 +101,6 @@ class CategorySearch extends Category public static function findByRemoteID($id) { /** @var CategoryQuery $query */ $query = Category::find() - ->with('categoryName') ->andFilterWhere(['@>', 'remote_id', ArtboxTreeHelper::setArrayField($id)]); if (($model = $query->one()) !== null) { return $model; diff --git a/common/modules/product/models/Product.php b/common/modules/product/models/Product.php index 62f2003..aac4be2 100755 --- a/common/modules/product/models/Product.php +++ b/common/modules/product/models/Product.php @@ -218,7 +218,7 @@ class Product extends \yii\db\ActiveRecord // return $this->getRelations('product_categories'); } public function getCategoriesWithName() { - return $this->hasMany(Category::className(), ['category_id' => 'category_id'])->viaTable('product_category', ['product_id' => 'product_id'])->joinWith('categoryNames'); + return $this->hasMany(Category::className(), ['category_id' => 'category_id'])->viaTable('product_category', ['product_id' => 'product_id']); // return $this->getRelations('product_categories'); } diff --git a/common/modules/product/models/ProductSearch.php b/common/modules/product/models/ProductSearch.php index 314d941..9781ea7 100755 --- a/common/modules/product/models/ProductSearch.php +++ b/common/modules/product/models/ProductSearch.php @@ -51,7 +51,7 @@ class ProductSearch extends Product { $query = Product::find(); - $query->joinWith(['brand', 'brand.brandNames', 'categories', 'categories.categoryNames', 'variant']); + $query->joinWith(['brand', 'categories', 'variant']); $query->groupBy(['product.product_id']); $query->orderBy('product.product_id', 'DESC'); diff --git a/common/modules/product/models/ProductVariantSearch.php b/common/modules/product/models/ProductVariantSearch.php index 4c68e73..3e4bfae 100755 --- a/common/modules/product/models/ProductVariantSearch.php +++ b/common/modules/product/models/ProductVariantSearch.php @@ -87,7 +87,7 @@ class ProductVariantSearch extends ProductVariant ] ]); - $query->joinWith(['product', 'product.brand.brandNames', 'product.categories', 'product.categories.categoryNames']); + $query->joinWith(['product', 'product.brand', 'product.categories']); if (isset($this->is_top)) { $query->andFilterWhere([ diff --git a/common/modules/product/widgets/brandsCarouselWidget.php b/common/modules/product/widgets/brandsCarouselWidget.php index d907530..1263a09 100755 --- a/common/modules/product/widgets/brandsCarouselWidget.php +++ b/common/modules/product/widgets/brandsCarouselWidget.php @@ -13,7 +13,7 @@ class brandsCarouselWidget extends Widget { } public function run() { - $brands = Brand::find()->with('brandName')->all(); + $brands = Brand::find()->all(); return $this->render('brandsCarousel', [ 'brands' => $brands, ]); diff --git a/common/modules/product/widgets/views/submenu.php b/common/modules/product/widgets/views/submenu.php index 1a5a82f..5a5140e 100755 --- a/common/modules/product/widgets/views/submenu.php +++ b/common/modules/product/widgets/views/submenu.php @@ -1,5 +1,5 @@ @@ -24,7 +24,7 @@
  • - categoryName->value?> + name?>
    @@ -37,7 +37,7 @@ imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item['item']->imageUrl, 'mainmenu') : ''?>
    -
    categoryName->value?>
    +
    name?>
    diff --git a/common/modules/rubrication/views/tax-group/_form.php b/common/modules/rubrication/views/tax-group/_form.php index d2b44e7..d457164 100755 --- a/common/modules/rubrication/views/tax-group/_form.php +++ b/common/modules/rubrication/views/tax-group/_form.php @@ -26,7 +26,7 @@ use common\components\artboxtree\ArtboxTreeHelper; ]) ?> field($model, 'group_to_category')->dropDownList( - ArtboxTreeHelper::treeMap(ProductHelper::getCategories(), 'category_id', 'categoryName.value'), + ArtboxTreeHelper::treeMap(ProductHelper::getCategories(), 'category_id', 'name'), [ 'multiple' => true ] diff --git a/console/controllers/ImportController.php b/console/controllers/ImportController.php index 776c8b9..b6a7c79 100755 --- a/console/controllers/ImportController.php +++ b/console/controllers/ImportController.php @@ -3,7 +3,6 @@ namespace console\controllers; use common\modules\product\models\Category; -use common\modules\product\models\CategoryName; use common\modules\product\models\Import; use common\modules\product\models\ProductImage; use common\modules\product\models\ProductVariantType; @@ -12,10 +11,8 @@ use common\modules\rubrication\models\TaxOption; use common\modules\rubrication\models\TaxValueString; use Yii; use common\modules\product\models\Brand; -use common\modules\product\models\BrandName; use common\modules\product\models\Product; use common\modules\product\models\ProductVariant; -use common\modules\product\models\RemoteProducts; use yii\console\Controller; use yii\helpers\Console; diff --git a/frontend/controllers/CatalogController.php b/frontend/controllers/CatalogController.php index aba9524..f80b514 100755 --- a/frontend/controllers/CatalogController.php +++ b/frontend/controllers/CatalogController.php @@ -166,7 +166,7 @@ class CatalogController extends \yii\web\Controller public function actionBrands() { $dataProvider = new ActiveDataProvider([ - 'query' => Brand::find()->joinWith('brandName')->orderBy('brand_name.value'), + 'query' => Brand::find()->orderBy('name'), 'pagination' => [ 'pageSize' => -1, ] diff --git a/frontend/models/ProductFrontendSearch.php b/frontend/models/ProductFrontendSearch.php index d4fe401..5bc4cd1 100755 --- a/frontend/models/ProductFrontendSearch.php +++ b/frontend/models/ProductFrontendSearch.php @@ -91,7 +91,7 @@ class ProductFrontendSearch extends Product { $query = Product::find(); } $query->select(['product.*']); - $query->joinWith(['enabledVariants','brand', 'brand.brandName', 'category', 'category.categoryName']); + $query->joinWith(['enabledVariants','brand', 'category']); $query->groupBy(['product.product_id', 'product_variant.price']); diff --git a/frontend/views/catalog/_product_item.php b/frontend/views/catalog/_product_item.php index ad65b69..f0fa443 100755 --- a/frontend/views/catalog/_product_item.php +++ b/frontend/views/catalog/_product_item.php @@ -19,8 +19,8 @@ use yii\helpers\Url; 'product' => $model->alias ]) ?>"> enabledVariants[ 0 ]->imageUrl, 'list', [ - 'alt' => $model->category->categoryName->value . ' ' . $model->fullname, - 'title' => $model->category->categoryName->value . ' ' . $model->fullname, + 'alt' => $model->category->name . ' ' . $model->fullname, + 'title' => $model->category->name . ' ' . $model->fullname, 'class' => 'selected' ]) ?> -- libgit2 0.21.4