Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form:

Mage_Adminhtml_Block_Sales_Order_Create_Abstract Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getAddress ()
 getShippingRates ()
 getCarrierName ($carrierCode)
 getShippingMethod ()
 isMethodActive ($code)
 getActiveMethodRate ()
 getIsRateRequest ()
 getShippingPrice ($price, $flag)

Protected Attributes

 $_rates


Detailed Description

Definition at line 34 of file Form.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 38 of file Form.php.

00039     {
00040         parent::__construct();
00041         $this->setId('sales_order_create_shipping_method_form');
00042     }


Member Function Documentation

getActiveMethodRate (  ) 

Retrieve rate of active shipping method

Returns:
Mage_Sales_Model_Quote_Address_Rate || false

Definition at line 119 of file Form.php.

00120     {
00121         $rates = $this->getShippingRates();
00122         if (is_array($rates)) {
00123             foreach ($rates as $group) {
00124                 foreach ($group as $code => $rate) {
00125                     if ($rate->getCode() == $this->getShippingMethod()) {
00126                         return $rate;
00127                     }
00128                 }
00129             }
00130         }
00131         return false;
00132     }

getAddress (  ) 

Retrieve quote shipping address model

Returns:
Mage_Sales_Model_Quote_Address

Definition at line 49 of file Form.php.

00050     {
00051         return $this->getQuote()->getShippingAddress();
00052     }

getCarrierName ( carrierCode  ) 

Rertrieve carrier name from store configuration

Parameters:
string $carrierCode
Returns:
string

Definition at line 85 of file Form.php.

00086     {
00087         if ($name = Mage::getStoreConfig('carriers/'.$carrierCode.'/title', $this->getStore()->getId())) {
00088             return $name;
00089         }
00090         return $carrierCode;
00091     }

getIsRateRequest (  ) 

Definition at line 134 of file Form.php.

00135     {
00136         return $this->getRequest()->getParam('collect_shipping_rates');
00137     }

getShippingMethod (  ) 

Retrieve current selected shipping method

Returns:
string

Definition at line 98 of file Form.php.

00099     {
00100         return $this->getAddress()->getShippingMethod();
00101     }

getShippingPrice ( price,
flag 
)

Definition at line 139 of file Form.php.

00140     {
00141         return $this->getQuote()->getStore()->convertPrice(Mage::helper('tax')->getShippingPrice($price, $flag, $this->getAddress()), true);
00142     }

getShippingRates (  ) 

Retrieve array of shipping rates groups

Returns:
array

Definition at line 59 of file Form.php.

00060     {
00061         if (empty($this->_rates)) {
00062             $groups = $this->getAddress()->getGroupedAllShippingRates();
00063             /*
00064             if (!empty($groups)) {
00065 
00066                 $ratesFilter = new Varien_Filter_Object_Grid();
00067                 $ratesFilter->addFilter($this->getStore()->getPriceFilter(), 'price');
00068 
00069                 foreach ($groups as $code => $groupItems) {
00070                     $groups[$code] = $ratesFilter->filter($groupItems);
00071                 }
00072             }
00073             */
00074             return $this->_rates = $groups;
00075         }
00076         return $this->_rates;
00077     }

isMethodActive ( code  ) 

Check activity of method by code

Parameters:
string $code
Returns:
bool

Definition at line 109 of file Form.php.

00110     {
00111         return $code===$this->getShippingMethod();
00112     }


Member Data Documentation

$_rates [protected]

Definition at line 36 of file Form.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:59 2009 for Magento by  doxygen 1.5.8