コード例 #1
0
 /**
  * get a magento shipping method identifer for either:
  * - the shipping method used by $address
  * - the first of all valid shipping methods
  *
  * @param Mage_Customer_Model_Address_Abstract
  * @return string
  */
 public function getUsableMethod(Mage_Customer_Model_Address_Abstract $address)
 {
     $this->fetchAvailableShippingMethods();
     return $address->getShippingMethod() ?: $this->getFirstAvailable();
 }