Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Some_Module_Model_Observer{
- protected $isNew = false;
- public function beforeSave($observer) {
- $product = $observer->getEvent()->getProduct();
- if($product->isObjectNew()){
- $this->isNew = true;
- }
- }
- public function afterSave($observer) {
- $product = $observer->getEvent()->getProduct();
- if($this->isNew){
- /*Add Logic Here*/
- }
- }
- }
Add Comment
Please, Sign In to add comment