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


PHP fn_get_state_name函数代码示例

本文整理汇总了PHP中fn_get_state_name函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_state_name函数的具体用法?PHP fn_get_state_name怎么用?PHP fn_get_state_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: fn_qwintry_create_shipment

function fn_qwintry_create_shipment($order_info, $qwintry_data = array())
{
    $shipping = fn_qwintry_find_qwintry_shipping($order_info);
    if (empty($shipping)) {
        return false;
    }
    $shipping_settings = fn_get_shipping_params($shipping['shipping_id']);
    $package_info = fn_qwintry_get_package_from_order_info($order_info);
    $dimensions = fn_qwintry_get_biggest_package($package_info);
    $invoice = fn_qwintry_save_order_invoice($order_info['order_id']);
    if (!$dimensions) {
        $dimensions = $shipping_settings['dimensions'];
    }
    $weight_data = fn_expand_weight($package_info['W']);
    $pounds = $weight_data['pounds'];
    if (!empty($qwintry_data['box_length']) && !empty($qwintry_data['box_width']) && !empty($qwintry_data['box_height'])) {
        $dimensions = $qwintry_data;
    }
    if (!empty($qwintry_data['box_weight'])) {
        $pounds = $qwintry_data['box_weight'];
    }
    $data = array('Shipment' => array('first_name' => $order_info['s_firstname'], 'last_name' => $order_info['s_lastname'], 'phone' => empty($order_info['s_phone']) ? $order_info['phone'] : $order_info['s_phone'], 'email' => $order_info['email'], 'customer_notes' => $order_info['notes'], 'weight' => $pounds > 0.1 ? $pounds : (empty($shipping_settings['default_weight']) ? 4 : $shipping_settings['default_weight']), 'dimensions' => $dimensions['box_length'] . 'x' . $dimensions['box_width'] . 'x' . $dimensions['box_height'], 'insurance' => false, 'external_id' => $order_info['order_id'], 'hub_code' => empty($shipping_settings['hub']) ? 'DE1' : $shipping_settings['hub']), 'invoices' => array(0 => array('base64_data' => base64_encode(file_get_contents($invoice)), 'base64_extension' => 'pdf')));
    $data['Shipment']['addr_line1'] = $order_info['s_address'];
    $data['Shipment']['addr_line2'] = $order_info['s_address_2'];
    $data['Shipment']['addr_zip'] = $order_info['s_zipcode'];
    $data['Shipment']['addr_state'] = fn_get_state_name($order_info['s_state'], $order_info['s_country']);
    $data['Shipment']['addr_city'] = $order_info['s_city'];
    $data['Shipment']['addr_country'] = $order_info['s_country'];
    if (empty($shipping['extra']['type']) || $shipping['extra']['type'] == 'courier') {
        $data['Shipment']['delivery_type'] = 'courier';
    } elseif ($shipping['extra']['type'] == 'pickup' && !empty($shipping['extra']['point'])) {
        $data['Shipment']['delivery_type'] = 'pickup';
        $data['Shipment']['delivery_pickup'] = $shipping['extra']['point'];
    }
    if ($shipping_settings['mode'] == 'test') {
        $data['Shipment']['test'] = true;
    }
    $cart = fn_qwintry_fn_form_cart($order_info);
    foreach ($cart['products'] as $product) {
        $rus_name = fn_get_product_name($product['product_id'], 'RU');
        $data['items'][] = array('descr' => $product['product'], 'descr_ru' => empty($rus_name) ? $product['product'] : $rus_name, 'count' => $product['amount'], 'line_value' => fn_qwintry_get_price($product['price']), 'line_weight' => empty($product['weight']) ? 0.1 : $product['weight'], 'link' => fn_url('products.view&product_id=' . $product['product_id'], 'C'));
    }
    $result = fn_qwintry_send_api_request('package-create', $data, $shipping_settings);
    if (!$result || empty($result->success) || !$result->success || empty($result->result->tracking)) {
        if (empty($result->errorMessage)) {
            return false;
        }
        return array('[error]' => (string) $result->errorMessage);
    }
    $shipment_data = array('order_id' => $order_info['order_id'], 'shipping_id' => $shipping['shipping_id'], 'tracking_number' => $result->result->tracking);
    fn_qwintry_update_shipment($shipment_data, 0, 0, true);
    if (fn_qwintry_save_label($order_info['order_id'] . '.pdf', $result->result->tracking, $shipping_settings) !== false) {
        return true;
    }
    return false;
}
开发者ID:qwintry,项目名称:logistics-cscart,代码行数:56,代码来源:func.php

示例2: fn_get_company_placement_info

/**
 * Function returns address of company and emails of company' departments.
 *
 * @param integer $company_id ID of company
 * @param string $lang_code Language of retrieving data. If null, lang_code of company will be used.
 * @return array Company address, emails and lang_code.
 */
function fn_get_company_placement_info($company_id, $lang_code = null)
{
    $default_company_placement_info = Registry::get('settings.Company');
    if (empty($company_id)) {
        $company_placement_info = $default_company_placement_info;
        $company_placement_info['lang_code'] = !empty($lang_code) ? $lang_code : CART_LANGUAGE;
    } else {
        $company = fn_get_company_data($company_id, !empty($lang_code) ? $lang_code : CART_LANGUAGE);
        if (fn_allowed_for('ULTIMATE')) {
            $company_placement_info = Settings::instance()->getValues('Company', Settings::CORE_SECTION, true, $company_id);
            $default_company_placement_info = $company_placement_info;
            $company_placement_info['lang_code'] = $company['lang_code'];
        } else {
            $company_placement_info = array('company_name' => $company['company'], 'company_address' => $company['address'], 'company_city' => $company['city'], 'company_country' => $company['country'], 'company_state' => $company['state'], 'company_zipcode' => $company['zipcode'], 'company_phone' => $company['phone'], 'company_phone_2' => '', 'company_fax' => $company['fax'], 'company_website' => $company['url'], 'company_users_department' => $company['email'], 'company_site_administrator' => $company['email'], 'company_orders_department' => $company['email'], 'company_support_department' => $company['email'], 'company_newsletter_email' => $company['email'], 'lang_code' => $company['lang_code']);
        }
    }
    foreach ($default_company_placement_info as $k => $v) {
        $company_placement_info['default_' . $k] = $v;
    }
    $lang_code = !empty($lang_code) ? $lang_code : $company_placement_info['lang_code'];
    $company_placement_info['company_country_descr'] = fn_get_country_name($company_placement_info['company_country'], $lang_code);
    $company_placement_info['company_state_descr'] = fn_get_state_name($company_placement_info['company_state'], $company_placement_info['company_country'], $lang_code);
    return $company_placement_info;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:fn.companies.php

示例3: substr

         $_ph_a = '61';
         $_ph_b = substr($_phone, 2);
     } else {
         $_ph_a = '61';
         $_ph_b = $_phone;
     }
 } else {
     $_ph_a = substr($_phone, 0, 3);
     $_ph_b = substr($_phone, 3);
 }
 // US states
 if ($order_info['b_country'] == 'US') {
     $_b_state = $order_info['b_state'];
     // all other states
 } else {
     $_b_state = fn_get_state_name($order_info['b_state'], $order_info['b_country']);
 }
 $return_url = fn_url("payment_notification.return?payment=paypal&order_id={$order_id}", AREA, 'current');
 $cancel_url = fn_url("payment_notification.cancel?payment=paypal&order_id={$order_id}", AREA, 'current');
 $notify_url = fn_url("payment_notification.notify?payment=paypal&order_id={$order_id}", AREA, 'current');
 $post_data = array('charset' => 'utf-8', 'cmd' => '_cart', 'custom' => $order_id, 'invoice' => $paypal_order_id, 'redirect_cmd' => '_xclick', 'rm' => 2, 'email' => $order_info['email'], 'first_name' => $order_info['b_firstname'], 'last_name' => $order_info['b_lastname'], 'address1' => $order_info['b_address'], 'address2' => $order_info['b_address_2'], 'country' => $order_info['b_country'], 'city' => $order_info['b_city'], 'state' => $_b_state, 'zip' => $order_info['b_zipcode'], 'day_phone_a' => $_ph_a, 'day_phone_b' => $_ph_b, 'day_phone_c' => $_ph_c, 'night_phone_a' => $_ph_a, 'night_phone_b' => $_ph_b, 'night_phone_c' => $_ph_c, 'business' => $paypal_account, 'item_name' => $paypal_item_name, 'amount' => $paypal_total, 'upload' => '1', 'handling_cart' => $paypal_shipping, 'currency_code' => $paypal_currency, 'return' => $return_url, 'cancel_return' => $cancel_url, 'notify_url' => $notify_url, 'bn' => 'ST_ShoppingCart_Upload_US');
 $i = 1;
 // Products
 if (empty($order_info['use_gift_certificates']) && !floatval($order_info['subtotal_discount']) && empty($order_info['points_info']['in_use']) && count($order_info['products']) < MAX_PAYPAL_PRODUCTS) {
     if (!empty($order_info['products'])) {
         foreach ($order_info['products'] as $k => $v) {
             $suffix = '_' . $i++;
             $v['product'] = htmlspecialchars(strip_tags($v['product']));
             $v['price'] = fn_format_price(($v['subtotal'] - fn_external_discounts($v)) / $v['amount'], $paypal_currency);
             $post_data["item_name{$suffix}"] = $v['product'];
             $post_data["amount{$suffix}"] = $v['price'];
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:paypal.php

示例4: _getDestinationCode

 /**
  * Gets numeric representation of Country/Region/City
  *
  * @param  array $destination Country, Region, City of geographic place
  * @return int   Numeric representation
  */
 private function _getDestinationCode($destination)
 {
     $cities = fn_get_schema('edost', 'cities');
     $regions = fn_get_schema('edost', 'regions');
     $countries = fn_get_schema('edost', 'countries');
     $origination = $this->_shipping_info['package_info']['origination']['country'];
     $result = '';
     if ($destination['country'] != 'RU' || $origination != 'RU') {
         $result = !empty($countries[$destination['country']]) ? $countries[$destination['country']] : '';
     } else {
         if (Registry::get('addons.rus_cities.status') == 'A') {
             if (preg_match('/^[a-zA-Z]+$/', $destination['city'])) {
                 $lang_code = 'en';
             } else {
                 $lang_code = 'ru';
             }
             $condition = db_quote(" d.lang_code = ?s AND d.city = ?s AND c.status = ?s", $lang_code, $destination['city'], 'A');
             if (!empty($destination['state'])) {
                 $condition .= db_quote(" AND c.state_code = ?s", $destination['state']);
             }
             if (!empty($destination['country'])) {
                 $condition .= db_quote(" AND c.country_code = ?s", $destination['country']);
             }
             $result = db_get_field("SELECT c.city_code FROM ?:rus_city_descriptions as d LEFT JOIN ?:rus_cities as c ON c.city_id = d.city_id WHERE ?p", $condition);
         }
         if (empty($result)) {
             $result = !empty($cities[$destination['city']]) ? $cities[$destination['city']] : '';
             if ($result == '') {
                 $alt_city = $destination['city'] . ' (' . fn_get_state_name($destination['state'], $destination['country'], 'RU') . ')';
                 if (!empty($cities[$alt_city])) {
                     $result = $cities[$alt_city];
                 }
             }
             if ($result == '') {
                 $result = !empty($regions[$destination['state']]) ? $regions[$destination['state']] : '';
             }
         }
     }
     return $result;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:46,代码来源:Edost.php

示例5: fn_pickpoint_cost_by_shipment

function fn_pickpoint_cost_by_shipment(&$cart, $shipping_info, $service_data, $city)
{
    if (!empty($service_data['module']) && $service_data['module'] == 'pickpoint') {
        $data = array();
        $pickpoint_info = Registry::get('addons.rus_pickpoint');
        $url = RusPickpoint::Url();
        $data_url = RusPickpoint::$data_url;
        $login = RusPickpoint::Login();
        $total = $weight = 0;
        $goods = array();
        $length = $width = $height = 20;
        if ($login) {
            $shipping_settings = $service_data['service_params'];
            $weight_data = fn_expand_weight($shipping_info['package_info']['W']);
            $weight = round($weight_data['plain'] * Registry::get('settings.General.weight_symbol_grams') / 1000, 3);
            $packages = !empty($shipping_info['package_info']['packages']) ? $shipping_info['package_info']['packages'] : array();
            $origination = !empty($shipping_info['package_info']['origination']) ? $shipping_info['package_info']['origination'] : '';
            $from_state = fn_get_state_name($origination['state'], $origination['country'], 'RU');
            $length = !empty($shipping_settings['pickpoint_length']) ? $shipping_settings['pickpoint_length'] : 10;
            $width = !empty($shipping_settings['pickpoint_width']) ? $shipping_settings['pickpoint_width'] : 10;
            $height = !empty($shipping_settings['pickpoint_height']) ? $shipping_settings['pickpoint_height'] : 10;
            if (!empty($shipping_info['package_info']['packages'])) {
                $packages = $shipping_info['package_info']['packages'];
                $packages_count = count($packages);
                $pickpoint_weight = $pickpoint_length = $pickpoint_width = $pickpoint_height = 0;
                if ($packages_count > 0) {
                    foreach ($packages as $id => $package) {
                        $package_length = empty($package['shipping_params']['box_length']) ? $length : $package['shipping_params']['box_length'];
                        $package_width = empty($package['shipping_params']['box_width']) ? $width : $package['shipping_params']['box_width'];
                        $package_height = empty($package['shipping_params']['box_height']) ? $height : $package['shipping_params']['box_height'];
                        $weight_ar = fn_expand_weight($package['weight']);
                        $package_weight = round($weight_ar['plain'] * Registry::get('settings.General.weight_symbol_grams') / 1000, 3);
                        $pickpoint_weight = $pickpoint_weight + $package_weight;
                        $pickpoint_length = $pickpoint_length + $package_length;
                        $pickpoint_width = $pickpoint_width + $package_width;
                        $pickpoint_height = $pickpoint_height + $package_height;
                    }
                    $length = $pickpoint_length;
                    $width = $pickpoint_width;
                    $height = $pickpoint_height;
                    $weight = $pickpoint_weight;
                }
            } else {
                $packages_count = 1;
                $weight = round($weight_data['plain'] * Registry::get('settings.General.weight_symbol_grams') / 1000, 3);
            }
            $sid = RusPickpoint::$sid;
            $data_zone = array('SessionId' => $sid, 'FromCity' => $origination['city']);
            $url_zone = $url . 'getzone';
            $pickpoint_id = '';
            $address_pickpoint = RusPickpoint::findPostamatPickpoint($pickpoint_id, $city);
            $data_zone['ToPT'] = $pickpoint_id;
            $pickpoint_zone = RusPickpoint::zonesPickpoint($url_zone, $data_zone, $data_url);
            if (!empty($pickpoint_zone)) {
                $pickpoint_id = !empty($pickpoint_zone['to_pt']) ? $pickpoint_zone['to_pt'] : '';
                if ($pickpoint_zone['delivery_min'] == $pickpoint_zone['delivery_max']) {
                    $date_zone = $pickpoint_zone['delivery_max'] . ' ' . __('days');
                } else {
                    $date_zone = $pickpoint_zone['delivery_min'] . '-' . $pickpoint_zone['delivery_max'] . ' ' . __('days');
                }
            }
            if (!empty($pickpoint_id) && !empty($address_pickpoint)) {
                if (!empty($shipping_info['keys']['group_key']) && !empty($shipping_info['keys']['shipping_id'])) {
                    $group_key = $shipping_info['keys']['group_key'];
                    $shipping_id = $shipping_info['keys']['shipping_id'];
                    $cart['pickpoint_office'][$group_key][$shipping_id]['pickpoint_id'] = $pickpoint_id;
                    $cart['pickpoint_office'][$group_key][$shipping_id]['address_pickpoint'] = $address_pickpoint;
                } elseif (!empty($shipping_info['shippings'])) {
                    foreach ($shipping_info['shippings'] as $shipping) {
                        if ($shipping['module'] == 'pickpoint') {
                            $group_key = $shipping['group_key'];
                            $shipping_id = $shipping['shipping_id'];
                            $cart['pickpoint_office'][$group_key][$shipping_id]['pickpoint_id'] = $pickpoint_id;
                            $cart['pickpoint_office'][$group_key][$shipping_id]['address_pickpoint'] = $address_pickpoint;
                        }
                    }
                }
            }
            $data = array('SessionId' => $sid, 'IKN' => $pickpoint_info['ikn'], 'FromCity' => $origination['city'], 'FromRegion' => $from_state, 'PTNumber' => $pickpoint_id, 'EncloseCount' => $packages_count, 'Length' => $length, 'Depth' => $height, 'Width' => $width, 'Weight' => $weight);
            $response = Http::post($url . 'calctariff', json_encode($data), $data_url);
            $result = json_decode($response);
            $data_services = json_decode(json_encode($result), true);
            $cost = 0;
            if (isset($data_services['Error']) && $data_services['Error'] == 1 && !empty($data_services['ErrorMessage'])) {
                fn_set_notification('E', __('notice'), $data_services['ErrorMessage']);
            } elseif (isset($data_services['Error']) && !empty($data_services['Error'])) {
                fn_set_notification('E', __('notice'), $data_services['Error']);
            } elseif (isset($data_services['Services'])) {
                $shipment = array_shift($data_services['Services']);
                $cost = $shipment['Tariff'] + $shipment['NDS'];
            }
            foreach ($cart['shipping'] as &$shipping) {
                if ($shipping['module'] == 'pickpoint') {
                    $shipping['rate'] = $cost;
                    $shipping['delivery_time'] = $date_zone;
                }
            }
            RusPickpoint::Logout();
        } else {
            fn_set_notification('E', __('notice'), RusPickpoint::$last_error);
//.........这里部分代码省略.........
开发者ID:ambient-lounge,项目名称:site,代码行数:101,代码来源:func.php

示例6: fn_add_user_data_descriptions

function fn_add_user_data_descriptions(&$user_data, $lang_code = CART_LANGUAGE)
{
    fn_fill_user_fields($user_data);
    // Replace titles ids with their descriptions
    $_titles = fn_get_static_data_section('T', false);
    $titles = array();
    foreach ($_titles as $val) {
        $titles[$val['param']] = $val;
    }
    if (!empty($user_data['title'])) {
        $user_data['title_descr'] = !empty($titles[$user_data['title']]['descr']) ? $titles[$user_data['title']]['descr'] : $user_data['title'];
    }
    if (!empty($user_data['b_title'])) {
        $user_data['b_title_descr'] = !empty($titles[$user_data['b_title']]['descr']) ? $titles[$user_data['b_title']]['descr'] : $user_data['b_title'];
    }
    if (!empty($user_data['s_title'])) {
        $user_data['s_title_descr'] = !empty($titles[$user_data['s_title']]['descr']) ? $titles[$user_data['s_title']]['descr'] : $user_data['s_title'];
    }
    // Replace country and state values with their descriptions
    if (!empty($user_data['b_country'])) {
        $user_data['b_country_descr'] = fn_get_country_name($user_data['b_country'], $lang_code);
    }
    if (!empty($user_data['s_country'])) {
        $user_data['s_country_descr'] = fn_get_country_name($user_data['s_country'], $lang_code);
    }
    if (!empty($user_data['b_state'])) {
        $user_data['b_state_descr'] = fn_get_state_name($user_data['b_state'], $user_data['b_country'], $lang_code);
        if (empty($user_data['b_state_descr'])) {
            $user_data['b_state_descr'] = $user_data['b_state'];
        }
    }
    if (!empty($user_data['s_state'])) {
        $user_data['s_state_descr'] = fn_get_state_name($user_data['s_state'], $user_data['s_country'], $lang_code);
        if (empty($user_data['s_state_descr'])) {
            $user_data['s_state_descr'] = $user_data['s_state'];
        }
    }
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:38,代码来源:fn.users.php

示例7: fn_add_user_data_descriptions

function fn_add_user_data_descriptions(&$user_data, $lang_code = CART_LANGUAGE)
{
    fn_fill_user_fields($user_data);
    // Replace country and state values with their descriptions
    if (!empty($user_data['b_country'])) {
        $user_data['b_country_descr'] = fn_get_country_name($user_data['b_country'], $lang_code);
    }
    if (!empty($user_data['s_country'])) {
        $user_data['s_country_descr'] = fn_get_country_name($user_data['s_country'], $lang_code);
    }
    if (!empty($user_data['b_state'])) {
        $user_data['b_state_descr'] = fn_get_state_name($user_data['b_state'], $user_data['b_country'], $lang_code);
        if (empty($user_data['b_state_descr'])) {
            $user_data['b_state_descr'] = $user_data['b_state'];
        }
    }
    if (!empty($user_data['s_state'])) {
        $user_data['s_state_descr'] = fn_get_state_name($user_data['s_state'], $user_data['s_country'], $lang_code);
        if (empty($user_data['s_state_descr'])) {
            $user_data['s_state_descr'] = $user_data['s_state'];
        }
    }
}
开发者ID:askzap,项目名称:ultimate,代码行数:23,代码来源:fn.users.php

示例8: getRequestData

 /**
  * Prepare request information
  *
  * @return array Prepared data
  */
 public function getRequestData()
 {
     $data_url = array('headers' => array('Content-Type: application/json'), 'timeout' => $this->_timeout);
     $weight_data = fn_expand_weight($this->_shipping_info['package_info']['W']);
     $shipping_settings = $this->_shipping_info['service_params'];
     $origination = $this->_shipping_info['package_info']['origination'];
     $location = $this->_shipping_info['package_info']['location'];
     $origin['country'] = fn_get_country_name($origination['country'], 'ru');
     $origin['region'] = fn_get_state_name($origination['state'], $origination['country'], 'RU');
     $origin['city'] = $origination['city'];
     $destination['country'] = fn_get_country_name($location['country'], 'ru');
     $destination['region'] = fn_get_state_name($location['state'], $location['country'], 'RU');
     $destination['city'] = $location['city'];
     $international = false;
     if ($origination['country'] != 'RU' || $location['country'] != 'RU') {
         $international = true;
     }
     $country_code = db_get_field("SELECT code_N3 FROM ?:countries WHERE code = ?s", $location['country']);
     if (empty($location['zipcode'])) {
         $this->_internalError(__('russian_post_empty_zipcode'));
         $location['zipcode'] = false;
     }
     $ruble = Registry::get('currencies.RUB');
     if (empty($ruble) || $ruble['is_primary'] == 'N') {
         $this->_internalError(__('russian_post_activation_error'));
     }
     $weight = $weight_data['plain'] * Registry::get('settings.General.weight_symbol_grams');
     $total_cost = $this->_shipping_info['package_info']['C'];
     if (CART_PRIMARY_CURRENCY != 'RUB') {
         $total_cost = fn_rus_russianpost_format_price($total_cost, 'RUB');
     }
     $insurance = $shipping_settings['insurance'];
     $cash_sum = 0;
     if (!empty($shipping_settings['cash_on_delivery'])) {
         $cash_sum = $total_cost * $shipping_settings['cash_on_delivery'] / 100;
     }
     $insurance_sum = 0;
     if (!empty($insurance) || !empty($cash_sum)) {
         if ($total_cost > $cash_sum) {
             $insurance_sum = $total_cost;
         } else {
             $insurance_sum = $cash_sum;
         }
     }
     $is_wayforward = false;
     if ($shipping_settings['shipping_option'] != 'AVIA') {
         $is_wayforward = true;
     }
     $mailing = array('postingType' => 'VPO', 'postingCategory' => 'SIMPLE', 'weight' => $weight, 'zipCodeFrom' => $origination['zipcode'], 'zipCodeTo' => $location['zipcode'], 'postingKind' => 'POST_CARD');
     if ($international) {
         $mailing['postingType'] = 'MPO';
     }
     if ($shipping_settings['delivery_notice']) {
         $mailing['notificationOfDeliveryRpo'] = $shipping_settings['delivery_notice'];
     }
     if ($shipping_settings['inventory']) {
         $mailing['inventory'] = true;
     }
     if ($shipping_settings['careful']) {
         $mailing['careful'] = true;
     }
     $main_type = 'banderol';
     if ($shipping_settings['shipping_option'] == 'EMS') {
         $main_type = 'ems';
     } elseif ($shipping_settings['sending_type'] != 'papers' || $weight > 2000) {
         if ($weight < 10000) {
             $main_type = 'standardParcel';
         } elseif ($weight >= 10000 && $weight < 20000) {
             $main_type = 'heavyParcel';
         } elseif ($weight >= 20000) {
             $main_type = 'bigHeavyParcel';
         }
     }
     if ($main_type == 'banderol') {
         $mailing['postingKind'] = "BANDEROLE";
         $mailing['postingCategory'] = "ORDERED";
         $mailing['wayForward'] = "EARTH";
     } elseif ($main_type == 'standardParcel' || $main_type == 'heavyParcel' || $main_type == 'bigHeavyParcel') {
         $mailing['postingKind'] = "PARCEL";
         $mailing['postingCategory'] = "ORDINARY";
         $mailing['wayForward'] = "EARTH";
         if (!$is_wayforward) {
             $mailing['wayForward'] = "AVIA";
         }
         if ($main_type == 'standardParcel') {
             $mailing['parcelKind'] = "STANDARD";
         }
         if ($main_type == 'heavyParcel') {
             $mailing['parcelKind'] = "HEAVY";
         }
         if ($main_type == 'bigHeavyParcel') {
             $mailing['parcelKind'] = "HEAVY_LARGE_SIZED";
         }
     } elseif ($main_type == 'ems') {
         $mailing['postingKind'] = "EMS";
//.........这里部分代码省略.........
开发者ID:ambient-lounge,项目名称:site,代码行数:101,代码来源:RussianPostPochta.php

示例9: elseif

    if (!empty($order_info['lastname'])) {
        $lastname = $order_info['lastname'];
    } elseif (!empty($order_info['b_lastname'])) {
        $lastname = $order_info['b_lastname'];
    } elseif (!empty($order_info['s_lastname'])) {
        $lastname = $order_info['s_lastname'];
    }
    if (!empty($order_info['firstname'])) {
        $firstname = $order_info['firstname'];
    } elseif (!empty($order_info['b_firstname'])) {
        $firstname = $order_info['b_firstname'];
    } elseif (!empty($order_info['s_firstname'])) {
        $firstname = $order_info['s_firstname'];
    }
    $order_info['fio'] = $lastname . ' ' . $firstname;
    $order_info['state_name'] = fn_get_state_name($order_info['s_state'], $order_info['s_country'], DESCR_SL);
    $order_info['country_name'] = fn_get_country_name($order_info['s_country'], DESCR_SL);
    $order_info['address_line_2'] = $order_info['country_name'] . ', ' . $order_info['state_name'] . ', ' . $order_info['s_city'];
    if (!empty($order_info['phone'])) {
        $order_info['recipient_phone'] = fn_rus_russianpost_normalize_phone($order_info['phone']);
    } elseif (!empty($order_info['b_phone'])) {
        $order_info['recipient_phone'] = fn_rus_russianpost_normalize_phone($order_info['b_phone']);
    } elseif (!empty($order_info['s_phone'])) {
        $order_info['recipient_phone'] = fn_rus_russianpost_normalize_phone($order_info['s_phone']);
    }
    Tygh::$app['view']->assign('pre_total', $total);
    Tygh::$app['view']->assign('order_info', $order_info);
    $pre_data = Registry::get('addons.rus_russianpost');
    $pre_data['company_phone'] = fn_rus_russianpost_normalize_phone($pre_data['company_phone']);
    Tygh::$app['view']->assign('pre_data', $pre_data);
}
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:rus_post_blank.php

示例10: fn_init_revisions

    fn_init_revisions();
}
// select the skin to display
fn_init_skin($_REQUEST);
// initialize templater
fn_init_templater();
// Second-level (b) cache: different for dispatch-language-currency
define('CACHE_LEVEL_DISPATCH', AREA . '_' . $_SERVER['REQUEST_METHOD'] . '_' . str_replace('.', '_', $_REQUEST['dispatch']) . '_' . (defined('CART_LOCALIZATION') ? CART_LOCALIZATION . '_' : '') . CART_LANGUAGE . '_' . CART_SECONDARY_CURRENCY);
Registry::register_cache('lang_cache', array('language_values'), CACHE_LEVEL_DISPATCH, true);
if (!defined('NO_SESSION')) {
    // Get descriptions for company country and state
    if (Registry::get('settings.Company.company_country')) {
        Registry::set('settings.Company.company_country_descr', fn_get_country_name(Registry::get('settings.Company.company_country')));
    }
    if (Registry::get('settings.Company.company_state')) {
        Registry::set('settings.Company.company_state_descr', fn_get_state_name(Registry::get('settings.Company.company_state'), Registry::get('settings.Company.company_country')));
    }
    // Unset notification message by its id
    if (!empty($_REQUEST['close_notification'])) {
        unset($_SESSION['notifications'][$_REQUEST['close_notification']]);
        exit;
    }
}
// Include user information
fn_init_user();
// Third-level (a) cache: different for dispatch-user-language-currency
define('CACHE_LEVEL_USER', AREA . '_' . $_SERVER['REQUEST_METHOD'] . '_' . str_replace('.', '_', $_REQUEST['dispatch']) . '.' . (!empty($_SESSION['auth']['usergroup_ids']) ? implode('_', $_SESSION['auth']['usergroup_ids']) : '') . '.' . (defined('CART_LOCALIZATION') ? CART_LOCALIZATION . '_' : '') . CART_LANGUAGE . '.' . CART_SECONDARY_CURRENCY);
// Third-level (b) cache: different for user(logged in/not)-usergroup-language-currency
define('CACHE_LEVEL_LOCALE_AUTH', AREA . '_' . $_SERVER['REQUEST_METHOD'] . '_' . (!empty($_SESSION['auth']['user_id']) ? 1 : 0) . '.' . (!empty($_SESSION['auth']['usergroup_ids']) ? implode('_', $_SESSION['auth']['usergroup_ids']) : '') . (defined('CART_LOCALIZATION') ? CART_LOCALIZATION . '_' : '') . CART_LANGUAGE . '.' . CART_SECONDARY_CURRENCY);
// Set timezone
date_default_timezone_set(Registry::get('settings.Appearance.timezone'));
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:init.php

示例11: getRequestData

 /**
  * Prepare request information
  *
  * @return array Prepared data
  */
 public function getRequestData()
 {
     $weight_data = fn_expand_weight($this->_shipping_info['package_info']['W']);
     $package_cost = $this->_shipping_info['package_info']['C'];
     $shipping_settings = $this->_shipping_info['service_params'];
     $pounds = $weight_data['pounds'];
     $location = $this->_shipping_info['package_info']['location'];
     $type = $this->_get_type();
     $currencies = array_keys(fn_get_currencies());
     if (in_array('USD', $currencies)) {
         $package_cost = fn_format_price_by_currency($package_cost, CART_PRIMARY_CURRENCY, 'USD');
     } elseif (CART_PRIMARY_CURRENCY == 'EUR') {
         $package_cost = $package_cost * 1.097;
     } elseif (CART_PRIMARY_CURRENCY == 'RMB') {
         $package_cost = $package_cost * 1.157;
     }
     if ($type == 'courier') {
         $data = array('params' => array('method' => 'qwair', 'hub_code' => empty($shipping_settings['hub']) ? 'DE1' : $shipping_settings['hub'], 'insurance' => false, 'retail_pricing' => false, 'weight' => $pounds > 0.1 ? $pounds : (empty($shipping_settings['default_weight']) ? 4 : $shipping_settings['default_weight']), 'items_value' => $package_cost, 'addr_country' => $location['country'], 'addr_zip' => $location['zipcode'], 'addr_line1' => $location['address'], 'addr_line2' => empty($location['address_2']) ? '' : $location['address_2'], 'addr_city' => $location['city'], 'addr_state' => fn_get_state_name($location['state'], $location['country'])));
     } elseif ($type == 'pickup') {
         $data = array('params' => array('insurance' => false, 'retail_pricing' => false, 'weight' => $pounds > 0.1 ? $pounds : (empty($shipping_settings['default_weight']) ? 4 : $shipping_settings['default_weight']), 'items_value' => $package_cost, 'delivery_pickup' => $this->_get_pickup_point()));
     }
     $request_data = array('method' => 'get', 'url' => 'cost', 'data' => $data);
     return $request_data;
 }
开发者ID:qwintry,项目名称:logistics-cscart,代码行数:29,代码来源:Qwintry.php

示例12: array

    $redirect_url = "cities.manage?country_code={$params['country_code']}";
    if (!empty($params['state_code'])) {
        $redirect_url .= "&state_code={$params['state_code']}";
    }
    return array(CONTROLLER_STATUS_OK, $redirect_url);
}
if ($mode == 'manage') {
    if (empty($_REQUEST['country_code'])) {
        $params['country_code'] = Registry::get('settings.General.default_country');
    }
    list($cities, $search) = fn_get_cities($params, Registry::get('settings.Appearance.admin_elements_per_page'), DESCR_SL);
    $states = fn_get_all_states();
    $countries = fn_get_simple_countries(false, DESCR_SL);
    if (!empty($cities)) {
        foreach ($cities as $key => $city) {
            $cities[$key]['state_name'] = fn_get_state_name($city['state_code'], $city['country_code'], DESCR_SL);
            $cities[$key]['country_name'] = $countries[$city['country_code']];
        }
    }
    Tygh::$app['view']->assign('countries', $countries);
    Tygh::$app['view']->assign('states', $states);
    Tygh::$app['view']->assign('cities', $cities);
    Tygh::$app['view']->assign('search', $search);
}
function fn_update_city($city_data, $city_id = 0, $lang_code = DESCR_SL)
{
    if (empty($city_id)) {
        if (!empty($city_data['city']) && !empty($city_data['city_code'])) {
            $city_data['city_id'] = $city_id = db_query("REPLACE INTO ?:rus_cities ?e", $city_data);
            foreach (fn_get_translation_languages() as $city_data['lang_code'] => $_v) {
                db_query('REPLACE INTO ?:rus_city_descriptions ?e', $city_data);
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:cities.php

示例13: _getCityID

 public function _getCityID($type)
 {
     if ($type == 'from') {
         $destination = $this->_shipping_info['package_info']['origination'];
     } elseif ($type == 'to') {
         $destination = $this->_shipping_info['package_info']['location'];
     }
     $cities_simple = fn_get_schema('pecom', 'cities_simple');
     if (!empty($cities_simple[$destination['city']])) {
         $city_code = $cities_simple[$destination['city']];
     }
     if (empty($city_code)) {
         $cities_full = fn_get_schema('pecom', 'cities_full');
         $alt_city = $destination['city'] . ' (' . fn_get_state_name($destination['state'], $destination['country'], 'RU') . ')';
         if (isset($cities_full[$alt_city])) {
             $city_code = $cities_full[$alt_city];
         } elseif (isset($cities_full[$destination['city']])) {
             $city_code = $cities_full[$destination['city']];
         } else {
             $city_code = false;
             $this->_internalError(__('rus_pecom.not_city_code'));
         }
     }
     return $city_code;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:25,代码来源:Pecom.php

示例14: die

use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
$cart =& $_SESSION['cart'];
$params = $_REQUEST;
if ($mode == 'update_steps' || $mode == 'shipping_estimation') {
    $city = $fromcity = '';
    $shipping_ids = !empty($params['shipping_ids']) ? $params['shipping_ids'] : array();
    $cities = fn_get_schema('pickpoint', 'cities', 'php', true);
    if (!empty($params['to_state'])) {
        $fromcity = fn_get_state_name($params['to_state'], $params['country'], 'RU');
        $pickpoint_cities = $cities[$params['to_state']];
        $city = key($pickpoint_cities);
    } elseif (!empty($params['customer_location'])) {
        $fromcity = fn_get_state_name($params['customer_location']['state'], $params['customer_location']['country'], 'RU');
        if (!empty($params['customer_location']['city'])) {
            $city = $params['customer_location']['city'];
        } else {
            $pickpoint_cities = $cities[$params['customer_location']['state']];
            $city = key($pickpoint_cities);
        }
    }
    if (!empty($params['pickpoint_office'])) {
        foreach ($params['pickpoint_office'] as $g_id => $select) {
            foreach ($select as $s_id => $o_id) {
                $cart['pickpoint_office'][$g_id][$s_id] = $o_id;
            }
        }
    } elseif (!empty($params['pickpoint_id']) && !empty($params['address_pickpoint']) && !empty($shipping_ids)) {
        foreach ($shipping_ids as $group_key => $shipping_id) {
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:checkout.pre.php

示例15: fn_get_gift_certificate_info

function fn_get_gift_certificate_info($certificate, $type = 'B', $stored_products = array(), $lang_code = CART_LANGUAGE)
{
    if ($type == 'B' && is_numeric($certificate)) {
        $_certificate = db_get_row("SELECT * FROM ?:gift_certificates WHERE gift_cert_id = ?i", $certificate);
    } elseif ($type == 'C' && is_numeric($certificate)) {
        $_certificate = fn_array_merge($_SESSION['cart']['gift_certificates'][$certificate], array('gift_cert_cart_id' => $certificate));
    } elseif ($type == 'P' && is_array($certificate)) {
        $_certificate = $certificate;
        if (empty($_certificate['gift_cert_code'])) {
            $_certificate['gift_cert_code'] = preg_replace('/[0-9A-Z]/', 'X', fn_generate_gift_certificate_code());
        }
    }
    fn_set_hook('get_gift_certificate_info', $_certificate, $certificate, $type);
    if (!empty($_certificate)) {
        //Prepare descriptions
        if (!empty($_certificate['state'])) {
            $_descr_state = fn_get_state_name($_certificate['state'], $_certificate['country'], $lang_code);
            $_certificate['descr_state'] = empty($_descr_state) ? $_certificate['state'] : $_descr_state;
        }
        if (!empty($_certificate['country'])) {
            $_certificate['descr_country'] = fn_get_country_name($_certificate['country'], $lang_code);
        }
        if (!empty($_certificate['products'])) {
            if ($type == 'B') {
                $_certificate['products'] = @unserialize($_certificate['products']);
            }
            fn_fill_certificate_products($_certificate['products'], $stored_products, $lang_code);
        }
        if (!empty($_certificate['debit_products'])) {
            if ($type == 'B') {
                $_certificate['debit_products'] = @unserialize($_certificate['debit_products']);
            }
            fn_fill_certificate_products($_certificate['debit_products'], $stored_products, $lang_code);
        }
    }
    return $_certificate;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:37,代码来源:func.php


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