Example #1
0
 public function getActiveMethodRate()
 {
     if ($this->getCustomMethodCode() == $this->getOrder()->getShippingMethod()) {
         $rate = new Varien_Object();
         $rate->setCode($this->getCustomMethodCode());
         $rate->setPrice($this->getOrder()->getShippingAmount());
         $rate->setMethodTitle(Mage::helper('iwd_ordermanager')->__("Custom"));
         $rate->setMethodDescription($this->getOrder()->getShippingDescription());
         return $rate;
     }
     if (is_array($this->shipping_rates)) {
         foreach ($this->shipping_rates as $group) {
             foreach ($group as $code => $rate) {
                 if ($rate->getCode() == $this->getOrder()->getShippingMethod()) {
                     return $rate;
                 }
             }
         }
     }
     return false;
 }