Commit 69004b5dd5da3e8575cce98ca472f65289c0f5da

Authored by Alexey Boroda
2 parents 9580e548 04e8796d

Merge remote-tracking branch 'origin/master'

@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 } 33 }
34 parent::__construct($config); 34 parent::__construct($config);
35 } 35 }
36 - 36 +
37 /** 37 /**
38 * Increment product variant with $product_variant_id count by 1 38 * Increment product variant with $product_variant_id count by 1
39 * 39 *
@@ -56,8 +56,8 @@ @@ -56,8 +56,8 @@
56 ]; 56 ];
57 } 57 }
58 } 58 }
59 - if($data[$product_variant_id]['count'] <= 0) {  
60 - unset($data[$product_variant_id]); 59 + if ($data[ $product_variant_id ][ 'count' ] <= 0) {
  60 + unset( $data[ $product_variant_id ] );
61 } 61 }
62 $this->setData($data); 62 $this->setData($data);
63 } 63 }
@@ -155,7 +155,7 @@ @@ -155,7 +155,7 @@
155 $models = $this->findModels(array_keys($data)); 155 $models = $this->findModels(array_keys($data));
156 $sum = 0; 156 $sum = 0;
157 foreach ($models as $model) { 157 foreach ($models as $model) {
158 - $sum += $model->price * $data[$model->id]['count']; 158 + $sum += $model->price * $data[ $model->id ][ 'count' ];
159 } 159 }
160 return $sum; 160 return $sum;
161 } 161 }
@@ -175,6 +175,13 @@ @@ -175,6 +175,13 @@
175 */ 175 */
176 $model = ProductVariant::find() 176 $model = ProductVariant::find()
177 ->where([ 'product_variant.id' => $product_variant_id ]) 177 ->where([ 'product_variant.id' => $product_variant_id ])
  178 + ->andWhere(
  179 + [
  180 + '>',
  181 + 'product_variant.stock',
  182 + 0,
  183 + ]
  184 + )
178 ->joinWith('lang') 185 ->joinWith('lang')
179 ->one(); 186 ->one();
180 if (empty( $model )) { 187 if (empty( $model )) {
models/Product.php
@@ -364,6 +364,11 @@ @@ -364,6 +364,11 @@
364 } 364 }
365 } 365 }
366 366
  367 + public function getTaxOption()
  368 + {
  369 +// return $this->getOptions()->innerJoinWith('taxGroup')->where([''])
  370 + }
  371 +
367 /** 372 /**
368 * Get Product name concatenated with Brand name 373 * Get Product name concatenated with Brand name
369 * 374 *
models/ProductLang.php
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 * @property integer $product_id 11 * @property integer $product_id
12 * @property integer $language_id 12 * @property integer $language_id
13 * @property string $title 13 * @property string $title
  14 + * @property string $meta_title
14 * @property string $description 15 * @property string $description
15 * @property string $alias 16 * @property string $alias
16 * @property Language $language 17 * @property Language $language
@@ -61,6 +62,7 @@ @@ -61,6 +62,7 @@
61 [ 62 [
62 [ 63 [
63 'title', 64 'title',
  65 + 'meta_title',
64 'alias', 66 'alias',
65 ], 67 ],
66 'string', 68 'string',
@@ -106,6 +108,7 @@ @@ -106,6 +108,7 @@
106 'title' => Yii::t('app', 'Name'), 108 'title' => Yii::t('app', 'Name'),
107 'description' => Yii::t('app', 'Description'), 109 'description' => Yii::t('app', 'Description'),
108 'alias' => Yii::t('app', 'Alias'), 110 'alias' => Yii::t('app', 'Alias'),
  111 + 'meta_title' => Yii::t('app', 'Meta Title'),
109 ]; 112 ];
110 } 113 }
111 114
views/manage/_form_language.php
@@ -25,4 +25,5 @@ @@ -25,4 +25,5 @@
25 'filebrowserUploadUrl' => Yii::$app->getUrlManager() 25 'filebrowserUploadUrl' => Yii::$app->getUrlManager()
26 ->createUrl('file/uploader/images-upload'), 26 ->createUrl('file/uploader/images-upload'),
27 ]), 27 ]),
28 - ]) ?>  
29 \ No newline at end of file 28 \ No newline at end of file
  29 + ]) ?>
  30 +<?= $form->field($model_lang, '[' . $language->id . ']meta_title') ?>