Guest User

Untitled

a guest
Jan 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. <?php
  2. class Some_Module_Model_Observer{
  3. protected $isNew = false;
  4. public function beforeSave($observer) {
  5. $product = $observer->getEvent()->getProduct();
  6. if($product->isObjectNew()){
  7. $this->isNew = true;
  8. }
  9. }
  10. public function afterSave($observer) {
  11. $product = $observer->getEvent()->getProduct();
  12. if($this->isNew){
  13. /*Add Logic Here*/
  14. }
  15. }
  16.  
  17. }
Add Comment
Please, Sign In to add comment