Commit 4775a528ccc306a7ad237d2ffe9a54db5c1aeb67
1 parent
367a13ab
site map
Showing
2 changed files
with
8 additions
and
3 deletions
Show diff stats
models/Product.php
| @@ -594,7 +594,9 @@ | @@ -594,7 +594,9 @@ | ||
| 594 | public function afterSave($insert, $changedAttributes) | 594 | public function afterSave($insert, $changedAttributes) |
| 595 | { | 595 | { |
| 596 | parent::afterSave($insert, $changedAttributes); | 596 | parent::afterSave($insert, $changedAttributes); |
| 597 | - | 597 | + |
| 598 | + Catalog::addRecord($this); | ||
| 599 | + | ||
| 598 | if (!empty( $this->categories )) { | 600 | if (!empty( $this->categories )) { |
| 599 | $categories = Category::findAll($this->categories); | 601 | $categories = Category::findAll($this->categories); |
| 600 | $this->unlinkAll('categories', true); | 602 | $this->unlinkAll('categories', true); |
| @@ -669,7 +671,7 @@ | @@ -669,7 +671,7 @@ | ||
| 669 | public function beforeSave($insert) | 671 | public function beforeSave($insert) |
| 670 | { | 672 | { |
| 671 | if (parent::beforeSave($insert)) { | 673 | if (parent::beforeSave($insert)) { |
| 672 | - Catalog::addRecord($this); | 674 | + |
| 673 | return true; | 675 | return true; |
| 674 | } else { | 676 | } else { |
| 675 | return false; | 677 | return false; |
models/ProductVariant.php
| @@ -445,6 +445,9 @@ | @@ -445,6 +445,9 @@ | ||
| 445 | public function afterSave($insert, $changedAttributes) | 445 | public function afterSave($insert, $changedAttributes) |
| 446 | { | 446 | { |
| 447 | parent::afterSave($insert, $changedAttributes); | 447 | parent::afterSave($insert, $changedAttributes); |
| 448 | + | ||
| 449 | + Catalog::addRecord($this->product); | ||
| 450 | + | ||
| 448 | if (!empty($this->options)) { | 451 | if (!empty($this->options)) { |
| 449 | $options = TaxOption::findAll($this->options); | 452 | $options = TaxOption::findAll($this->options); |
| 450 | $this->unlinkAll('options', true); | 453 | $this->unlinkAll('options', true); |
| @@ -497,7 +500,7 @@ | @@ -497,7 +500,7 @@ | ||
| 497 | public function beforeSave($insert) | 500 | public function beforeSave($insert) |
| 498 | { | 501 | { |
| 499 | if (parent::beforeSave($insert)) { | 502 | if (parent::beforeSave($insert)) { |
| 500 | - Catalog::addRecord($this->product); | 503 | + |
| 501 | return true; | 504 | return true; |
| 502 | } else { | 505 | } else { |
| 503 | return false; | 506 | return false; |