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


PHP mslib_fe::getShippingCosts方法代码示例

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


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

示例1: implode

        }
    }
    $data['shipping_name'] = $shipping_method_label;
} else {
    $data['shipping_cost'] = '';
    $data['shipping_cost_cur'] = '';
    $data['shipping_name'] = $shipping_method_label;
}
$data['payment_cost'] = $payment_method_costs;
$data['payment_cost_cur'] = mslib_fe::amount2Cents($payment_method_costs);
$data['payment_name'] = $payment_method_label;
$data['available_shipping'] = implode(';', $available_sid);
// rebuilt the shipping cost for available shipping methods based on selected payment
foreach ($available_sid as $sids) {
    $this->post['caller_segment'] = 'available_shipping_costs';
    $priceArray = mslib_fe::getShippingCosts($countries_id, $sids);
    if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'] && !$this->ms['MODULES']['DISABLE_VAT_RATE']) {
        $data['available_shippingcost'][$sids] = '';
        if ($priceArray['shipping_costs_including_vat'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) {
            $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat'], 0, 0);
            $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box_including_vat'], 0, 0);
        } else {
            if ($priceArray['shipping_costs_including_vat'] < 0) {
                $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat'], 0, 0);
                $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box_including_vat'], 0, 0);
            }
        }
    } else {
        $data['available_shippingcost'][$sids] = '';
        if ($priceArray['shipping_costs'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) {
            $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs'], 0, 0);
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:get_method_costs.php

示例2: array

     $shipping_method = mslib_fe::getShippingMethod($item['id'], 's.id', $countries_id);
     // custom hook that can be controlled by third-party plugin
     $shipping_method_description = '';
     if (!empty($item['description'])) {
         $shipping_method_description = '<div class="description">' . $item['description'] . '</div>';
     }
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/includes/checkout/multistep/checkout_shipping_payment_method']['checkoutMultistepShippingMethodSelectionHook'])) {
         $params = array('shipping_method' => &$shipping_method, 'item' => &$item, 'shipping_method_description' => &$shipping_method_description);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/includes/checkout/multistep/checkout_shipping_payment_method']['checkoutMultistepShippingMethodSelectionHook'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     $count++;
     // costs
     $price_wrap = '';
     $priceArray = mslib_fe::getShippingCosts($countries_id, $item['id']);
     if ($priceArray['shipping_costs_including_vat'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) {
         $data['shipping_cost'] = $priceArray['shipping_costs_including_vat'];
         $price_wrap = '<div class="shipping_price" style="float:right" id="shipping_price_' . $item['id'] . '">' . mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat']) . '</div>';
     }
     // costs eof
     $content .= '<li id="multishop_shipping_method_' . $item['id'] . '" class="col-sm-4"><label for="shipping_method_' . $item['id'] . '" class="name" id="label_shipping_method_' . $item['id'] . '"><div class="listing_item">';
     if ($price_wrap) {
         $content .= $price_wrap;
     }
     $content .= '<input name="shipping_method" id="shipping_method_' . $item['id'] . '" type="radio" value="' . htmlspecialchars($item['id']) . '" ' . (($this->post['tx_multishop_pi1']['previous_checkout_section'] != current($stepCodes) and $count == 1) ? 'checked' : '') . ' /><strong class="method_name">' . $item['name'] . '</strong>';
     $content .= $shipping_method_description;
     $content .= '</div></label>';
     $content .= '</li>';
 }
 $content .= '
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:checkout_shipping_payment_method.php

示例3: array

 } else {
     $delivery_country = mslib_fe::getCountryByName($this->post['delivery_country']);
     $updateArray = array();
     if ($this->post['shipping_method']) {
         $shipping_method = mslib_fe::getShippingMethod($this->post['shipping_method']);
         if (empty($order['orders_tax_data'])) {
             // temporary call, replacing the inner tax_ruleset inside the getShippingMethod
             $tax_ruleset = mslib_fe::taxRuleSet($shipping_method['tax_id'], 0, $country['cn_iso_nr'], $zone['zn_country_iso_nr']);
             $shipping_method['tax_rate'] = $tax_ruleset['total_tax_rate'] / 100;
             $shipping_method['country_tax_rate'] = $tax_ruleset['country_tax_rate'] / 100;
             $shipping_method['region_tax_rate'] = $tax_ruleset['state_tax_rate'] / 100;
         }
         if ($this->post['tx_multishop_pi1']['shipping_method_costs']) {
             $price = $this->post['tx_multishop_pi1']['shipping_method_costs'];
         } else {
             $price = mslib_fe::getShippingCosts($delivery_country['cn_iso_nr'], $this->post['shipping_method']);
         }
         if ($price > 0) {
             if (strstr($price, "%")) {
                 // calculate total shipping costs based by %
                 $subtotal = 0;
                 foreach ($order['products'] as $products_id => $value) {
                     if (is_numeric($products_id)) {
                         $subtotal = $subtotal + $value['qty'] * $value['final_price'];
                     }
                 }
                 if ($subtotal) {
                     $percentage = str_replace("%", '', $price);
                     if ($percentage) {
                         $price = $subtotal / 100 * $percentage;
                     }
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:zzzz_admin_edit_order.php

示例4: setShippingMethod

 function setShippingMethod($shipping_method)
 {
     if (!$shipping_method) {
         return 0;
     }
     if (isset($this->cart['user']['delivery_countries_id']) && !empty($this->cart['user']['delivery_countries_id'])) {
         $priceArray = mslib_fe::getShippingCosts($this->cart['user']['delivery_countries_id'], $shipping_method);
     } else {
         $priceArray = mslib_fe::getShippingCosts($this->cart['user']['countries_id'], $shipping_method);
     }
     $price = $priceArray['shipping_costs'];
     if ($price) {
         $this->cart['user']['shipping_method_costs'] = $price;
     } else {
         $this->cart['user']['shipping_method_costs'] = 0;
     }
     if (isset($this->cart['user']['delivery_countries_id']) && !empty($this->cart['user']['delivery_countries_id'])) {
         $shipping_method = mslib_fe::getShippingMethod($shipping_method, 's.id', $this->cart['user']['delivery_countries_id']);
     } else {
         $shipping_method = mslib_fe::getShippingMethod($shipping_method, 's.id', $this->cart['user']['countries_id']);
     }
     if ($shipping_method['tax_id'] && $this->cart['user']['shipping_method_costs']) {
         $this->cart['user']['shipping_total_tax_rate'] = $shipping_method['tax_rate'];
         if ($shipping_method['country_tax_rate']) {
             $this->cart['user']['shipping_country_tax_rate'] = $shipping_method['country_tax_rate'];
             $this->cart['user']['shipping_country_tax'] = mslib_fe::taxDecimalCrop($this->cart['user']['shipping_method_costs'] * $shipping_method['country_tax_rate']);
         } else {
             $this->cart['user']['shipping_country_tax_rate'] = 0;
             $this->cart['user']['shipping_country_tax'] = 0;
         }
         if ($shipping_method['region_tax_rate']) {
             $this->cart['user']['shipping_region_tax_rate'] = $shipping_method['region_tax_rate'];
             $this->cart['user']['shipping_region_tax'] = mslib_fe::taxDecimalCrop($this->cart['user']['shipping_method_costs'] * $shipping_method['region_tax_rate']);
         } else {
             $this->cart['user']['shipping_region_tax_rate'] = 0;
             $this->cart['user']['shipping_region_tax'] = 0;
         }
         if ($this->cart['user']['shipping_region_tax'] && $this->cart['user']['shipping_country_tax']) {
             $this->cart['user']['shipping_tax'] = $this->cart['user']['shipping_country_tax'] + $this->cart['user']['shipping_region_tax'];
         } else {
             $this->cart['user']['shipping_tax'] = mslib_fe::taxDecimalCrop($this->cart['user']['shipping_method_costs'] * $shipping_method['tax_rate']);
         }
     } else {
         $this->cart['user']['shipping_tax'] = 0;
         $this->cart['user']['shipping_country_tax'] = 0;
         $this->cart['user']['shipping_region_tax'] = 0;
         $this->cart['user']['shipping_total_tax_rate'] = 0;
         $this->cart['user']['shipping_country_tax_rate'] = 0;
         $this->cart['user']['shipping_region_tax_rate'] = 0;
     }
     $this->cart['user']['shipping_method'] = $shipping_method['code'];
     $this->cart['user']['shipping_method_label'] = $shipping_method['name'];
     // hook to rewrite the whole methods
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['setShippingMethodPreSaveHook'])) {
         $params = array('cart_user' => &$this->cart['user']);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['setShippingMethodPreSaveHook'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     tx_mslib_cart::storeCart($this->cart);
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:61,代码来源:class.tx_mslib_cart.php


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