Commit 4fb5e6c31e0217437d84333c14c03cd2c16a9134
1 parent
ee6de78b
Import browser beta v0.1
Showing
2 changed files
with
12 additions
and
13 deletions
Show diff stats
common/modules/product/models/Import.php
... | ... | @@ -533,7 +533,6 @@ |
533 | 533 | /** |
534 | 534 | * @var Product $_product |
535 | 535 | */ |
536 | - | |
537 | 536 | if(!empty( $parsed_name[ 'remote_id' ] ) && ( $_product = Product::find() |
538 | 537 | ->joinWith('lang') |
539 | 538 | ->andFilterWhere([ 'remote_id' => $parsed_name[ 'remote_id' ] ]) |
... | ... | @@ -575,6 +574,9 @@ |
575 | 574 | } else { |
576 | 575 | $product_name_inserted = $_product->model_langs[ Language::$current->language_id ]->name; |
577 | 576 | } |
577 | + | |
578 | + $_product->validate(); | |
579 | + die(var_dump($_product->getErrors())); | |
578 | 580 | |
579 | 581 | var_dump($_product->save()); die(); |
580 | 582 | if(!$_product->transactionStatus) { | ... | ... |
common/modules/product/models/Product.php
... | ... | @@ -157,6 +157,15 @@ |
157 | 157 | return $this->hasOne(Brand::className(), [ 'brand_id' => 'brand_id' ]); |
158 | 158 | } |
159 | 159 | |
160 | + | |
161 | + | |
162 | + public function beforeValidate() | |
163 | + { | |
164 | + if(parent::beforeValidate()){ | |
165 | + die('here'); | |
166 | + } | |
167 | + } | |
168 | + | |
160 | 169 | /** |
161 | 170 | * @return \yii\db\ActiveQuery |
162 | 171 | */ |
... | ... | @@ -345,18 +354,6 @@ |
345 | 354 | ->sum('quantity'); |
346 | 355 | } |
347 | 356 | |
348 | - public function beforeSave($insert) | |
349 | - { | |
350 | - | |
351 | - if (parent::beforeSave($insert)) { | |
352 | - var_dump('THERE'); die(); | |
353 | - return true; | |
354 | - } else { | |
355 | - var_dump('THERE parent false'); die(); | |
356 | - return false; | |
357 | - } | |
358 | - } | |
359 | - | |
360 | 357 | public function afterSave($insert, $changedAttributes) |
361 | 358 | { |
362 | 359 | parent::afterSave($insert, $changedAttributes); | ... | ... |