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


PHP Carrier::getCarriers方法代码示例

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


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

示例1: getContent

    function getContent()
    {
        $configKeys = array('EBAY_SECURITY_TOKEN', 'PS_LANG_DEFAULT');
        // Load prestashop ebay's configuration
        $configs = Configuration::getMultiple($configKeys);
        $profile_configs = $this->ebay_profile->getMultiple(array('EBAY_DELIVERY_TIME', 'EBAY_ZONE_NATIONAL', 'EBAY_ZONE_INTERNATIONAL'));
        // Check if the module is configured
        if (!$this->ebay_profile->getConfiguration('EBAY_PAYPAL_EMAIL')) {
            $template_vars = array('error_form_shipping' => 'true');
            return $this->display('error_paypal_email.tpl', $template_vars);
        }
        $nb_shipping_zones_excluded = DB::getInstance()->getValue('SELECT COUNT(*) 
			FROM ' . _DB_PREFIX_ . 'ebay_shipping_zone_excluded
			WHERE `id_ebay_profile` = ' . (int) $this->ebay_profile->id);
        if (!$nb_shipping_zones_excluded) {
            EbayShippingZoneExcluded::loadEbayExcludedLocations($this->ebay_profile->id);
        }
        $module_filters = version_compare(_PS_VERSION_, '1.4.5', '>=') ? Carrier::CARRIERS_MODULE : 2;
        //INITIALIZE CACHE
        $psCarrierModule = $this->ebay_profile->getCarriers($configs['PS_LANG_DEFAULT'], false, false, false, null, $module_filters);
        $url_vars = array('id_tab' => '3', 'section' => 'shipping');
        if (version_compare(_PS_VERSION_, '1.5', '>')) {
            $url_vars['controller'] = Tools::getValue('controller');
        } else {
            $url_vars['tab'] = Tools::getValue('tab');
        }
        $zones = Zone::getZones(true);
        foreach ($zones as &$zone) {
            $zone['carriers'] = Carrier::getCarriers($this->context->language->id, false, false, $zone['id_zone']);
        }
        $template_vars = array('eBayCarrier' => EbayShippingService::getCarriers($this->ebay_profile->ebay_site_id), 'psCarrier' => $this->ebay_profile->getCarriers($configs['PS_LANG_DEFAULT']), 'psCarrierModule' => $psCarrierModule, 'existingNationalCarrier' => EbayShipping::getNationalShippings($this->ebay_profile->id), 'existingInternationalCarrier' => EbayShippingInternationalZone::getExistingInternationalCarrier($this->ebay_profile->id), 'deliveryTime' => $profile_configs['EBAY_DELIVERY_TIME'], 'prestashopZone' => Zone::getZones(), 'excludeShippingLocation' => EbayShippingZoneExcluded::cacheEbayExcludedLocation($this->ebay_profile->id), 'internationalShippingLocations' => EbayShippingLocation::getInternationalShippingLocations(), 'deliveryTimeOptions' => EbayDeliveryTimeOptions::getDeliveryTimeOptions(), 'formUrl' => $this->_getUrl($url_vars), 'ebayZoneNational' => isset($profile_configs['EBAY_ZONE_NATIONAL']) ? $profile_configs['EBAY_ZONE_NATIONAL'] : false, 'ebayZoneInternational' => isset($profile_configs['EBAY_ZONE_INTERNATIONAL']) ? $profile_configs['EBAY_ZONE_INTERNATIONAL'] : false, 'ebay_token' => $configs['EBAY_SECURITY_TOKEN'], 'id_ebay_profile' => $this->ebay_profile->id, 'newPrestashopZone' => $zones);
        return $this->display('shipping.tpl', $template_vars);
    }
开发者ID:kevindesousa,项目名称:ebay,代码行数:33,代码来源:EbayFormShippingTab.php

示例2: __construct

 public function __construct()
 {
     $this->name = 'tntcarrier';
     $this->tab = 'shipping_logistics';
     $this->version = '1.8';
     $this->author = 'PrestaShop';
     $this->limited_countries = array('fr');
     $this->module_key = 'd4dcfde9937b67002235598ac35cbdf8';
     parent::__construct();
     $this->displayName = $this->l('TNT Express');
     $this->description = $this->l('Offer your customers, different delivery methods with TNT');
     if (self::isInstalled($this->name)) {
         global $cookie;
         $warning = array();
         $this->loadingVar();
         $carriers = Carrier::getCarriers($cookie->id_lang, true, false, false, null, PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
         foreach ($this->_fieldsList as $keyConfiguration => $name) {
             if (!Configuration::get($keyConfiguration) && !empty($name)) {
                 $warning[] = '\'' . $name . '\' ';
             }
         }
         // Saving id carrier list
         $id_carrier_list = array();
         foreach ($carriers as $carrier) {
             $id_carrier_list[] .= $carrier['id_carrier'];
         }
         if (count($warning) > 1) {
             $this->warning .= implode(' , ', $warning) . $this->l('must be configured to use this module correctly.') . ' ';
         }
         if (count($warning) == 1) {
             $this->warning .= implode(' , ', $warning) . $this->l('has to be configured to use this module correctly.') . ' ';
         }
     }
 }
开发者ID:rtajmahal,项目名称:PrestaShop-modules,代码行数:34,代码来源:tntcarrier.php

示例3: initContent

 public function initContent()
 {
     $array_carrier = array();
     $carriers = Carrier::getCarriers($this->context->language->id, true, false, false, null, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
     foreach ($carriers as $key => $carrier) {
         if ($carrier['is_free']) {
             unset($carriers[$key]);
         } else {
             $array_carrier[] = $carrier['id_carrier'];
         }
     }
     $id_carrier = (int) Tools::getValue('id_carrier');
     if (count($carriers) && isset($array_carrier[0])) {
         if (!$id_carrier) {
             $id_carrier = (int) $array_carrier[0];
         }
         $carrierSelected = new Carrier((int) $id_carrier);
     } else {
         $carrierSelected = new Carrier((int) $id_carrier);
     }
     $currency = $this->context->currency;
     $rangeObj = $carrierSelected->getRangeObject();
     $rangeTable = $carrierSelected->getRangeTable();
     $suffix = $carrierSelected->getRangeSuffix();
     $rangeIdentifier = 'id_' . $rangeTable;
     $ranges = $rangeObj->getRanges($id_carrier);
     $delivery = Carrier::getDeliveryPriceByRanges($rangeTable, $id_carrier);
     $deliveryArray = array();
     foreach ($delivery as $deliv) {
         $deliveryArray[$deliv['id_zone']][$deliv['id_carrier']][$deliv[$rangeIdentifier]] = $deliv['price'];
     }
     $this->context->smarty->assign(array('zones' => $carrierSelected->getZones(), 'carriers' => $carriers, 'ranges' => $ranges, 'currency' => $currency, 'deliveryArray' => $deliveryArray, 'carrierSelected' => $carrierSelected, 'id_carrier' => $id_carrier, 'suffix' => $suffix, 'rangeIdentifier' => $rangeIdentifier, 'action_fees' => self::$currentIndex . '&token=' . $this->token));
     parent::initContent();
 }
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:34,代码来源:AdminShippingController.php

示例4: getOptionFields

 protected function getOptionFields()
 {
     $forms = array();
     $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
     $carriers = Carrier::getCarriers($this->context->language->id, true);
     $modules = Module::getModulesOnDisk(true);
     $forms = array('payment' => array('title' => $this->l('Average bank fees per payment method'), 'id' => 'payment'), 'carriers' => array('title' => $this->l('Average shipping fees per shipping method'), 'id' => 'carriers'), 'other' => array('title' => $this->l('Other settings'), 'id' => 'other'), 'expenses' => array('title' => $this->l('Other expenses (monthly)'), 'id' => 'expenses'));
     foreach ($forms as &$form) {
         $form['icon'] = 'tab-preferences';
         $form['fields'] = array();
         $form['submit'] = array('title' => $this->l('Save'));
     }
     foreach ($modules as $module) {
         if ($module->tab == 'payments_gateways' && $module->id) {
             $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_FIXED'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a fixed fee for each order placed in %1$s with %2$s.'), $currency->iso_code, $module->displayName), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => $currency->iso_code);
             $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_VAR'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a variable fee for each order placed in %1$s with %2$s. It will be applied on the total paid with taxes.'), $currency->iso_code, $module->displayName), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
             if (Currency::isMultiCurrencyActivated()) {
                 $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_FIXED_FOREIGN'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a fixed fee for each order placed with a foreign currency with %s.'), $module->displayName), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => $currency->iso_code);
                 $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_VAR_FOREIGN'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a variable fee for each order placed with a foreign currency with %s. It will be applied on the total paid with taxes.'), $module->displayName), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
             }
         }
     }
     foreach ($carriers as $carrier) {
         $forms['carriers']['fields']['CONF_' . strtoupper($carrier['id_reference']) . '_SHIP'] = array('title' => $carrier['name'], 'desc' => sprintf($this->l('%% of what you charged the customer for domestic delivery with %s.'), $carrier['name']), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
         $forms['carriers']['fields']['CONF_' . strtoupper($carrier['id_reference']) . '_SHIP_OVERSEAS'] = array('title' => $carrier['name'], 'desc' => sprintf($this->l('%% of what you charged the customer for overseas delivery with %s.'), $carrier['name']), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
     }
     $forms['other']['fields']['CONF_AVERAGE_PRODUCT_MARGIN'] = array('title' => $this->l('Average gross margin (Selling price / Buying price)'), 'desc' => $this->l('Only used if you do not specify your buying price for each product.'), 'validation' => 'isPercentage', 'cast' => 'intval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
     $forms['other']['fields']['CONF_ORDER_FIXED'] = array('title' => $this->l('Other fee per order'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => $currency->iso_code);
     $expense_types = array('hosting' => $this->l('Hosting'), 'tools' => $this->l('Tools (E-mailing, etc.)'), 'acounting' => $this->l('Accounting'), 'development' => $this->l('Development'), 'marketing' => $this->l('Marketing (Adwords, etc.)'), 'others' => $this->l('Others'));
     foreach ($expense_types as $expense_type => $expense_label) {
         $forms['expenses']['fields']['CONF_MONTHLY_' . strtoupper($expense_type)] = array('title' => $expense_label, 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => $currency->iso_code);
     }
     return $forms;
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:34,代码来源:AdminDashboardController.php

示例5: getOptionFields

 protected function getOptionFields()
 {
     $forms = array();
     $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
     $carriers = Carrier::getCarriers($this->context->language->id, true);
     $modules = Module::getModulesOnDisk(true);
     $forms = array('payment' => array('title' => $this->l('Average bank fees per payment method'), 'id' => 'payment'), 'carriers' => array('title' => $this->l('Average shipping fees per shipping method'), 'id' => 'carriers'), 'other' => array('title' => $this->l('Other settings'), 'id' => 'other'));
     foreach ($forms as &$form) {
         $form['icon'] = 'tab-preferences';
         $form['fields'] = array();
         $form['submit'] = array('title' => $this->l('Save'));
     }
     foreach ($modules as $module) {
         if (isset($module->tab) && $module->tab == 'payments_gateways' && $module->id) {
             $moduleClass = Module::getInstanceByName($module->name);
             if (!$moduleClass->isEnabledForShopContext()) {
                 continue;
             }
             $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_FIXED'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a fixed fee for each order placed in %1$s with %2$s.'), $currency->iso_code, $module->displayName), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => $currency->iso_code);
             $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_VAR'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a variable fee for each order placed in %1$s with %2$s. It will be applied on the total paid with taxes.'), $currency->iso_code, $module->displayName), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
             if (Currency::isMultiCurrencyActivated()) {
                 $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_FIXED_FOREIGN'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a fixed fee for each order placed with a foreign currency with %s.'), $module->displayName), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => $currency->iso_code);
                 $forms['payment']['fields']['CONF_' . strtoupper($module->name) . '_VAR_FOREIGN'] = array('title' => $module->displayName, 'desc' => sprintf($this->l('Choose a variable fee for each order placed with a foreign currency with %s. It will be applied on the total paid with taxes.'), $module->displayName), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
             }
         }
     }
     foreach ($carriers as $carrier) {
         $forms['carriers']['fields']['CONF_' . strtoupper($carrier['id_reference']) . '_SHIP'] = array('title' => $carrier['name'], 'desc' => sprintf($this->l('For the carrier named %s, indicate the domestic delivery costs  in percentage of the price charged to customers.'), $carrier['name']), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
         $forms['carriers']['fields']['CONF_' . strtoupper($carrier['id_reference']) . '_SHIP_OVERSEAS'] = array('title' => $carrier['name'], 'desc' => sprintf($this->l('For the carrier named %s, indicate the overseas delivery costs in percentage of the price charged to customers.'), $carrier['name']), 'validation' => 'isPercentage', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
     }
     $forms['carriers']['description'] = $this->l('Method: Indicate the percentage of your carrier margin. For example, if you charge $10 of shipping fees to your customer for each shipment, but you really pay $4 to this carrier, then you should indicate "40" in the percentage field.');
     $forms['other']['fields']['CONF_AVERAGE_PRODUCT_MARGIN'] = array('title' => $this->l('Average gross margin'), 'desc' => $this->l('You should calculate this percentage as follows: ((total sales revenue) - (cost of goods sold)) / (total sales revenue) * 100. This value is only used to calculate the Dashboard approximate gross margin, if you do not specify the wholesale price for each product.'), 'validation' => 'isPercentage', 'cast' => 'intval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => '%');
     $forms['other']['fields']['CONF_ORDER_FIXED'] = array('title' => $this->l('Other fees per order'), 'desc' => $this->l('You should calculate this value by making the sum of all of your additional costs per order.'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'text', 'defaultValue' => '0', 'suffix' => $currency->iso_code);
     return $forms;
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:35,代码来源:AdminDashboardController.php

示例6: _displayForm

    private function _displayForm()
    {
        $this->_html .= '
        <form method="post" action="' . Tools::safeOutput($_SERVER['REQUEST_URI']) . '">
			<fieldset>
				<legend><img src="' . $this->_path . 'logo.png" width="16" height="16"/>' . $this->l('Settings') . '</legend> 
				
                <label>' . $this->l('Carrier') . '</label>
				<div class="margin-form">
                    <select name="STORE_DELIVERY_CARRIER">';
        foreach (Carrier::getCarriers($this->context->language->id) as $carrier) {
            $this->_html .= '<option value="' . $carrier['id_carrier'] . '"' . ($carrier['id_carrier'] == Configuration::get('STORE_DELIVERY_CARRIER') ? ' selected="selected"' : '') . '>' . $carrier['name'] . '</option>';
        }
        $this->_html .= '</select>
                    <p class="clear">' . $this->l('Choose here a carrier used for the delivery in store') . '</p>
                </div>
				<div class="clear"></div>
                
                <label>' . $this->l('Send email to store to prevent new order') . '</label>
				<div class="margin-form">
                    <input type="radio" name="STORE_DELIVERY_SEND_MAIL" id="sendmail_on" value="1" ' . (Configuration::get('STORE_DELIVERY_SEND_MAIL') == '1' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="sendmail_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="STORE_DELIVERY_SEND_MAIL" id="sendmail_off" value="0" ' . (Configuration::get('STORE_DELIVERY_SEND_MAIL') == '0' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="sendmail_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p class="clear">' . $this->l('You must enter email address in each store admin') . '</p>
				</div>
				<div class="clear"></div>
                
                <label>' . $this->l('Display Google Map') . '</label>
				<div class="margin-form">
                    <input type="radio" name="STORE_DELIVERY_DISPLAY_MAP" id="map_on" value="1" ' . (Configuration::get('STORE_DELIVERY_DISPLAY_MAP') == '1' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="map_on"><img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" /></label>
					<input type="radio" name="STORE_DELIVERY_DISPLAY_MAP" id="map_off" value="0" ' . (Configuration::get('STORE_DELIVERY_DISPLAY_MAP') == '0' ? 'checked="checked" ' : '') . '/>
					<label class="t" for="map_off"><img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" /></label>
					<p class="clear">' . $this->l("You can display a map of stores. Don't forgot to change default latitude/longitude in Store Contact page (under Preference/Store Contact admin page)") . '</p>
				</div>
				<div class="clear"></div>
                
                <label>' . $this->l('Height of Google map') . '</label>
				<div class="margin-form">
					<input type="text" name="STORE_DELIVERY_HEIGHT_MAP" value="' . Configuration::get('STORE_DELIVERY_HEIGHT_MAP') . '"/>
                        <p class="clear">' . $this->l('Height of map in px (for exemple enter "300px")') . '</p>
                </div>
				<div class="clear"></div>
                
                <label>' . $this->l('Width of Google map') . '</label>
				<div class="margin-form">
					<input type="text" name="STORE_DELIVERY_WIDTH_MAP" value="' . Configuration::get('STORE_DELIVERY_WIDTH_MAP') . '"/>
                    <p class="clear">' . $this->l('Width of map in px or % (for exemple enter "725px" or "100%"...)') . '</p>
                </div>
				<div class="clear"></div>
                
				<div class="margin-form clear pspace">
                    <input type="submit" name="submitUpdate" value="' . $this->l('Update') . '" class="button" />
                </div>
			</fieldset>
		</form>';
        return $this->_html;
    }
开发者ID:Oldwo1f,项目名称:yakaboutique,代码行数:59,代码来源:storedelivery.php

示例7: __construct

 /**
  * Initializes the class.
  *
  * @param string $code The provider code.
  * 
  * @return void
  */
 public function __construct($code)
 {
     $providers = array_merge(self::$providers, Carrier::getCarriers());
     if (!array_key_exists($code, $providers)) {
         return false;
     }
     $this->code = $code;
     $this->name = $providers[$code];
 }
开发者ID:dsposito,项目名称:argo,代码行数:16,代码来源:Provider.php

示例8: displayOrderStep

 function displayOrderStep($params)
 {
     global $smarty, $cart, $cookie, $defaultCountry;
     if ($isVirtualCart = $cart->isVirtualCart()) {
         $cart->id_carrier = 0;
         $cart->update();
     }
     $smarty->assign('virtual_cart', $isVirtualCart);
     $address = new Address(intval($cart->id_address_delivery));
     $id_zone = Address::getZoneById($address->id);
     $result = Carrier::getCarriers(intval($cookie->id_lang), true, false, intval($id_zone));
     $resultsArray = array();
     foreach ($result as $k => $row) {
         $carrier = new Carrier(intval($row['id_carrier']));
         if (Configuration::get('PS_SHIPPING_METHOD') and !$carrier->getMaxDeliveryPriceByWeight($id_zone) or !Configuration::get('PS_SHIPPING_METHOD') and !$carrier->getMaxDeliveryPriceByPrice($id_zone)) {
             unset($result[$k]);
             continue;
         }
         if ($row['range_behavior']) {
             // Get id zone
             if (isset($cart->id_address_delivery) and $cart->id_address_delivery) {
                 $id_zone = Address::getZoneById(intval($cart->id_address_delivery));
             } else {
                 $id_zone = intval($defaultCountry->id_zone);
             }
             if (Configuration::get('PS_SHIPPING_METHOD') and !Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $cart->getTotalWeight(), $id_zone) or !Configuration::get('PS_SHIPPING_METHOD') and !Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $cart->getOrderTotalLC(true, 4), $id_zone)) {
                 unset($result[$k]);
                 continue;
             }
         }
         $row['name'] = strval($row['name']) != '0' ? $row['name'] : Configuration::get('PS_SHOP_NAME');
         $row['price'] = $cart->getOrderShippingCostLC(intval($row['id_carrier']));
         $row['price_tax_exc'] = $cart->getOrderShippingCostLC(intval($row['id_carrier']), false);
         $row['img'] = file_exists(_PS_SHIP_IMG_DIR_ . intval($row['id_carrier']) . '.jpg') ? _THEME_SHIP_DIR_ . intval($row['id_carrier']) . '.jpg' : '';
         $row['extra'] = Module::hookExec('extraCarrierDetails', array("row" => $row, "carrier" => $carrier));
         $resultsArray[] = $row;
     }
     // Wrapping fees
     $wrapping_fees = floatval(Configuration::get('PS_GIFT_WRAPPING_PRICE'));
     $wrapping_fees_tax = new Tax(intval(Configuration::get('PS_GIFT_WRAPPING_TAX')));
     $wrapping_fees_tax_exc = $wrapping_fees / (1 + floatval($wrapping_fees_tax->rate) / 100);
     if (Validate::isUnsignedInt($cart->id_carrier)) {
         $carrier = new Carrier(intval($cart->id_carrier));
         if ($carrier->active and !$carrier->deleted) {
             $checked = intval($cart->id_carrier);
         }
     }
     if (!isset($checked)) {
         $checked = intval(Configuration::get('PS_CARRIER_DEFAULT'));
     }
     $smarty->assign(array('checkedTOS' => intval($cookie->checkedTOS), 'recyclablePackAllowed' => intval(Configuration::get('PS_RECYCLABLE_PACK')), 'giftAllowed' => intval(Configuration::get('PS_GIFT_WRAPPING')), 'conditions' => intval(Configuration::get('PS_CONDITIONS')), 'recyclable' => intval($cart->recyclable), 'gift_wrapping_price' => floatval(Configuration::get('PS_GIFT_WRAPPING_PRICE')), 'carriers' => $resultsArray, 'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address)), 'checked' => intval($checked), 'back' => strval(Tools::getValue('back')), 'total_wrapping' => number_format($wrapping_fees, 2, '.', ''), 'total_wrapping_tax_exc' => number_format($wrapping_fees_tax_exc, 2, '.', '')));
     Tools::safePostVars();
     $css_files = array(__PS_BASE_URI__ . 'css/thickbox.css' => 'all');
     $js_files = array(__PS_BASE_URI__ . 'js/jquery/thickbox-modified.js');
     include_once dirname(__FILE__) . '/../../header.php';
     echo $this->display(__FILE__, 'ordercarrier.tpl');
 }
开发者ID:redb,项目名称:prestashop,代码行数:57,代码来源:ordercarrier.php

示例9: getCarrierByName

 public static function getCarrierByName($name)
 {
     global $cookie;
     $carriers = Carrier::getCarriers($cookie->id_lang, true, false, false, NULL, ALL_CARRIERS);
     foreach ($carriers as $carrier) {
         if (!$carrier['deleted'] and $carrier['external_module_name'] == $name) {
             return new Carrier($carrier['id_carrier']);
         }
     }
 }
开发者ID:hecbuma,项目名称:quali-fisioterapia,代码行数:10,代码来源:dejalacarrierutils.php

示例10: getCarriersList

 public function getCarriersList()
 {
     $carriers = Carrier::getCarriers($this->mCookie->id_lang);
     $binded = unserialize(Configuration::get(self::KONFIG_PREFIX . self::KONFIG_POWIAZANIA_KURIEROW));
     $list = array();
     foreach ($carriers as $key => $c) {
         $list[] = new BindedCarrier($c['id_carrier'], $c['name'], is_array($binded) && isset($binded[$c['id_carrier']]) ? $binded[$c['id_carrier']] : "false");
     }
     return $list;
 }
开发者ID:nikuta,项目名称:paczkomaty,代码行数:10,代码来源:Pakomato14.php

示例11: renderForm

 public function renderForm()
 {
     $carriers = Carrier::getCarriers($this->context->language->id, true, false, false, null, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
     foreach ($carriers as $key => $carrier) {
         if ($carrier['is_free']) {
             unset($carriers[$key]);
         }
     }
     $this->fields_form = array('legend' => array('title' => $this->l('Weight ranges'), 'icon' => 'icon-suitcase'), 'input' => array(array('type' => 'select', 'label' => $this->l('Carrier'), 'name' => 'id_carrier', 'required' => false, 'hint' => $this->l('You can apply this range to a different carrier by selecting its name.'), 'options' => array('query' => $carriers, 'id' => 'id_carrier', 'name' => 'name'), 'empty_message' => '<p class="alert alert-block">' . $this->l('There is no carrier available for this weight range.') . '</p>'), array('type' => 'text', 'label' => $this->l('From'), 'name' => 'delimiter1', 'required' => true, 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), 'hint' => $this->l('Start range (included).')), array('type' => 'text', 'label' => $this->l('To'), 'name' => 'delimiter2', 'required' => true, 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), 'hint' => $this->l('End range (excluded).'))), 'submit' => array('title' => $this->l('   Save   '), 'class' => 'btn btn-default'));
     return parent::renderForm();
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:11,代码来源:AdminRangeWeightController.php

示例12: renderForm

 public function renderForm()
 {
     $carriers = Carrier::getCarriers($this->context->language->id, true, false, false, null, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
     foreach ($carriers as $key => $carrier) {
         if ($carrier['is_free']) {
             unset($carriers[$key]);
         }
     }
     $this->fields_form = array('legend' => array('title' => $this->l('Weight ranges'), 'image' => '../img/t/AdminRangeWeight.gif'), 'input' => array(array('type' => 'select', 'label' => $this->l('Carrier:'), 'name' => 'id_carrier', 'required' => false, 'desc' => $this->l('You can apply this range to a different carrier by selecting its name.'), 'options' => array('query' => $carriers, 'id' => 'id_carrier', 'name' => 'name'), 'empty_message' => '<div style="margin:5px 0 10px 0">' . $this->l('There is no carrier available for this weight range.') . '</div>'), array('type' => 'text', 'label' => $this->l('From:'), 'name' => 'delimiter1', 'size' => 5, 'required' => true, 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), 'desc' => $this->l('Range start (included)')), array('type' => 'text', 'label' => $this->l('To:'), 'name' => 'delimiter2', 'size' => 5, 'required' => true, 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), 'desc' => $this->l('Range end (excluded)'))), 'submit' => array('title' => $this->l('   Save   '), 'class' => 'button'));
     return parent::renderForm();
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:11,代码来源:AdminRangeWeightController.php

示例13: renderForm

 public function renderForm()
 {
     $currency = $this->context->currency;
     $carriers = Carrier::getCarriers((int) Configuration::get('PS_LANG_DEFAULT'), true, false, false, null, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
     foreach ($carriers as $key => $carrier) {
         if ($carrier['is_free']) {
             unset($carriers[$key]);
         }
     }
     $this->fields_form = array('legend' => array('title' => $this->l('Price ranges'), 'icon' => 'icon-money'), 'input' => array(array('type' => 'select', 'label' => $this->l('Carrier'), 'name' => 'id_carrier', 'required' => false, 'hint' => $this->l('You can apply this range to a different carrier by selecting its name.'), 'options' => array('query' => $carriers, 'id' => 'id_carrier', 'name' => 'name'), 'empty_message' => '<p class="alert alert-block">' . $this->l('There is no carrier available for this price range.') . '</p>'), array('type' => 'text', 'label' => $this->l('From'), 'name' => 'delimiter1', 'required' => true, 'suffix' => $currency->getSign('right') . ' ' . $this->l('(Tax Incl.)'), 'hint' => $this->l('Start range (included).'), 'string_format' => '%.2f'), array('type' => 'text', 'label' => $this->l('To'), 'name' => 'delimiter2', 'required' => true, 'suffix' => $currency->getSign('right') . ' ' . $this->l('(Tax Incl.)'), 'hint' => $this->l('End range (excluded).'), 'string_format' => '%.2f')), 'submit' => array('title' => $this->trans('Save', array(), 'Admin.Actions'), 'class' => 'btn btn-default'));
     return parent::renderForm();
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:12,代码来源:AdminRangePriceController.php

示例14: renderForm

 public function renderForm()
 {
     $currency = $this->context->currency;
     $carriers = Carrier::getCarriers((int) Configuration::get('PS_LANG_DEFAULT'), true, false, false, null, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE);
     foreach ($carriers as $key => $carrier) {
         if ($carrier['is_free']) {
             unset($carriers[$key]);
         }
     }
     $this->fields_form = array('legend' => array('title' => $this->l('Price ranges'), 'image' => '../img/t/AdminRangePrice.gif'), 'input' => array(array('type' => 'select', 'label' => $this->l('Carrier:'), 'name' => 'id_carrier', 'required' => false, 'desc' => $this->l('You can apply this range to a different carrier by selecting its name.'), 'options' => array('query' => $carriers, 'id' => 'id_carrier', 'name' => 'name'), 'empty_message' => '<div style="margin:5px 0 10px 0">' . $this->l('There is no carrier available for this price range.') . '</div>'), array('type' => 'text', 'label' => $this->l('From:'), 'name' => 'delimiter1', 'size' => 5, 'required' => true, 'suffix' => $currency->getSign('right') . ' ' . $this->l('(Tax Incl.)'), 'desc' => $this->l('Start range (included)'), 'string_format' => '%.2f'), array('type' => 'text', 'label' => $this->l('To:'), 'name' => 'delimiter2', 'size' => 5, 'required' => true, 'suffix' => $currency->getSign('right') . ' ' . $this->l('(Tax Incl.)'), 'desc' => $this->l('End range (excluded)'), 'string_format' => '%.2f')), 'submit' => array('title' => $this->l('   Save   '), 'class' => 'button'));
     return parent::renderForm();
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:12,代码来源:AdminRangePriceController.php

示例15: __construct

 public function __construct()
 {
     $this->table = 'powatag_configuration';
     $this->lang = false;
     $this->_select = null;
     //If needed you can add informations to select issued from other databases
     $this->_join = null;
     //Join the databases here
     parent::__construct();
     $this->bootstrap = true;
     $this->fields_options = array('api_settings' => array('title' => $this->l('API Settings'), 'image' => '../img/admin/prefs.gif', 'fields' => array('POWATAG_API_KEY' => array('title' => $this->l('API Key'), 'validation' => 'isString', 'type' => 'text', 'size' => '80', 'visibility' => Shop::CONTEXT_SHOP, 'required' => true), 'POWATAG_HMAC_KEY' => array('title' => $this->l('HMAC Key'), 'validation' => 'isString', 'type' => 'text', 'visibility' => Shop::CONTEXT_SHOP, 'size' => 80, 'required' => true), 'POWATAG_GENERATOR_URL' => array('title' => $this->l('Powatag Endpoint URL'), 'validation' => 'isString', 'type' => 'text', 'size' => 80), 'POWATAG_JS_URL' => array('title' => $this->l('Head JavaScript URL'), 'validation' => 'isString', 'type' => 'text', 'size' => 80), 'POWATAG_CSS_URL' => array('title' => $this->l('Head CSS URL'), 'validation' => 'isString', 'type' => 'text', 'size' => 80), 'POWATAG_LEGACY_ERRORS' => array('title' => $this->l('Legacy error codes enabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP)), 'submit' => array('title' => $this->l('Save'))), 'other_settings' => array('title' => $this->l('Other Settings'), 'image' => '../img/admin/tab-tools.gif', 'fields' => array('POWATAG_SHIPPING' => array('title' => $this->l('Shipping Method'), 'validation' => 'isInt', 'type' => 'select', 'identifier' => 'id_carrier', 'desc' => $this->l('This will be used to calculate shipping costs'), 'list' => Carrier::getCarriers($this->context->language->id, false, false, false, null, Carrier::ALL_CARRIERS), 'visibility' => Shop::CONTEXT_SHOP, 'required' => true), 'POWATAG_SUCCESS_MSG' => array('title' => $this->l('Sucess message'), 'validation' => 'isString', 'type' => 'textLang', 'size' => '80', 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_IMG_TYPE' => array('title' => $this->l('Image type to send'), 'validation' => 'isInt', 'type' => 'select', 'identifier' => 'id_image_type', 'list' => ImageType::getImagesTypes(), 'visibility' => Shop::CONTEXT_SHOP, 'required' => true)), 'submit' => array('title' => $this->l('Save'))), 'product_settings' => array('title' => $this->l('Product Settings'), 'image' => $this->module->getPathUri() . 'img/qr_code.png', 'fields' => array('POWATAG_QR' => array('title' => $this->l('QR Code enabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_QR_POS' => array('title' => $this->l('QR code Position'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => 'displayRightColumnProduct', 'name' => $this->l('displayRightColumnProduct')), array('key' => 'displayLeftColumnProduct', 'name' => $this->l('displayLeftColumnProduct')), array('key' => 'displayFooterProduct', 'name' => $this->l('displayFooterProduct')), array('key' => 'displayProductButtons', 'name' => $this->l('displayProductButtons'))), 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_SKU' => array('title' => $this->l('Which SKU field to use '), 'validation' => 'isInt', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => Powatag::EAN, 'name' => $this->l('EAN13 or JAN')), array('key' => Powatag::UPC, 'name' => $this->l('UPC')), array('key' => Powatag::PRODUCT_ID, 'name' => $this->l('Product ID')), array('key' => Powatag::REFERENCE, 'name' => $this->l('REFERENCE')))), 'POWATAG_REDIRECT' => array('title' => $this->l('URL Redirect'), 'validation' => 'isString', 'type' => 'text', 'size' => 250), 'POWATAG_OFFER' => array('title' => $this->l('Promotional area'), 'validation' => 'isString', 'type' => 'text', 'size' => 250), 'POWATAG_LANG' => array('title' => $this->l('Language'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'site', 'name' => $this->l('Use site language')), array('key' => 'en_GB', 'name' => $this->l('en_GB')), array('key' => 'es_ES', 'name' => $this->l('es_ES')), array('key' => 'fr_FR', 'name' => $this->l('fr_FR')), array('key' => 'it_IT', 'name' => $this->l('it_IT')))), 'POWATAG_TYPE' => array('title' => $this->l('Type'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'bag', 'name' => $this->l('Bag')), array('key' => 'mobile-button', 'name' => $this->l('Mobile button')), array('key' => 'tablet-bag', 'name' => $this->l('Tablet bag')))), 'POWATAG_STYLE' => array('title' => $this->l('Style'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'act-left', 'name' => $this->l('act-left')), array('key' => 'act-right', 'name' => $this->l('act-right')), array('key' => 'buy-left', 'name' => $this->l('buy-left')), array('key' => 'buy-right', 'name' => $this->l('buy-right')), array('key' => 'give-left', 'name' => $this->l('give-left')), array('key' => 'give-right', 'name' => $this->l('give-right')), array('key' => 'bg-act-left', 'name' => $this->l('bg-act-left')), array('key' => 'bg-act-right', 'name' => $this->l('bg-act-right')), array('key' => 'bg-buy-left', 'name' => $this->l('bg-buy-left')), array('key' => 'bg-buy-right', 'name' => $this->l('bg-buy-right')), array('key' => 'bg-give-left', 'name' => $this->l('bg-give-left')), array('key' => 'bg-give-right', 'name' => $this->l('bg-give-right')))), 'POWATAG_COLORSCHEME' => array('title' => $this->l('Color scheme'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'light', 'name' => $this->l('Light')), array('key' => 'dark', 'name' => $this->l('Dark')))), 'POWATAG_DISPLAY' => array('title' => $this->l('Desktop / mobile'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'both', 'name' => $this->l('Both')), array('key' => 'desktop-only', 'name' => $this->l('Desktop only')), array('key' => 'mobile-only', 'name' => $this->l('Mobile only')))), 'POWATAG_VIDEO' => array('title' => $this->l('Video'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'POWATAG_DEBUG' => array('title' => $this->l('Developer mode'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))), 'logs' => array('title' => $this->l('Logs'), 'image' => '../img/t/AdminLogs.gif', 'fields' => array('POWATAG_API_LOG' => array('title' => $this->l('Enable applicative logging'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_REQUEST_LOG' => array('title' => $this->l('Enable request logging'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP)), 'submit' => array('title' => $this->l('Save'))));
 }
开发者ID:powa,项目名称:prestashop-extension,代码行数:12,代码来源:AdminPowaTagConfigurationController.php


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