Commit 69004b5dd5da3e8575cce98ca472f65289c0f5da
Merge remote-tracking branch 'origin/master'
Showing
4 changed files
with
21 additions
and
5 deletions
Show diff stats
models/Basket.php
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | } |
| 34 | 34 | parent::__construct($config); |
| 35 | 35 | } |
| 36 | - | |
| 36 | + | |
| 37 | 37 | /** |
| 38 | 38 | * Increment product variant with $product_variant_id count by 1 |
| 39 | 39 | * |
| ... | ... | @@ -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 | 62 | $this->setData($data); |
| 63 | 63 | } |
| ... | ... | @@ -155,7 +155,7 @@ |
| 155 | 155 | $models = $this->findModels(array_keys($data)); |
| 156 | 156 | $sum = 0; |
| 157 | 157 | foreach ($models as $model) { |
| 158 | - $sum += $model->price * $data[$model->id]['count']; | |
| 158 | + $sum += $model->price * $data[ $model->id ][ 'count' ]; | |
| 159 | 159 | } |
| 160 | 160 | return $sum; |
| 161 | 161 | } |
| ... | ... | @@ -175,6 +175,13 @@ |
| 175 | 175 | */ |
| 176 | 176 | $model = ProductVariant::find() |
| 177 | 177 | ->where([ 'product_variant.id' => $product_variant_id ]) |
| 178 | + ->andWhere( | |
| 179 | + [ | |
| 180 | + '>', | |
| 181 | + 'product_variant.stock', | |
| 182 | + 0, | |
| 183 | + ] | |
| 184 | + ) | |
| 178 | 185 | ->joinWith('lang') |
| 179 | 186 | ->one(); |
| 180 | 187 | if (empty( $model )) { | ... | ... |
models/Product.php
models/ProductLang.php
| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | * @property integer $product_id |
| 12 | 12 | * @property integer $language_id |
| 13 | 13 | * @property string $title |
| 14 | + * @property string $meta_title | |
| 14 | 15 | * @property string $description |
| 15 | 16 | * @property string $alias |
| 16 | 17 | * @property Language $language |
| ... | ... | @@ -61,6 +62,7 @@ |
| 61 | 62 | [ |
| 62 | 63 | [ |
| 63 | 64 | 'title', |
| 65 | + 'meta_title', | |
| 64 | 66 | 'alias', |
| 65 | 67 | ], |
| 66 | 68 | 'string', |
| ... | ... | @@ -106,6 +108,7 @@ |
| 106 | 108 | 'title' => Yii::t('app', 'Name'), |
| 107 | 109 | 'description' => Yii::t('app', 'Description'), |
| 108 | 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