Example #1
0
 public function testBeforeSave()
 {
     $this->assertEmpty($this->_product->getTypeHasOptions());
     $this->assertEmpty($this->_product->getTypeHasRequiredOptions());
     $this->_product->setCanSaveConfigurableAttributes(true);
     $this->_product->setConfigurableAttributesData(array('values' => 'not empty'));
     $this->_model->beforeSave($this->_product);
     $this->assertTrue($this->_product->getTypeHasOptions());
     $this->assertTrue($this->_product->getTypeHasRequiredOptions());
 }
 public function beforeSave($product = null)
 {
     parent::beforeSave($product);
     if ($product->getAwSarpEnabled() && $this->getProduct($product)->getAwSarpSubscriptionPrice() == '') {
         $this->getProduct($product)->setAwSarpSubscriptionPrice($product->getData('price'));
     }
 }