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


PHP zen_get_countries函数代码示例

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


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

示例1: zen_get_country_list

 function zen_get_country_list($name, $selected = '', $parameters = '')
 {
     $countriesAtTopOfList = array();
     $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
     $countries = zen_get_countries();
     // Set some default entries at top of list:
     if (STORE_COUNTRY != SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY) {
         $countriesAtTopOfList[] = SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
     }
     $countriesAtTopOfList[] = STORE_COUNTRY;
     // IF YOU WANT TO ADD MORE DEFAULTS TO THE TOP OF THIS LIST, SIMPLY ENTER THEIR NUMBERS HERE.
     // Duplicate more lines as needed
     // Example: Canada is 108, so use 108 as shown:
     //$countriesAtTopOfList[] = 108;
     //process array of top-of-list entries:
     foreach ($countriesAtTopOfList as $key => $val) {
         $countries_array[] = array('id' => $val, 'text' => zen_get_country_name($val));
     }
     // now add anything not in the defaults list:
     foreach ($countries as $country) {
         $alreadyInList = FALSE;
         foreach ($countriesAtTopOfList as $key => $val) {
             if ($country['id'] == $val) {
                 // If you don't want to exclude entries already at the top of the list, comment out this next line:
                 $alreadyInList = TRUE;
                 continue;
             }
         }
         if (!$alreadyInList) {
             $countries_array[] = $country;
         }
     }
     return zen_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
 }
开发者ID:bislewl,项目名称:super_edit_orders_with_ty,代码行数:34,代码来源:edit_orders_functions.php

示例2: __construct

 function __construct()
 {
     global $order, $customer_id;
     parent::__construct();
     @define('MODULE_SHIPPING_FEDEX_WEB_SERVICES_INSURE', 0);
     $this->code = "fedexwebservices";
     $this->title = tra('FedEx');
     $this->description = 'You will need to have registered an account with FedEx and proper approval from FedEx identity to use this module. Please see the README.TXT file for other requirements.';
     $this->icon = 'shipping_fedex';
     if (MODULE_SHIPPING_FEDEX_WEB_SERVICES_FREE_SHIPPING == 'true' || zen_get_shipping_enabled($this->code)) {
         $this->enabled = MODULE_SHIPPING_FEDEX_WEB_SERVICES_STATUS == 'true' ? true : false;
     }
     if (defined("SHIPPING_ORIGIN_COUNTRY")) {
         if ((int) SHIPPING_ORIGIN_COUNTRY > 0) {
             $countries_array = zen_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
             $this->country = $countries_array['countries_iso_code_2'];
         } else {
             $this->country = SHIPPING_ORIGIN_COUNTRY;
         }
     } else {
         $this->country = STORE_ORIGIN_COUNTRY;
     }
     if ($this->enabled == true && (int) MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE > 0) {
         $this->sort_order = MODULE_SHIPPING_FEDEX_WEB_SERVICES_SORT_ORDER;
         $this->tax_class = MODULE_SHIPPING_FEDEX_WEB_SERVICES_TAX_CLASS;
         $check_flag = false;
         $check = $this->mDb->query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FEDEX_WEB_SERVICES_ZONE . "' and zone_country_id = '" . $order->delivery['country']['countries_id'] . "' order by zone_id");
         while (!$check->EOF) {
             if ($check->fields['zone_id'] < 1) {
                 $check_flag = true;
                 break;
             } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                 $check_flag = true;
                 break;
             }
             $check->MoveNext();
         }
         if ($check_flag == false) {
             $this->enabled = false;
         }
     }
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:42,代码来源:fedexwebservices.php

示例3: getLanguageCode

 /**
  * Determine the language to use when redirecting to the PayPal site
  * Order of selection: locale for current language, current-language-code, delivery-country, billing-country, store-country
  */
 function getLanguageCode()
 {
     global $order, $locales;
     $allowed_country_codes = array('US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL', 'PT', 'BR', 'RU');
     $allowed_language_codes = array('da_DK', 'he_IL', 'id_ID', 'ja_JP', 'no_NO', 'pt_BR', 'ru_RU', 'sv_SE', 'th_TH', 'tr_TR', 'zh_CN', 'zh_HK', 'zh_TW');
     $lang_code = '';
     $user_locale_info = array();
     if (isset($locales) && is_array($locales)) {
         $user_locale_info = $locales;
     }
     $user_locale_info[] = strtoupper($_SESSION['languages_code']);
     $shippingISO = zen_get_countries($order->delivery['country']['id'], true);
     $user_locale_info[] = strtoupper($shippingISO['countries_iso_code_2']);
     $billingISO = zen_get_countries($order->billing['country']['id'], true);
     $user_locale_info[] = strtoupper($billingISO['countries_iso_code_2']);
     $custISO = zen_get_countries($order->customer['country']['id'], true);
     $user_locale_info[] = strtoupper($custISO['countries_iso_code_2']);
     $storeISO = zen_get_countries(STORE_COUNTRY, true);
     $user_locale_info[] = strtoupper($storeISO['countries_iso_code_2']);
     $to_match = array_map('strtoupper', array_merge($allowed_country_codes, $allowed_language_codes));
     foreach ($user_locale_info as $val) {
         if (in_array(strtoupper($val), $to_match)) {
             if (strtoupper($val) == 'EN' && isset($locales) && $locales[0] == 'en_GB') {
                 $val = 'GB';
             }
             if (strtoupper($val) == 'EN') {
                 $val = 'US';
             }
             return $val;
         }
     }
 }
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:36,代码来源:paypalwpp.php

示例4: amazon_process_order

function amazon_process_order($pAmazonOrderId)
{
    global $gAmazonMWS, $gBitUser, $gCommerceSystem, $gBitCustomer, $currencies, $order;
    $ret = NULL;
    $request = new MarketplaceWebServiceOrders_Model_GetOrderRequest();
    $request->setSellerId(MERCHANT_ID);
    // @TODO: set request. Action can be passed as MarketplaceWebServiceOrders_Model_GetOrderRequest
    // object or array of parameters
    // Set the list of AmazonOrderIds
    $orderIds = new MarketplaceWebServiceOrders_Model_OrderIdList();
    $orderIds->setId(array($pAmazonOrderId));
    $request->setAmazonOrderId($orderIds);
    $holdUser = $gBitUser;
    $azUser = new BitPermUser($holdUser->lookupHomepage($gCommerceSystem->getConfig('MODULE_PAYMENT_AMAZONMWS_LOCAL_USERNAME', 'amazonmws')));
    $azUser->load();
    $gBitUser = $azUser;
    $gBitCustomer = new CommerceCustomer($gBitUser->mUserId);
    $gBitCustomer->syncBitUser($gBitUser->mInfo);
    $_SESSION['customer_id'] = $gBitUser->mUserId;
    try {
        $response = $gAmazonMWS->getOrder($request);
        if ($response->isSetGetOrderResult()) {
            $getOrderResult = $response->getGetOrderResult();
            if ($getOrderResult->isSetOrders()) {
                $oldCwd = getcwd();
                chdir(BITCOMMERCE_PKG_PATH);
                $azOrderList = $getOrderResult->getOrders();
                if ($azOrders = $azOrderList->getOrder()) {
                    require_once BITCOMMERCE_PKG_PATH . 'classes/CommerceOrder.php';
                    $order = new order();
                    $order->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID, 'subtotal' => 0, 'tax' => 0, 'total' => 0, 'tax_groups' => array(), 'comments' => isset($_SESSION['comments']) ? $_SESSION['comments'] : '', 'ip_address' => $_SERVER['REMOTE_ADDR']);
                    $azOrder = current($azOrders);
                    // Setup delivery address
                    if ($orderTotal = $azOrder->getOrderTotal()) {
                        $order->info['total'] = $orderTotal->getAmount();
                        $order->info['currency'] = $orderTotal->getCurrencyCode();
                        $order->info['currency_value'] = $currencies->currencies[$order->info['currency']]['currency_value'];
                    }
                    if ($shippingAddress = $azOrder->getShippingAddress()) {
                        $country = zen_get_countries(zen_get_country_id($shippingAddress->getCountryCode()), TRUE);
                        $zoneName = zen_get_zone_name_by_code($country['countries_id'], $shippingAddress->getStateOrRegion());
                        $order->delivery = array('firstname' => substr($shippingAddress->getName(), 0, strpos($shippingAddress->getName(), ' ')), 'lastname' => substr($shippingAddress->getName(), strpos($shippingAddress->getName(), ' ') + 1), 'company' => NULL, 'street_address' => $shippingAddress->getAddressLine1(), 'suburb' => trim($shippingAddress->getAddressLine2() . ' ' . $shippingAddress->getAddressLine3()), 'city' => $shippingAddress->getCity(), 'postcode' => $shippingAddress->getPostalCode(), 'state' => $zoneName, 'country' => $country, 'format_id' => $country['address_format_id'], 'telephone' => $shippingAddress->getPhone(), 'email_address' => NULL);
                        $order->customer = $order->delivery;
                        $order->billing = $order->delivery;
                    }
                    // Setup shipping
                    $shipping = array('cost' => 0);
                    switch ($azOrder->getShipServiceLevel()) {
                        case 'Std US Dom':
                            $shipping['id'] = 'usps_MEDIA';
                            $shipping['title'] = 'United States Postal Service (USPS Media Mail (1 - 2 Weeks))';
                            $shipping['code'] = 'USPSREG';
                            break;
                    }
                    $azOrderItems = amazon_mws_get_order_items($azOrder->getAmazonOrderId());
                    $azOrderItem = $azOrderItems->getOrderItem();
                    foreach ($azOrderItem as $azi) {
                        $testSku = $azi->getSellerSKU();
                        list($productsId, $attrString) = explode(':', $testSku, 2);
                        $productsKey = $productsId . ':ASIN-' . $azi->getASIN();
                        $order->contents[$productsKey] = $gBitCustomer->mCart->getProductHash($productsKey);
                        $order->contents[$productsKey]['products_quantity'] = $azi->getQuantityOrdered();
                        $order->contents[$productsKey]['products_name'] = $azi->getTitle();
                        if ($itemPrice = $azi->getItemPrice()) {
                            //							{$itemTax->getCurrencyCode()}
                            $order->contents[$productsKey]['price'] = $itemPrice->getAmount();
                            $order->contents[$productsKey]['final_price'] = $itemPrice->getAmount();
                        }
                        if ($itemTax = $azi->getItemTax()) {
                            //							{$itemTax->getCurrencyCode()}
                            $order->contents[$productsKey]['tax'] = $itemTax->getAmount();
                        }
                        if ($shippingPrice = $azi->getShippingPrice()) {
                            //							{$itemTax->getCurrencyCode()}
                            $order->info['shipping_cost'] = $shippingPrice->getAmount();
                        }
                        if (empty($attrString)) {
                            $attrString = $gCommerceSystem->getConfig('MODULE_PAYMENT_AMAZONMWS_DEFAULT_ATTRIBUTES');
                        }
                        // stock up the attributes
                        if ($attrString && ($attrs = explode(',', $attrString))) {
                            foreach ($attrs as $optionValueId) {
                                $optionId = $order->mDb->getOne("SELECT cpa.`products_options_id` FROM " . TABLE_PRODUCTS_ATTRIBUTES . " cpa WHERE cpa.`products_options_values_id`=?", array($optionValueId));
                                $order->contents[$productsKey]['attributes'][$optionId . '_' . $optionValueId] = $optionValueId;
                            }
                        }
                        if (!empty($order->contents[$productsKey]['attributes'])) {
                            $attributes = $order->contents[$productsKey]['attributes'];
                            $order->contents[$productsKey]['attributes'] = array();
                            $subindex = 0;
                            foreach ($attributes as $option => $value) {
                                $optionValues = zen_get_option_value(zen_get_options_id($option), (int) $value);
                                // Determine if attribute is a text attribute and change products array if it is.
                                if ($value == PRODUCTS_OPTIONS_VALUES_TEXT_ID) {
                                    $attr_value = $order->contents[$productsKey]['attributes_values'][$option];
                                } else {
                                    $attr_value = $optionValues['products_options_values_name'];
                                }
                                $order->contents[$productsKey]['attributes'][$subindex] = array('option' => $optionValues['products_options_name'], 'value' => $attr_value, 'option_id' => $option, 'value_id' => $value, 'prefix' => $optionValues['price_prefix'], 'price' => $optionValues['options_values_price']);
                                $subindex++;
//.........这里部分代码省略.........
开发者ID:bitweaver,项目名称:commerce,代码行数:101,代码来源:amazonmws_setup_inc.php

示例5: getLanguageCode

 /**
  * Determine the language to use when visiting the PayPal site
  */
 function getLanguageCode()
 {
     global $order;
     $lang_code = '';
     $orderISO = zen_get_countries($order->customer['country']['id'], true);
     $storeISO = zen_get_countries(STORE_COUNTRY, true);
     if (in_array(strtoupper($orderISO['countries_iso_code_2']), array('US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) {
         $lang_code = strtoupper($orderISO['countries_iso_code_2']);
     } elseif (in_array(strtoupper($storeISO['countries_iso_code_2']), array('US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) {
         $lang_code = strtoupper($storeISO['countries_iso_code_2']);
     } elseif (in_array(strtoupper($_SESSION['languages_code']), array('EN', 'US', 'AU', 'DE', 'FR', 'IT', 'GB', 'ES', 'AT', 'BE', 'CA', 'CH', 'CN', 'NL', 'PL'))) {
         $lang_code = $_SESSION['languages_code'];
     }
     if (strtoupper($lang_code) == 'EN') {
         $lang_code = 'US';
     }
     //return $orderISO['countries_iso_code_2'];
     return strtoupper($lang_code);
 }
开发者ID:dalinhuang,项目名称:yijinhuanxiang,代码行数:22,代码来源:paypalwpp.php

示例6: elseif

    $shippingAddressCheck = true;
}
// check if the copybilling checkbox should be checked
if (isset($_SESSION['shippingAddress'])) {
    $shippingAddress = $_SESSION['shippingAddress'];
} elseif ($_GET['error'] == 'true') {
    $shippingAddress = false;
} elseif (FEC_COPYBILLING == 'true') {
    // initial load, check by default
    $shippingAddress = true;
}
if (FEC_ORDER_TOTAL == 'true' && $_SESSION['cart']->count_contents() > 0) {
    require DIR_WS_CLASSES . 'order.php';
    $order = new order();
    require DIR_WS_CLASSES . 'order_total.php';
    $order_total_modules = new order_total();
    $fec_order_total_enabled = true;
} else {
    $fec_order_total_enabled = false;
}
// check if country field should be hidden
$numcountries = zen_get_countries();
if (sizeof($numcountries) <= 1) {
    $_SESSION['zone_country_id_shipping'] = $_SESSION['zone_country_id'] = $selected_country = $numcountries[0]['countries_id'];
    $disable_country = true;
} else {
    $disable_country = false;
}
// This should be last line of the script:
$zco_notifier->notify('NOTIFY_HEADER_END_LOGIN');
$zco_notifier->notify('NOTIFY_HEADER_END_EASY_SIGNUP');
开发者ID:krakatoa14,项目名称:fec,代码行数:31,代码来源:header_php.php

示例7: zen_get_countries_with_iso_codes

/**
 * Alias function to zen_get_countries, which also returns the countries iso codes
 *
 * @param int If set limits to a single country
*/
function zen_get_countries_with_iso_codes($countries_id)
{
    return zen_get_countries($countries_id, true);
}
开发者ID:bobjacobsen,项目名称:EventTools,代码行数:9,代码来源:functions_lookups.php

示例8: zen_get_countries_with_iso_codes

/**
 * Alias function to zen_get_countries, which also returns the countries iso codes
 *
 * @param int If set limits to a single country
*/
function zen_get_countries_with_iso_codes($countries_id, $activeOnly = TRUE)
{
    return zen_get_countries($countries_id, true, $activeOnly);
}
开发者ID:badarac,项目名称:stock_by_attribute_1.5.4,代码行数:9,代码来源:functions_lookups.php

示例9: quote

 /**
  * Get quote from shipping provider's API:
  *
  * @param string $method
  * @return array of quotation results
  */
 function quote($method = '')
 {
     global $_POST, $order, $shipping_weight, $shipping_num_boxes;
     if (zen_not_null($method) && isset($this->types[$method])) {
         $prod = $method;
         // BOF: UPS USPS
     } else {
         if ($order->delivery['country']['iso_code_2'] == 'CA') {
             $prod = 'STD';
             // EOF: UPS USPS
         } else {
             $prod = 'GNDRES';
         }
     }
     if ($method) {
         $this->_upsAction('3');
     }
     // return a single quote
     $this->_upsProduct($prod);
     $ups_shipping_weight = $shipping_weight < 0.1 ? 0.1 : $shipping_weight;
     $country_name = zen_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
     $this->_upsOrigin(SHIPPING_ORIGIN_ZIP, $country_name['countries_iso_code_2']);
     $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['iso_code_2']);
     $this->_upsRate(MODULE_SHIPPING_UPS_PICKUP);
     $this->_upsContainer(MODULE_SHIPPING_UPS_PACKAGE);
     $this->_upsWeight($ups_shipping_weight);
     $this->_upsRescom(MODULE_SHIPPING_UPS_RES);
     $upsQuote = $this->_upsGetQuote();
     if (is_array($upsQuote) && sizeof($upsQuote) > 0) {
         switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
             case 0:
                 $show_box_weight = '';
                 break;
             case 1:
                 $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
                 break;
             case 2:
                 $show_box_weight = ' (' . number_format($ups_shipping_weight * $shipping_num_boxes, 2) . TEXT_SHIPPING_WEIGHT . ')';
                 break;
             default:
                 $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($ups_shipping_weight, 2) . TEXT_SHIPPING_WEIGHT . ')';
                 break;
         }
         $this->quotes = array('id' => $this->code, 'module' => $this->title . $show_box_weight);
         $methods = array();
         // BOF: UPS USPS
         $allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);
         $std_rcd = false;
         // EOF: UPS USPS
         $qsize = sizeof($upsQuote);
         for ($i = 0; $i < $qsize; $i++) {
             list($type, $cost) = each($upsQuote[$i]);
             // BOF: UPS USPS
             if ($type == 'STD') {
                 if ($std_rcd) {
                     continue;
                 } else {
                     $std_rcd = true;
                 }
             }
             if (!in_array($type, $allowed_methods)) {
                 continue;
             }
             // EOF: UPS USPS
             $methods[] = array('id' => $type, 'title' => $this->types[$type], 'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);
         }
         $this->quotes['methods'] = $methods;
         if ($this->tax_class > 0) {
             $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
         }
     } else {
         $this->quotes = array('module' => $this->title, 'error' => 'We are unable to obtain a rate quote for UPS shipping.<br />Please contact the store if no other alternative is shown.');
     }
     if (zen_not_null($this->icon)) {
         $this->quotes['icon'] = zen_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:dalinhuang,项目名称:kakayaga,代码行数:84,代码来源:ups.php

示例10: array

$contents = array();
if ($action == 'list') {
    switch ($saction) {
        case 'new':
            $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>');
            $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] . '&' : '') . 'saction=insert_sub'));
            $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"'));
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down()));
            $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
            break;
        case 'edit':
            $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>');
            $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=save_sub'));
            $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"'));
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id));
            $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
            break;
        case 'delete':
            $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>');
            $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=deleteconfirm_sub'));
            $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
            $contents[] = array('text' => '<br><b>' . $sInfo->countries_name . '</b>');
            $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
            break;
        default:
            if (isset($sInfo) && is_object($sInfo)) {
                $heading[] = array('text' => '<b>' . $sInfo->countries_name . '</b>');
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
                $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->date_added));
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:geo_zones.php

示例11: quote

 /**
  * Get quote from shipping provider's API:
  *
  * @param string $method
  * @return array of quotation results
  */
 function quote($pShipHash = array())
 {
     global $order, $total_weight, $boxcount, $handling_cp;
     $shippingWeight = !empty($pShipHash['shipping_weight']) && $pShipHash['shipping_weight'] > 0.1 ? $pShipHash['shipping_weight'] : 0.1;
     $shippingNumBoxes = !empty($pShipHash['shipping_num_boxes']) ? $pShipHash['shipping_num_boxes'] : 1;
     // will round to 2 decimals 9.112 becomes 9.11 thus a product can be 0.1 of a KG
     $shippingWeight = round($shippingWeight, 2);
     $country_name = zen_get_countries(STORE_COUNTRY, true);
     $this->_canadapostOrigin(SHIPPING_ORIGIN_ZIP, $country_name['countries_iso_code_2']);
     if (!zen_not_null($order->delivery['state']) && $order->delivery['zone_id'] > 0) {
         $state_name = zen_get_zone_code($order->delivery['country_id'], $order->delivery['zone_id'], '');
         $order->delivery['state'] = $state_name;
     }
     $strXml = '<?xml version="1.0" ?>';
     // set package configuration.
     $strXml .= "<eparcel>\n";
     $strXml .= "\t<language>" . $this->language . "</language>\n";
     $strXml .= "\t<ratesAndServicesRequest>\n";
     $strXml .= "\t\t<merchantCPCID>" . $this->CPCID . "</merchantCPCID>\n";
     $strXml .= "\t\t<fromPostalCode>" . $this->_canadapostOriginPostalCode . "</fromPostalCode>\n";
     $strXml .= "\t\t<turnAroundTime>" . $this->turnaround_time . "</turnAroundTime>\n";
     $strXml .= "\t\t<itemsPrice>" . (string) $this->items_price . "</itemsPrice>\n";
     // add items information.
     $itemXml = '';
     for ($i = 0; $i < $pShipHash['shipping_num_boxes']; $i++) {
         $itemXml .= "\t<item>\n";
         $itemXml .= "\t\t<quantity>1</quantity>\n";
         $itemXml .= "\t\t<weight>" . $shippingWeight / $shippingNumBoxes . "</weight>\n";
         /*
         			if ($this->item_dim_type[$i] == 'in') //convert to centimeters
         			{
         				$itemXml .= "		<length>" . ($this->item_length[$i] * (254 / 100)) . "</length>\n";
         				$itemXml .= "		<width>" . ($this->item_width[$i] * (254 / 100)) . "</width>\n";
         				$itemXml .= "		<height>" . ($this->item_height[$i] * (254 / 100)) . "</height>\n";
         			} else {
         */
         $itemXml .= "\t\t<length>5</length>\n";
         $itemXml .= "\t\t<width>5</width>\n";
         $itemXml .= "\t\t<height>5</height>\n";
         //			}
         $itemXml .= "\t\t<description>Goods</description>\n";
         // Not sure what this means at the moment
         //			if ($this->item_ready_to_ship[$i] == '1') {
         //				$itemXml .= "		<readyToShip/>\n";
         //			}
         $itemXml .= "\t</item>\n";
     }
     if ($itemXml) {
         $strXml .= "\t<lineItems>\n" . $itemXml . "\n\t</lineItems>\n";
     }
     // add destination information.
     $strXml .= "\t <city>" . $order->delivery['city'] . "</city>\n";
     $strXml .= "\t <provOrState>" . $order->delivery['state'] . "</provOrState>\n";
     $strXml .= "\t <country>" . $order->delivery['country']['countries_iso_code_2'] . "</country>\n";
     $strXml .= "\t <postalCode>" . str_replace(' ', '', $order->delivery['postcode']) . "</postalCode>\n";
     $strXml .= "\t</ratesAndServicesRequest>\n";
     $strXml .= "</eparcel>\n";
     $ret = array('id' => $this->code, 'module' => $this->title, 'icon' => $this->icon);
     //printf("\n\n<!--\n%s\n-->\n\n",$strXml); //debug xml
     $resultXml = $this->_sendToHost($this->server, $this->port, 'POST', '', $strXml);
     if ($resultXml && ($canadapostQuote = $this->_parserResult($resultXml))) {
         if ($this->lettermail_available && $shippingWeight <= $this->lettermail_max_weight) {
             /* Select the correct rate table based on destination country */
             switch ($order->delivery['country']['iso_code_2']) {
                 case 'CA':
                     $table_cost = preg_split("/[:,]/", constant('MODULE_SHIPPING_CANADAPOST_LETTERMAIL_CAN'));
                     $lettermailName = "Lettermail";
                     $lettermailDelivery = sprintf("estimated %d-%d business days", round($this->turnaround_time / 24 + 2), round($this->turnaround_time / 24 + 4));
                     //factor in turnaround time
                     break;
                 case 'US':
                     $table_cost = preg_split("/[:,]/", constant('MODULE_SHIPPING_CANADAPOST_LETTERMAIL_USA'));
                     $lettermailName = "U.S.A Letter-post";
                     $lettermailDelivery = "up to 2 weeks";
                     break;
                 default:
                     $table_cost = preg_split("/[:,]/", constant('MODULE_SHIPPING_CANADAPOST_LETTERMAIL_INTL'));
                     //Use overseas rate if not Canada or US
                     $lettermailName = "INTL Letter-post";
                     $lettermailDelivery = "up to 2 weeks";
             }
             for ($i = 0; $i < sizeof($table_cost); $i += 2) {
                 if (round($shippingWeight, 3) <= $table_cost[$i]) {
                     $lettermailCost = $table_cost[$i + 1];
                     break;
                 }
             }
             if (!empty($lettermailCost)) {
                 $canadapostQuote[] = array('name' => $lettermailName, 'cost' => $lettermailCost, 'delivery' => $lettermailDelivery);
             }
         }
         if (!empty($canadapostQuote) && is_array($canadapostQuote)) {
             $methods = array();
             foreach ($canadapostQuote as $quoteCode => $quote) {
//.........这里部分代码省略.........
开发者ID:bitweaver,项目名称:commerce,代码行数:101,代码来源:canadapost.php

示例12: quote

 function quote($pShipHash = array())
 {
     global $_POST, $order;
     if (!empty($pShipHash['method']) && isset($this->types[$pShipHash['method']])) {
         $prod = $pShipHash['method'];
     } elseif ($order->delivery['country']['countries_iso_code_2'] == 'CA') {
         $prod = 'STD';
     } else {
         $prod = 'GNDRES';
     }
     if ($pShipHash['method']) {
         $this->_upsAction('3');
     }
     // return a single quote
     // default to 1
     $shippingWeight = !empty($pShipHash['shipping_weight']) && $pShipHash['shipping_weight'] > 1 ? $pShipHash['shipping_weight'] : 1;
     $shippingNumBoxes = !empty($pShipHash['shipping_num_boxes']) ? $pShipHash['shipping_num_boxes'] : 1;
     $this->_upsProduct($prod);
     $country_name = zen_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
     $this->_upsOrigin(SHIPPING_ORIGIN_ZIP, $country_name['countries_iso_code_2']);
     $this->_upsDest($order->delivery['postcode'], $order->delivery['country']['countries_iso_code_2']);
     $this->_upsRate(MODULE_SHIPPING_UPS_PICKUP);
     $this->_upsContainer(MODULE_SHIPPING_UPS_PACKAGE);
     $this->_upsWeight($shippingWeight);
     $this->_upsRescom(MODULE_SHIPPING_UPS_RES);
     $upsQuote = $this->_upsGetQuote();
     if (is_array($upsQuote) && sizeof($upsQuote) > 0) {
         switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
             case 0:
                 $show_box_weight = '';
                 break;
             case 1:
                 $show_box_weight = $shippingNumBoxes . ' ' . TEXT_SHIPPING_BOXES;
                 break;
             case 2:
                 $show_box_weight = number_format($shippingWeight * $shippingNumBoxes, 2) . tra('lbs');
                 break;
             default:
                 $show_box_weight = $shippingNumBoxes . ' x ' . number_format($shippingWeight, 2) . tra('lbs');
                 break;
         }
         $this->quotes = array('id' => $this->code, 'module' => $this->title, 'weight' => $show_box_weight);
         $methods = array();
         // BOF: UPS UPS
         $allowed_methods = explode(", ", MODULE_SHIPPING_UPS_TYPES);
         $std_rcd = false;
         // EOF: UPS UPS
         $qsize = sizeof($upsQuote);
         for ($i = 0; $i < $qsize; $i++) {
             list($type, $cost) = each($upsQuote[$i]);
             // BOF: UPS UPS
             if ($type == 'STD') {
                 if ($std_rcd) {
                     continue;
                 } else {
                     $std_rcd = true;
                 }
             }
             if (!in_array($type, $allowed_methods)) {
                 continue;
             }
             // EOF: UPS UPS
             $methods[] = array('id' => $type, 'title' => 'UPS ' . $this->types[$type], 'cost' => ($cost + MODULE_SHIPPING_UPS_HANDLING) * $shippingNumBoxes, 'code' => 'UPS ' . $this->types[$type]);
         }
         $this->quotes['methods'] = $methods;
         if ($this->tax_class > 0) {
             $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['countries_id'], $order->delivery['zone_id']);
         }
     } else {
         /* ORIGINAL
                 $this->quotes = array('module' => $this->title,
                                       'error' => 'An error occurred with the UPS shipping calculations.<br />' . $upsQuote . '<br />If you prefer to use UPS as your shipping method, please contact the store owner.');
         */
         // BOF: UPS UPS
         $this->quotes = array('module' => $this->title, 'error' => tra('We are unable to obtain a rate quote for UPS shipping. Please contact support if no other alternative is shown.') . '<br /> ( ' . $upsQuote . ' )');
         // EOF: UPS UPS
     }
     if (zen_not_null($this->icon)) {
         $this->quotes['icon'] = $this->icon;
     }
     return $this->quotes;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:82,代码来源:ups.php

示例13: switch

 // moved below and altered to include Tare
   // totals info
   $totalsDisplay = '';
   switch (true) {
     case (SHOW_TOTALS_IN_CART == '1'):
     $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
     break;
     case (SHOW_TOTALS_IN_CART == '2'):
     $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . ($_SESSION['cart']->show_weight() > 0 ? TEXT_TOTAL_WEIGHT . $_SESSION['cart']->show_weight() . TEXT_PRODUCT_WEIGHT_UNIT : '') . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
     break;
     case (SHOW_TOTALS_IN_CART == '3'):
     $totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents() . TEXT_TOTAL_AMOUNT . $currencies->format($_SESSION['cart']->show_total());
     break;
   }
 */
 $country_info = zen_get_countries($_POST['zone_country_id'], true);
 $order->delivery = array('postcode' => $zip_code, 'country' => array('id' => $_POST['zone_country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' => $country_info['countries_iso_code_3']), 'country_id' => $_POST['zone_country_id'], 'zone_id' => $state_zone_id, 'format_id' => zen_get_address_format_id($_POST['zone_country_id']));
 // weight and count needed for shipping !
 $total_weight = $_SESSION['cart']->show_weight();
 $shipping_estimator_display_weight = $total_weight;
 $total_count = $_SESSION['cart']->count_contents();
 require DIR_WS_CLASSES . 'shipping.php';
 $shipping_modules = new shipping();
 $quotes = $shipping_modules->quote();
 //4px shipping
 if (EXTRA_HOST_NOT_OURS) {
     //get services supply by 4px
     $dsf_shipping_query = "SELECT `dsf_shipping_id` FROM `dsf_shipping` WHERE `status`=1 order by `sort_index` desc,`dsf_shipping_code`";
     $dsf_shipping_opens = $db->Execute($dsf_shipping_query);
     $data = array('countries_iso_code_2' => $country_info['countries_iso_code_2'], 'total_weight' => $total_weight);
     if (!$dsf_shipping_opens->EOF) {
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:product_shipping_estimator.php

示例14: GoogleFlatRateShipping

                         $Gshipping = new GoogleFlatRateShipping($shipping_name, $shipping_price);
                         $Gshipping->AddShippingRestrictions($Gfilter);
                         $Gcart->AddShipping($Gshipping);
                     }
                 }
             }
         } else {
             $shipping_config_errors .= $key . " (ignored)<br />";
         }
     }
 }
 if (MODULE_PAYMENT_GOOGLECHECKOUT_CARRIER_CALCULATED_ENABLED == 'True' && !$free_shipping) {
     $Gshipping = new GoogleCarrierCalculatedShipping('Carrier_shipping');
     $country_code = defined('SHIPPING_ORIGIN_COUNTRY') ? SHIPPING_ORIGIN_COUNTRY : STORE_COUNTRY;
     $zone_name = zen_get_zone_code($country_code, STORE_ZONE, '');
     $countries_array = zen_get_countries(SHIPPING_ORIGIN_COUNTRY, true);
     $ship_from = new GoogleShipFrom('Store_origin', '', $countries_array['countries_iso_code_2'], SHIPPING_ORIGIN_ZIP, $zone_name);
     $GSPackage = new GoogleShippingPackage($ship_from, 1, 1, 1, 'IN');
     $Gshipping->addShippingPackage($GSPackage);
     $carriers_config = explode(', ', MODULE_PAYMENT_GOOGLECHECKOUT_CARRIER_CALCULATED);
     //    print_r($carriers_config);die;
     foreach ($googlepayment->cc_shipping_methods_names as $CCSCode => $CCSName) {
         foreach ($googlepayment->cc_shipping_methods[$CCSCode] as $type => $methods) {
             foreach ($methods as $method => $method_name) {
                 $values = explode('|', compare($CCSCode . $method . $type, $carriers_config, "_CCS:", '0|0|0'));
                 if ($values[0] != '0') {
                     $CCSoption = new GoogleCarrierCalculatedShippingOption($values[0], $CCSName, $method, $values[1], $values[2], 'REGULAR_PICKUP');
                     $Gshipping->addCarrierCalculatedShippingOptions($CCSoption);
                 }
             }
         }
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:gcheckout.php

示例15: zen_get_countries

            $pass = true;
            break;
    }
    $free_shipping = false;
    if ($pass == true && $_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
        $free_shipping = true;
    }
} else {
    $free_shipping = false;
}
if (isset($_SESSION['comments'])) {
    $comments = $_SESSION['comments'];
}
// get all available shipping quotes
$quotes = $shipping_modules->quote();
$country_info = zen_get_countries($order->delivery['country_id'], true);
if (EXTRA_HOST_NOT_OURS) {
    //get services supply by 4px
    $dsf_shipping_query = "SELECT `dsf_shipping_id` FROM `dsf_shipping` WHERE `status`=1 order by `sort_index` desc,`dsf_shipping_code`";
    $dsf_shipping_opens = $db->Execute($dsf_shipping_query);
    $data = array('countries_iso_code_2' => $country_info['countries_iso_code_2'], 'total_weight' => $total_weight);
    if (!$dsf_shipping_opens->EOF) {
        $dsf_shipping_open = '';
        $dsf_shipping_i = 0;
        while (!$dsf_shipping_opens->EOF) {
            $dsf_shipping_open .= $dsf_shipping_i == 0 ? '' : ',';
            $dsf_shipping_open .= $dsf_shipping_opens->fields['dsf_shipping_id'];
            ++$dsf_shipping_i;
            $dsf_shipping_opens->MoveNext();
        }
        if ($dsf_shipping_open != '') {
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:header_php.php


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