当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Shipping_Model_Rate_Request::getLimitCarrier方法代码示例

本文整理汇总了PHP中Mage_Shipping_Model_Rate_Request::getLimitCarrier方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Shipping_Model_Rate_Request::getLimitCarrier方法的具体用法?PHP Mage_Shipping_Model_Rate_Request::getLimitCarrier怎么用?PHP Mage_Shipping_Model_Rate_Request::getLimitCarrier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Shipping_Model_Rate_Request的用法示例。


在下文中一共展示了Mage_Shipping_Model_Rate_Request::getLimitCarrier方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: collectRates

 /**
  * Retrieve all methods for supplied shipping data
  *
  * @todo make it ordered
  * @param Mage_Shipping_Model_Shipping_Method_Request $data
  * @return Mage_Shipping_Model_Shipping
  */
 public function collectRates(Mage_Shipping_Model_Rate_Request $request)
 {
     if (!$request->getOrig()) {
         $request->setCountryId(Mage::getStoreConfig('shipping/origin/country_id', $request->getStore()))->setRegionId(Mage::getStoreConfig('shipping/origin/region_id', $request->getStore()))->setCity(Mage::getStoreConfig('shipping/origin/city', $request->getStore()))->setPostcode(Mage::getStoreConfig('shipping/origin/postcode', $request->getStore()));
     }
     $limitCarrier = $request->getLimitCarrier();
     if (!$limitCarrier) {
         $carriers = Mage::getStoreConfig('carriers');
         foreach ($carriers as $carrierCode => $carrierConfig) {
             $this->collectCarrierRates($carrierCode, $request);
         }
     } else {
         if (!is_array($limitCarrier)) {
             $limitCarrier = array($limitCarrier);
         }
         foreach ($limitCarrier as $carrierCode) {
             $carrierConfig = Mage::getStoreConfig('carriers/' . $carrierCode);
             if (!$carrierConfig) {
                 continue;
             }
             $this->collectCarrierRates($carrierCode, $request);
         }
     }
     return $this;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:32,代码来源:Shipping.php

示例2: collectRatesWithAddress

 /**
  * Retrieve all methods for supplied shipping data
  *
  * @todo make it ordered
  * @param Mage_Shipping_Model_Shipping_Method_Request $data
  * @return Mage_Shipping_Model_Shipping
  */
 public function collectRatesWithAddress(Mage_Shipping_Model_Rate_Request $request, $address)
 {
     $storeId = $request->getStoreId();
     if (!$request->getOrig()) {
         $request->setCountryId(Mage::getStoreConfig(Mage_Shipping_Model_Config::XML_PATH_ORIGIN_COUNTRY_ID, $storeId))->setRegionId(Mage::getStoreConfig(Mage_Shipping_Model_Config::XML_PATH_ORIGIN_REGION_ID, $storeId))->setCity(Mage::getStoreConfig(Mage_Shipping_Model_Config::XML_PATH_ORIGIN_CITY, $storeId))->setPostcode(Mage::getStoreConfig(Mage_Shipping_Model_Config::XML_PATH_ORIGIN_POSTCODE, $storeId));
     }
     $limitCarrier = $request->getLimitCarrier();
     if (!$limitCarrier) {
         $carriers = Mage::getStoreConfig('carriers', $storeId);
         foreach ($carriers as $carrierCode => $carrierConfig) {
             $this->collectCarrierRatesWithAddress($carrierCode, $request, $address);
         }
     } else {
         if (!is_array($limitCarrier)) {
             $limitCarrier = array($limitCarrier);
         }
         foreach ($limitCarrier as $carrierCode) {
             $carrierConfig = Mage::getStoreConfig('carriers/' . $carrierCode, $storeId);
             if (!$carrierConfig) {
                 continue;
             }
             $this->collectCarrierRatesWithAddress($carrierCode, $request, $address);
         }
     }
     return $this;
 }
开发者ID:gino2014,项目名称:Quanbit_QBShippingAndPaymentFilters,代码行数:33,代码来源:Shipping.php

示例3: collectRates2

 public function collectRates2(Mage_Shipping_Model_Rate_Request $request)
 {
     $storeId = $request->getStoreId();
     if (!$request->getOrig()) {
         $request->setCountryId(Mage::getStoreConfig(self::XML_PATH_STORE_COUNTRY_ID, $request->getStore()))->setRegionId(Mage::getStoreConfig(self::XML_PATH_STORE_REGION_ID, $request->getStore()))->setCity(Mage::getStoreConfig(self::XML_PATH_STORE_CITY, $request->getStore()))->setPostcode(Mage::getStoreConfig(self::XML_PATH_STORE_ZIP, $request->getStore()));
     }
     $limitCarrier = $request->getLimitCarrier();
     $carriers = Mage::getStoreConfig('carriers', $storeId);
     foreach ($carriers as $carrierCode => $carrierConfig) {
         if (!in_array($carrierCode, $limitCarrier)) {
             $this->collectCarrierRates($carrierCode, $request);
         }
         //echo $carrierCode;
     }
     return $this;
 }
开发者ID:shashankkanungo,项目名称:magento,代码行数:16,代码来源:SM_Dropship_Model_Override_Shipping_Shipping.php


注:本文中的Mage_Shipping_Model_Rate_Request::getLimitCarrier方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。