예제 #1
0
    ?>
</span>
		</td>
	</tr>
	  <?php 
    if (wpsc_uses_coupons() && wpsc_coupon_amount(false) > 0) {
        ?>
	<tr class="total_price">
		<td colspan="3">
			<?php 
        echo TXT_WPSC_COUPONS;
        ?>
		</td>
		<td colspan="2">
			<span id="coupons_amount" class="pricedisplay"><?php 
        echo wpsc_coupon_amount();
        ?>
</span>
	    </td>
   	</tr>
	  <?php 
    }
    ?>

		
	
	<tr class='total_price'>
		<td colspan='3'>
		<?php 
    echo TXT_WPSC_TOTALPRICE;
    ?>
	<tr class="total_price total_tax">
		<td colspan="3">
			<?php echo wpsc_display_tax_label(true); ?>

		</td>
		<td colspan="2">
			<span id="checkout_tax" class="pricedisplay checkout-tax"><?php echo wpsc_cart_tax(); ?></span>
		</td>
	</tr>
	  <?php if(wpsc_uses_coupons() && (wpsc_coupon_amount(false) > 0)): ?>
	<tr class="total_price">
		<td colspan="3">
			<?php echo __('Discount', 'wpsc'); ?>
		</td>
		<td colspan="2">
			<span id="coupons_amount" class="pricedisplay"><?php echo wpsc_coupon_amount(); ?></span>
	    </td>
   	</tr>
	  <?php endif ?>

		
	
	<tr class='total_price'>
		<td colspan='3'>
		<?php echo __('Total Price', 'wpsc'); ?>
		</td>
		<td colspan='2'>
			<span id='checkout_total' class="pricedisplay checkout-total"><?php echo wpsc_cart_total(); ?></span>
		</td>
	</tr>
	
예제 #3
0
 private function get_shipping_method_js_vars()
 {
     global $wpsc_cart;
     $js_var = array('subtotal' => (double) $wpsc_cart->calculate_subtotal(), 'shipping' => array(), 'tax' => wpsc_is_tax_enabled() && !wpsc_is_tax_included() ? (double) wpsc_cart_tax(false) : 0, 'discount' => wpsc_coupon_amount(false) > 0 ? wpsc_coupon_amount(false) : 0);
     foreach ($this->shipping_calculator->sorted_quotes as $module_name => $quotes) {
         foreach ($quotes as $option => $cost) {
             $id = $this->shipping_calculator->ids[$module_name][$option];
             $js_var['shipping'][$id] = $cost;
         }
     }
     $currency = new WPSC_Country(get_option('currency_type'));
     $currency_code = $currency->get_currency_code();
     $isocode = $currency->get_isocode();
     $without_fractions = in_array($currency_code, WPSC_Payment_Gateways::currencies_without_fractions());
     $decimals = $without_fractions ? 0 : 2;
     $decimals = apply_filters('wpsc_modify_decimals', $decimals, $isocode);
     $decimal_separator = apply_filters('wpsc_format_currency_decimal_separator', wpsc_get_option('decimal_separator'), $isocode);
     $thousands_separator = apply_filters('wpsc_format_currency_thousands_separator', wpsc_get_option('thousands_separator'), $isocode);
     $symbol = apply_filters('wpsc_format_currency_currency_symbol', $currency->get_currency_symbol());
     $sign_location = get_option('currency_sign_location');
     $js_var['formatter'] = array('currency_code' => $currency_code, 'without_fractions' => $without_fractions, 'decimals' => $decimals, 'decimal_separator' => $decimal_separator, 'thousands_separator' => $thousands_separator, 'symbol' => $symbol, 'sign_location' => $sign_location);
     return $js_var;
 }
예제 #4
0
/**
 * update_shipping_price function, used through ajax and in normal page loading.
 * No parameters, returns nothing
 */
function wpsc_update_shipping_price()
{
    global $wpsc_cart;
    $quote_shipping_method = $_POST['method'];
    $quote_shipping_option = $_POST['option'];
    if (!empty($quote_shipping_option) && !empty($quote_shipping_method)) {
        $wpsc_cart->update_shipping($quote_shipping_method, $quote_shipping_option);
        echo "\n\t\tif(jQuery('.pricedisplay.checkout-shipping .pricedisplay')){\n\t\t\tjQuery('.pricedisplay.checkout-shipping > .pricedisplay:first').html(\"" . wpsc_cart_shipping() . "\");\n\t\t\tjQuery('.shoppingcart .pricedisplay.checkout-shipping > .pricedisplay:first').html(\"" . wpsc_cart_shipping() . "\");\n\t\t} else {\n\t\t\tjQuery('.pricedisplay.checkout-shipping').html(\"" . wpsc_cart_shipping() . "\");}";
        echo "\n\t\tif (jQuery('#coupons_amount .pricedisplay').size() > 0) {\n\t\t\tjQuery('#coupons_amount .pricedisplay').html(\"" . wpsc_coupon_amount() . "\");\n\t\t} else {\n\t\t\tjQuery('#coupons_amount').html(\"" . wpsc_coupon_amount() . "\");\n\t\t}\n\t\t";
        echo "jQuery('.pricedisplay.checkout-total').html(\"" . wpsc_cart_total() . "\");\n\r";
    }
    exit;
}
예제 #5
0
 protected function get_total_discount()
 {
     return wpsc_coupon_amount(false);
 }
예제 #6
0
/**
 * update_shipping_price function, used through ajax and in normal page loading.
 * No parameters, returns nothing
 */
function wpsc_update_shipping_price()
{
    global $wpsc_cart;
    $quote_shipping_method = $_POST['method'];
    $quote_shipping_option = str_replace(array('®', '™'), array('&reg;', '&trade;'), $_POST['option']);
    if (!empty($quote_shipping_option) && !empty($quote_shipping_method)) {
        $wpsc_cart->update_shipping($quote_shipping_method, $quote_shipping_option);
    }
    if (defined('DOING_AJAX') && DOING_AJAX) {
        echo json_encode(array('shipping' => wpsc_cart_shipping(), 'coupon' => wpsc_coupon_amount(), 'cart_total' => wpsc_cart_total(), 'tax' => wpsc_cart_tax()));
        exit;
    }
}