From 69bea8693ac65646add97529ad9e484cef04d974 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 7 Oct 2016 17:09:20 +0300 Subject: [PATCH] -Product fields added --- common/modules/product/models/Product.php | 13 +++++++++++-- common/modules/product/views/manage/_form.php | 6 +++++- console/migrations/m161007_134913_custom_baccara_fields.php | 18 ++++++++++++++++++ frontend/views/catalog/view.php | 4 ++-- frontend/views/product/view.php | 4 ++-- 5 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 console/migrations/m161007_134913_custom_baccara_fields.php 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 @@ field($model, 'name')->textInput(['maxlength' => true]) ?> 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/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;
diff --git a/frontend/views/product/view.php b/frontend/views/product/view.php index 9048d2a..bb8b795 100755 --- a/frontend/views/product/view.php +++ b/frontend/views/product/view.php @@ -58,8 +58,8 @@ $this->params['breadcrumbs'][] = $this->title;
-- libgit2 0.21.4