예제 #1
0
 /**
  * Retrieve rule's primary coupon
  *
  * @return Mage_SalesRule_Model_Coupon
  */
 public function getPrimaryCoupon()
 {
     if ($this->_primaryCoupon === null) {
         $this->_primaryCoupon = Mage::getModel('salesrule/coupon');
         $this->_primaryCoupon->loadPrimaryByRule($this->getId());
         $this->_primaryCoupon->setRule($this)->setIsPrimary(true);
     }
     return $this->_primaryCoupon;
 }