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


PHP Carrier::getDefaultCarrierSelection方法代码示例

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


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

示例1: run

 public function run()
 {
     $this->init();
     $this->preProcess();
     if (Tools::getValue('ajax') == 'true') {
         if (Tools::getIsset('summary')) {
             $result = array();
             if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 1) {
                 if (self::$cookie->id_customer) {
                     $customer = new Customer((int) self::$cookie->id_customer);
                     $groups = $customer->getGroups();
                 } else {
                     $groups = array(1);
                 }
                 if ((int) self::$cart->id_address_delivery) {
                     $deliveryAddress = new Address((int) self::$cart->id_address_delivery);
                     $id_zone = Address::getZoneById((int) $deliveryAddress->id);
                 }
                 if (!isset($id_zone)) {
                     $id_zone = (int) Country::getIdZone(isset($deliveryAddress) && (int) $deliveryAddress->id ? (int) $deliveryAddress->id_country : (int) _PS_COUNTRY_DEFAULT_);
                 }
                 $result['carriers'] = Carrier::getCarriersForOrder($id_zone, $groups);
                 $result['checked'] = Carrier::getDefaultCarrierSelection($result['carriers'], (int) self::$cart->id_carrier);
                 $result['HOOK_EXTRACARRIER'] = Module::hookExec('extraCarrier', array('address' => isset($deliveryAddress) && (int) $deliveryAddress->id ? $deliveryAddress : null));
             }
             $result['summary'] = self::$cart->getSummaryDetails();
             $result['customizedDatas'] = Product::getAllCustomizedDatas((int) self::$cart->id);
             $result['HOOK_SHOPPING_CART'] = Module::hookExec('shoppingCart', $result['summary']);
             $result['HOOK_SHOPPING_CART_EXTRA'] = Module::hookExec('shoppingCartExtra', $result['summary']);
             die(Tools::jsonEncode($result));
         } else {
             $this->includeCartModule();
         }
     } else {
         $this->setMedia();
         $this->displayHeader();
         $this->process();
         $this->displayContent();
         $this->displayFooter();
     }
 }
开发者ID:Evil1991,项目名称:PrestaShop-1.4,代码行数:41,代码来源:CartController.php

示例2: _setDefaultCarrierSelection

 /**
  * Decides what the default carrier is and update the cart with it
  *
  * @param array $carriers
  * 
  * @deprecated since 1.5.0
  * 
  * @return number the id of the default carrier
  */
 protected function _setDefaultCarrierSelection($carriers)
 {
     $this->context->cart->id_carrier = Carrier::getDefaultCarrierSelection($carriers, (int) $this->context->cart->id_carrier);
     if ($this->context->cart->update()) {
         return $this->context->cart->id_carrier;
     }
     return 0;
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:17,代码来源:ParentOrderController.php

示例3: _setDefaultCarrierSelection

 /**
  * Decides what the default carrier is and update the cart with it
  *
  * @param array $carriers
  * @return number the id of the default carrier
  */
 protected function _setDefaultCarrierSelection($carriers)
 {
     self::$cart->id_carrier = Carrier::getDefaultCarrierSelection($carriers, (int) self::$cart->id_carrier);
     if (self::$cart->update()) {
         return self::$cart->id_carrier;
     }
     return 0;
 }
开发者ID:greench,项目名称:prestashop,代码行数:14,代码来源:ParentOrderController.php


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