Example #1
0
 /**
  * format discount for a rule
  * 
  * @param Varien_Object $rule
  * @return string
  */
 public function formatDiscount($rule)
 {
     $store = Mage::app()->getStore(Mage::helper('rewardpoints/customer')->getStoreId());
     if ($rule->getId() == 'rate') {
         $price = $store->convertPrice($rule->getBaseRate());
     } else {
         if ($rule->getDiscountStyle() == 'cart_fixed') {
             $price = $store->convertPrice($rule->getDiscountAmount());
         } else {
             return round($rule->getDiscountAmount(), 2) . '%';
         }
     }
     return $store->formatPrice($price);
 }