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


PHP wpsc_shipping_country_list函数代码示例

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


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

示例1: wpsc_shipping_country_list

        ?>
</h2>
		<table class="productcart">
			<tr>
				<td colspan='5'>
					<?php 
        echo TXT_WPSC_SHIPPING_DETAIL;
        ?>
				</td>
			</tr>
			
			<tr>
				<td colspan='5'>
					<form name='change_country' id='change_country' action='' method='post'>
						<?php 
        echo wpsc_shipping_country_list();
        ?>
						<input type='hidden' name='wpsc_update_location' value='true' />
						<input type='submit' name='wpsc_submit_zipcode' value='Calculate' />
					</form>
				
				</td>
			</tr>
			
			<?php 
        while (wpsc_have_shipping_methods()) {
            wpsc_the_shipping_method();
            ?>
					<?php 
            // Don't display shipping method if it doesn't have at least one quote
            if (!wpsc_have_shipping_quotes()) {
开发者ID:papayalabs,项目名称:htdocs,代码行数:31,代码来源:shopping_cart_page.php

示例2: form_field

 /**
  * form_field method, returns the form html
  * @access public
  */
 function form_field()
 {
     global $wpdb, $user_ID;
     //		exit('<pre>'.print_r($_SESSION['wpsc_checkout_saved_values'], true).'</pre>');
     if (count($_SESSION['wpsc_checkout_saved_values']) <= 0 && $user_ID > 0) {
         //$_SESSION['wpsc_checkout_saved_values'] = get_usermeta($user_ID, 'wpshpcrt_usr_profile');
     }
     if (is_array($_SESSION['wpsc_checkout_saved_values'][$this->checkout_item->id])) {
         if (function_exists('wpsc_get_ticket_checkout_set')) {
             if ($this->checkout_item->checkout_set == wpsc_get_ticket_checkout_set()) {
                 if (!isset($_SESSION['wpsc_tickets_saved_values_count'])) {
                     $_SESSION['wpsc_tickets_saved_values_count'] = 0;
                     $count = $_SESSION['wpsc_tickets_saved_values_count'];
                 } else {
                     $count = $_SESSION['wpsc_tickets_saved_values_count'] - 1;
                 }
                 $saved_form_data = htmlentities(stripslashes($_SESSION['wpsc_checkout_saved_values'][$this->checkout_item->id][$count]), ENT_QUOTES, 'UTF-8');
             }
         }
     } else {
         $saved_form_data = htmlentities(stripslashes($_SESSION['wpsc_checkout_saved_values'][$this->checkout_item->id]), ENT_QUOTES, 'UTF-8');
     }
     //make sure tickets are arrays for multiple ticket holders
     $an_array = '';
     if (function_exists('wpsc_get_ticket_checkout_set')) {
         if ($this->checkout_item->checkout_set == wpsc_get_ticket_checkout_set()) {
             $an_array = '[]';
         }
     }
     switch ($this->checkout_item->type) {
         case "address":
         case "delivery_address":
         case "textarea":
             $output = "<textarea title='" . $this->checkout_item->unique_name . "' class='text' id='" . $this->form_element_id() . "' name='collected_data[{$this->checkout_item->id}]" . $an_array . "' rows='3' cols='40' >" . $saved_form_data . "</textarea>";
             break;
         case "checkbox":
             $options = $this->get_checkout_options($this->checkout_item->id);
             if ($options != '') {
                 $i = mt_rand();
                 $j = 0;
                 foreach ($options as $label => $value) {
                     $output .= "<input type='hidden' title='" . $this->checkout_item->unique_name . "' id='" . $this->form_element_id() . $j . "' value='-1' name='collected_data[{$this->checkout_item->id}][" . $i . "][" . $j . "]'/><input type='checkbox' title='" . $this->checkout_item->unique_name . "' id='" . $this->form_element_id() . "' value='" . $value . "' name='collected_data[{$this->checkout_item->id}][" . $i . "][" . $j . "]'/> ";
                     $output .= "<label for='" . $this->form_element_id() . $j . "'>" . $label . "</label><br />";
                     $j++;
                 }
             }
             break;
         case "country":
             $output = wpsc_country_region_list($this->checkout_item->id, false, $_SESSION['wpsc_selected_country'], $_SESSION['wpsc_selected_region'], $this->form_element_id());
             break;
         case "delivery_country":
             if (wpsc_uses_shipping() && get_option('use_billing_unless_is_shipping') != 1) {
                 $country_name = $wpdb->get_var("SELECT `country` FROM `" . WPSC_TABLE_CURRENCY_LIST . "` WHERE `isocode`='" . $_SESSION['wpsc_delivery_country'] . "' LIMIT 1");
                 $output = "<input title='" . $this->checkout_item->unique_name . "' type='hidden' id='" . $this->form_element_id() . "' class='shipping_country' name='collected_data[{$this->checkout_item->id}]' value='" . $_SESSION['wpsc_delivery_country'] . "' /><span class='shipping_country_name'>" . $country_name . "</span> ";
             } else {
                 if (get_option('use_billing_unless_is_shipping') == 1) {
                     $output = wpsc_shipping_country_list();
                 } else {
                     $checkoutfields = true;
                     //$output = wpsc_shipping_country_list($checkoutfields);
                     $output = wpsc_country_region_list($this->checkout_item->id, false, $_SESSION['wpsc_selected_country'], $_SESSION['wpsc_selected_region'], $this->form_element_id(), $checkoutfields);
                 }
             }
             break;
         case "select":
             $options = $this->get_checkout_options($this->checkout_item->id);
             if ($options != '') {
                 $output = "<select name='collected_data[{$this->checkout_item->id}]" . $an_array . "'>";
                 $output .= "<option value='-1'>Select an Option</option>";
                 foreach ((array) $options as $label => $value) {
                     $value = str_replace(' ', '', $value);
                     if ($saved_form_data == $value) {
                         $selected = 'selected="selected"';
                     } else {
                         $selected = '';
                     }
                     $output .= "<option " . $selected . " value='" . $value . "'>" . $label . "</option>\n\r";
                 }
                 $output .= "</select>";
             }
             break;
         case "radio":
             $options = $this->get_checkout_options($this->checkout_item->id);
             if ($options != '') {
                 $i = mt_rand();
                 foreach ((array) $options as $label => $value) {
                     $output .= "<input type='radio' title='" . $this->checkout_item->unique_name . "' id='" . $this->form_element_id() . "'value='" . $value . "' name='collected_data[{$this->checkout_item->id}][" . $i . "]'/> ";
                     $output .= "<label for='" . $this->form_element_id() . "'>" . $label . "</label>";
                 }
             }
             break;
         case "text":
         case "city":
         case "delivery_city":
         case "email":
         case "coupon":
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:101,代码来源:checkout.class.php

示例3: wpsc_update_shipping_quotes_on_shipping_same_as_billing

function wpsc_update_shipping_quotes_on_shipping_same_as_billing()
{
    global $wpsc_cart;
    wpsc_update_location();
    if (get_option('do_not_use_shipping')) {
        die('-1');
    }
    if (!wpsc_have_shipping_quotes()) {
        die('0');
    } else {
        ?>
   <tr class="wpsc_shipping_info">
            <td colspan="5">
               <?php 
        _e('Please choose a country below to calculate your shipping costs', 'wpsc');
        ?>
            </td>
         </tr>

         <?php 
        if (!wpsc_have_shipping_quote()) {
            // No valid shipping quotes
            ?>
            <?php 
            if (wpsc_have_valid_shipping_zipcode()) {
                ?>
                  <tr class='wpsc_update_location'>
                     <td colspan='5' class='shipping_error' >
                        <?php 
                _e('Please provide a Zipcode and click Calculate in order to continue.', 'wpsc');
                ?>
                     </td>
                  </tr>
            <?php 
            } else {
                ?>
               <tr class='wpsc_update_location_error'>
                  <td colspan='5' class='shipping_error' >
                     <?php 
                _e('Sorry, online ordering is unavailable to this destination and/or weight. Please double check your destination details.', 'wpsc');
                ?>
                  </td>
               </tr>
            <?php 
            }
            ?>
         <?php 
        }
        ?>
         <tr class='wpsc_change_country'>
            <td colspan='5'>
               <form name='change_country' id='change_country' action='' method='post'>
                  <?php 
        echo wpsc_shipping_country_list();
        ?>
                  <input type='hidden' name='wpsc_update_location' value='true' />
                  <input type='submit' name='wpsc_submit_zipcode' value='Calculate' />
               </form>
            </td>
         </tr>

         <?php 
        if (wpsc_have_morethanone_shipping_quote()) {
            ?>
            <?php 
            while (wpsc_have_shipping_methods()) {
                wpsc_the_shipping_method();
                ?>
                  <?php 
                if (!wpsc_have_shipping_quotes()) {
                    continue;
                }
                // Don't display shipping method if it doesn't have at least one quote
                ?>
                  <tr class='wpsc_shipping_header'><td class='shipping_header' colspan='5'><?php 
                echo wpsc_shipping_method_name() . __(' - Choose a Shipping Rate', 'wpsc');
                ?>
 </td></tr>
                  <?php 
                while (wpsc_have_shipping_quotes()) {
                    wpsc_the_shipping_quote();
                    ?>
                     <tr class='<?php 
                    echo wpsc_shipping_quote_html_id();
                    ?>
'>
                        <td class='wpsc_shipping_quote_name wpsc_shipping_quote_name_<?php 
                    echo wpsc_shipping_quote_html_id();
                    ?>
' colspan='3'>
                           <label for='<?php 
                    echo wpsc_shipping_quote_html_id();
                    ?>
'><?php 
                    echo wpsc_shipping_quote_name();
                    ?>
</label>
                        </td>
                        <td class='wpsc_shipping_quote_price wpsc_shipping_quote_price_<?php 
                    echo wpsc_shipping_quote_html_id();
//.........这里部分代码省略.........
开发者ID:pankajsinghjarial,项目名称:SYLC,代码行数:101,代码来源:ajax.functions.php

示例4: wpsc_shipping_country_list

    <?php 
            echo "  </td>\n\r";
            echo "  <td colspan='2' style='vertical-align: middle;'>";
            echo "</td>\n\r";
            echo "</tr>\n\r";
        }
        echo "<tr class='total_price'>\n\r";
        echo "  <td colspan='2' >\n\r";
        if (get_option('payment_gateway') == 'google') {
            echo TXT_WPSC_POSTAGE . ":";
        } else {
            ?>
    <div class='select_country'>
      <form name='change_country' action='' method='POST'>
      <?php 
            echo wpsc_shipping_country_list($_SESSION['delivery_country'], $_SESSION['selected_region']);
            ?>
      </form>
            <!--usps changes-->
      <div id='usps_shipping_methods'>
		<?php 
            $dest = $_SESSION['delivery_country'];
            if ($dest == get_option('base_country')) {
                // 				$request  = '<RateV3Request USERID="' . "221ALLEN1967" . '" PASSWORD="' . "651AC00ZD570" . '">';
                // 				$allowed_types = explode(", ", MODULE_SHIPPING_USPS_TYPES);
                //
                // 				while (list($key, $value) = each($this->types)) {
                // 					 if ( !in_array($key, $allowed_types) ) continue;
                //
                // 					if ($key == 'FIRST CLASS'){
                // 						$this->FirstClassMailType = '<FirstClassMailType>LETTER</FirstClassMailType>';
开发者ID:alx,项目名称:barceloneta,代码行数:31,代码来源:shopping_cart.php


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