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


PHP mslib_fe::getRegionByName方法代码示例

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


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

示例1:

} else {
    $subpartArray['###VALUE_REFERRER###'] = $_SERVER['HTTP_REFERER'];
}
if (is_numeric($this->get['orders_id'])) {
    $order = mslib_fe::getOrder($this->get['orders_id']);
    if ($order['customer_id']) {
        if (!($customer_address = mslib_fe::getAddressInfo('customer', $order['customer_id']))) {
            $customer_address['country'] = $order['billing_country'];
            $customer_address['region'] = $order['billing_region'];
        }
        if (!isset($customer_address['country']) && isset($customer_address['default']['country'])) {
            $customer_address = $customer_address['default'];
        }
        $country = mslib_fe::getCountryByName($customer_address['country']);
        if (!empty($customer_address['region'])) {
            $zone = mslib_fe::getRegionByName($customer_address['region']);
        } else {
            $zone['zn_country_iso_nr'] = 0;
        }
    }
    if ($this->ms['MODULES']['ORDER_EDIT']) {
        if (!$order['is_locked']) {
            // delete single item in order
            $redirect_after_delete = false;
            if (isset($this->get['delete_product']) && $this->get['delete_product'] == 1) {
                if (isset($this->get['order_pid']) && $this->get['order_pid'] > 0) {
                    $sql = "delete from tx_multishop_orders_products where orders_products_id = " . $this->get['order_pid'] . " limit 1";
                    $GLOBALS['TYPO3_DB']->sql_query($sql);
                    $sql = "delete from tx_multishop_orders_products_attributes where orders_products_id = " . $this->get['order_pid'];
                    $GLOBALS['TYPO3_DB']->sql_query($sql);
                    $redirect_after_delete = true;
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:zzzz_admin_edit_order.php

示例2: taxRuleSet

 public function taxRuleSet($tax_group_id, $current_price, $cn_iso_nr = 0, $zn_country_iso_nr = 0)
 {
     if (!$zn_country_iso_nr) {
         if (mslib_fe::loggedin()) {
             if (!$this->ADMIN_USER) {
                 if (!$this->tta_user_info) {
                     $row_shop_address = $this->tta_shop_info;
                 } else {
                     $row_shop_address = $this->tta_user_info['default'];
                 }
             } else {
                 $row_shop_address = $this->tta_shop_info;
             }
         } else {
             $row_shop_address = $this->tta_shop_info;
         }
         if (isset($row_shop_address['region']) && !empty($row_shop_address['region'])) {
             $zone_id = mslib_fe::getRegionByName($row_shop_address['region']);
             $zn_country_iso_nr = $zone_id['uid'];
         }
     }
     if ($tax_group_id) {
         $sql_local_tax_rate = $GLOBALS['TYPO3_DB']->SELECTquery('mt.rate as tax_rate,mt_c.rate as country_tax_rate,sc.cn_iso_nr as country_id,sc.cn_short_en as country_name,scz.uid as state_id,scz.zn_name_local as state_name,mtr.state_modus', 'tx_multishop_taxes mt LEFT JOIN tx_multishop_tax_rules mtr on mtr.tax_id = mt.tax_id LEFT JOIN tx_multishop_taxes mt_c on mtr.country_tax_id = mt_c.tax_id LEFT JOIN static_countries sc on sc.cn_iso_nr = mtr.cn_iso_nr LEFT JOIN static_country_zones scz on mtr.zn_country_iso_nr = scz.uid', 'mtr.status = 1 and mtr.cn_iso_nr = \'' . addslashes($cn_iso_nr) . '\' and mtr.zn_country_iso_nr = \'' . addslashes($zn_country_iso_nr) . '\' and mtr.rules_group_id = \'' . addslashes($tax_group_id) . '\'', '', '', '');
         $qry_local_tax_rate = $GLOBALS['TYPO3_DB']->sql_query($sql_local_tax_rate);
         // retry to get the tax ruleset only for the country
         if (!$GLOBALS['TYPO3_DB']->sql_num_rows($qry_local_tax_rate) && $zn_country_iso_nr > 0) {
             $sql_local_tax_rate = $GLOBALS['TYPO3_DB']->SELECTquery('mt.rate as tax_rate,mt_c.rate as country_tax_rate,sc.cn_iso_nr as country_id,sc.cn_short_en as country_name,scz.uid as state_id,scz.zn_name_local as state_name,mtr.state_modus', 'tx_multishop_taxes mt left join tx_multishop_tax_rules mtr on mtr.tax_id = mt.tax_id left join tx_multishop_taxes mt_c on mtr.country_tax_id = mt_c.tax_id left join static_countries sc on sc.cn_iso_nr = mtr.cn_iso_nr left join static_country_zones scz on mtr.zn_country_iso_nr = scz.uid', 'mtr.status = 1 and mtr.cn_iso_nr = \'' . addslashes($cn_iso_nr) . '\' and mtr.zn_country_iso_nr = 0 and mtr.rules_group_id = \'' . addslashes($tax_group_id) . '\'', '', '', '');
             $qry_local_tax_rate = $GLOBALS['TYPO3_DB']->sql_query($sql_local_tax_rate);
         }
         if (!$GLOBALS['TYPO3_DB']->sql_num_rows($qry_local_tax_rate)) {
             return false;
         }
         $tax_data = array();
         while ($row_local_tax_rate = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry_local_tax_rate)) {
             $tax_data['local'] = $row_local_tax_rate;
         }
         if ($tax_data['local']['state_modus'] == 2) {
             $state_tax_rate = $tax_data['local']['tax_rate'];
             $country_tax_rate = $tax_data['local']['country_tax_rate'];
             $total_tax_rate = $state_tax_rate + $country_tax_rate;
             $data['state_tax'] = $state_tax;
             $data['country_tax'] = $country_tax;
             $data['state_tax_rate'] = $state_tax_rate;
             $data['country_tax_rate'] = $country_tax_rate;
             $data['total_tax_rate'] = $total_tax_rate;
         } else {
             $tax_rate = $tax_data['local']['tax_rate'];
             $total_tax_rate = $tax_rate;
             $data['tax'] = $tax;
             $data['tax_rate'] = $tax_rate;
             $data['total_tax_rate'] = $total_tax_rate;
         }
         return $data;
     }
     return false;
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:56,代码来源:class.mslib_fe.php


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