Changes to shipping calculator
This commit is contained in:
parent
b5850a7087
commit
56a4bb601d
|
@ -34,6 +34,7 @@ class woocommerce_customer {
|
|||
'is_vat_exempt' => false
|
||||
);
|
||||
$_SESSION['customer'] = $data;
|
||||
$_SESSION['calculated_shipping'] = false;
|
||||
|
||||
endif;
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
|
|||
* Fixed variations - Incorrectly used instead $product_custom_fields of $parent_custom_fields
|
||||
* Made use of transients to store average ratings and improve performance
|
||||
* Adding cart item resets shipping - so free shipping etc is selected when going over a threshold
|
||||
* Changes to shipping calc - if no rates are found, but the user did not enter a state/postcode, it asks them to do so.
|
||||
|
||||
= 1.1.3 - 27/10/2011 =
|
||||
* Improved Force SSL Setting - now forces https urls for enqueued scripts and styles
|
||||
|
|
|
@ -27,11 +27,11 @@ function woocommerce_cart( $atts ) {
|
|||
|
||||
// Update Shipping
|
||||
elseif (isset($_POST['calc_shipping']) && $_POST['calc_shipping'] && $woocommerce->verify_nonce('cart')) :
|
||||
|
||||
|
||||
$_SESSION['calculated_shipping'] = true;
|
||||
unset($_SESSION['_chosen_shipping_method']);
|
||||
$country = $_POST['calc_shipping_country'];
|
||||
$state = $_POST['calc_shipping_state'];
|
||||
|
||||
$postcode = $_POST['calc_shipping_postcode'];
|
||||
|
||||
if ($postcode && !$validation->is_postcode( $postcode, $country )) :
|
||||
|
|
|
@ -677,7 +677,8 @@ if (!function_exists('woocommerce_cart_totals')) {
|
|||
?>
|
||||
<div class="cart_totals">
|
||||
<?php
|
||||
if ($available_methods || !$woocommerce->customer->get_shipping_country() || !$woocommerce->customer->get_shipping_state() || !$woocommerce->customer->get_shipping_postcode() || !$woocommerce->shipping->enabled ) :
|
||||
//if ( !$woocommerce->shipping->enabled || $available_methods || !$woocommerce->customer->get_shipping_country() || !$woocommerce->customer->get_shipping_state() || !$woocommerce->customer->get_shipping_postcode() ) :
|
||||
if ( !$woocommerce->shipping->enabled || $available_methods || !$woocommerce->customer->get_shipping_country() || !isset($_SESSION['calculated_shipping']) || !$_SESSION['calculated_shipping'] ) :
|
||||
// Hide totals if customer has set location and there are no methods going there
|
||||
?>
|
||||
<h2><?php _e('Cart Totals', 'woothemes'); ?></h2>
|
||||
|
@ -751,7 +752,12 @@ if (!function_exists('woocommerce_cart_totals')) {
|
|||
<p><small><?php _e('Note: Tax and shipping totals are estimated and will be updated during checkout based on your billing information.', 'woothemes'); ?></small></p>
|
||||
<?php
|
||||
else :
|
||||
echo '<p>'.__('Sorry, it seems that there are no available shipping methods to your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woothemes').'</p>';
|
||||
?>
|
||||
<div class="woocommerce_error">
|
||||
<p><?php if (!$woocommerce->customer->get_shipping_state() || !$woocommerce->customer->get_shipping_postcode()) : ?><?php _e('No shipping methods were found; please recalculate your shipping and enter your state/county and zip/postcode to ensure their are no other available methods for your location.', 'woothemes'); ?><?php else : ?><?php printf(__('Sorry, it seems that there are no available shipping methods for your location (%s).', 'woothemes'), $woocommerce->countries->countries[ $woocommerce->customer->get_shipping_country() ]); ?><?php endif; ?></p>
|
||||
<p><?php _e('If you require assistance or wish to make alternate arrangements please contact us.', 'woothemes'); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue