diff --git a/common/modules/product/views/manage/_form.php b/common/modules/product/views/manage/_form.php index 30e8911..0e30557 100755 --- a/common/modules/product/views/manage/_form.php +++ b/common/modules/product/views/manage/_form.php @@ -26,10 +26,6 @@ field($model, 'akciya')->checkbox(['label' => 'Акционный']) ?> - field($model, 'size')->textInput() ?> - - field($model, 'material')->textInput() ?> - field($model, 'description')->widget(\mihaildev\ckeditor\CKEditor::className(),['editorOptions' => [ 'preset' => 'full', 'inline' => false, ], ]); ?> field($model, 'categories')->widget(Select2::className(), [ diff --git a/common/modules/rubrication/models/TaxGroup.php b/common/modules/rubrication/models/TaxGroup.php index e8a4928..e7b678e 100755 --- a/common/modules/rubrication/models/TaxGroup.php +++ b/common/modules/rubrication/models/TaxGroup.php @@ -111,7 +111,7 @@ 'is_filter' => 'Use in filter', 'sort' => 'Sort', 'display' => 'Display', - 'is_menu' => 'Отображать в меню', + 'is_menu' => 'Отображать в карточке товара', ]; } diff --git a/frontend/controllers/CatalogController.php b/frontend/controllers/CatalogController.php index e515898..6da039e 100755 --- a/frontend/controllers/CatalogController.php +++ b/frontend/controllers/CatalogController.php @@ -185,24 +185,33 @@ class CatalogController extends \yii\web\Controller */ public function actionProduct($product, $variant) { - - + + $product = Product::find() ->joinWith([ 'variants' => function($query) { $query->indexBy('sku'); - } + }, + 'options.group' ], true, 'INNER JOIN') ->where([ 'product.alias' => $product, 'product_variant.sku' => $variant, ])->with('category.parent')->one(); + + $attributes = []; + foreach($product->options as $option) { + if(!$option->group->is_menu) continue; + $attributes[$option->group->name][] = $option->value; + } + $variant = $product->variants[$variant]; $variants = $product->variants; return $this->render('view', [ 'variants' => $variants, 'product' => $product, 'variant' => $variant, + 'attributes' => $attributes, ]); } diff --git a/frontend/views/catalog/view.php b/frontend/views/catalog/view.php index 0e26825..b33a74c 100755 --- a/frontend/views/catalog/view.php +++ b/frontend/views/catalog/view.php @@ -4,6 +4,7 @@ * @var ProductVariant $variant * @var View $this * @var ProductVariant[] $variants + * @var array $attributes */ use common\components\artboximage\ArtboxImageHelper; use common\modules\product\models\Product; @@ -58,8 +59,9 @@ $this->params['breadcrumbs'][] = $this->title;
-- libgit2 0.21.4