diff --git a/common/modules/product/models/Product.php b/common/modules/product/models/Product.php index af1bed9..02a78ba 100755 --- a/common/modules/product/models/Product.php +++ b/common/modules/product/models/Product.php @@ -37,6 +37,8 @@ * @property TaxOption[] $options * @property ProductVariant[] $variants * @property string $alias + * @property string $size + * @property string $material */ class Product extends \yii\db\ActiveRecord { @@ -92,7 +94,11 @@ 'max' => 150, ], [ - [ 'alias' ], + [ + 'alias', + 'size', + 'material', + ], 'string', 'max' => 250, ], @@ -138,12 +144,15 @@ // relation behavior field 'image' => Yii::t('product', 'Image'), 'images' => Yii::t('product', 'Images'), - 'description' => Yii::t('product', 'Description'), + 'description' => 'Описание', 'video' => Yii::t('product', 'Video embeded'), 'variants' => Yii::t('product', 'Variants'), 'is_top' => Yii::t('product', 'Is top'), 'is_new' => Yii::t('product', 'Is new'), 'akciya' => Yii::t('product', 'Is promo'), + 'imagesUpload'=> 'Картинки', + 'size' => 'Размер', + 'material' => 'Состав', ]; } diff --git a/common/modules/product/views/manage/_form.php b/common/modules/product/views/manage/_form.php index 5f581ba..30e8911 100755 --- a/common/modules/product/views/manage/_form.php +++ b/common/modules/product/views/manage/_form.php @@ -25,7 +25,11 @@ = $form->field($model, 'name')->textInput(['maxlength' => true]) ?> = $form->field($model, 'akciya')->checkbox(['label' => 'Акционный']) ?> - + + = $form->field($model, 'size')->textInput() ?> + + = $form->field($model, 'material')->textInput() ?> + = $form->field($model, 'description')->widget(\mihaildev\ckeditor\CKEditor::className(),['editorOptions' => [ 'preset' => 'full', 'inline' => false, ], ]); ?> = $form->field($model, 'categories')->widget(Select2::className(), [ diff --git a/console/migrations/m161007_134913_custom_baccara_fields.php b/console/migrations/m161007_134913_custom_baccara_fields.php new file mode 100644 index 0000000..8cd1bc4 --- /dev/null +++ b/console/migrations/m161007_134913_custom_baccara_fields.php @@ -0,0 +1,18 @@ +addColumn('product', 'size', $this->string(255)); + $this->addColumn('product', 'material', $this->string(255)); + } + + public function down() + { + $this->dropColumn('product', 'material'); + $this->dropColumn('product', 'size'); + } +} diff --git a/frontend/views/catalog/view.php b/frontend/views/catalog/view.php index 6b8fa6a..0e26825 100755 --- a/frontend/views/catalog/view.php +++ b/frontend/views/catalog/view.php @@ -58,8 +58,8 @@ $this->params['breadcrumbs'][] = $this->title;