Merge branch 'master' into nl
This commit is contained in:
commit
801e6e11ee
|
@ -21,6 +21,7 @@ class WC_Checkout {
|
|||
function __construct () {
|
||||
global $woocommerce;
|
||||
|
||||
add_action('woocommerce_checkout_process',array(&$this,'checkout_process'));
|
||||
add_action('woocommerce_checkout_billing',array(&$this,'checkout_form_billing'));
|
||||
add_action('woocommerce_checkout_shipping',array(&$this,'checkout_form_shipping'));
|
||||
|
||||
|
@ -59,6 +60,12 @@ class WC_Checkout {
|
|||
);
|
||||
$this->checkout_fields = apply_filters('woocommerce_checkout_fields', $this->checkout_fields);
|
||||
}
|
||||
|
||||
/** Checkout process */
|
||||
function checkout_process() {
|
||||
// When we process the checkout, lets ensure cart items are rechecked to prevent checkout
|
||||
do_action('woocommerce_check_cart_items');
|
||||
}
|
||||
|
||||
/** Output the billing information form */
|
||||
function checkout_form_billing() {
|
||||
|
|
|
@ -802,15 +802,17 @@ class WC_Product {
|
|||
|
||||
// Show length
|
||||
if ($this->length) {
|
||||
$this->dimensions = $this->length.get_option('woocommerce_dimension_unit');
|
||||
$this->dimensions = $this->length;
|
||||
// Show width also
|
||||
if ($this->width) {
|
||||
$this->dimensions .= ' × '.$this->width.get_option('woocommerce_dimension_unit');
|
||||
$this->dimensions .= ' × '.$this->width;
|
||||
// Show height also
|
||||
if ($this->height) {
|
||||
$this->dimensions .= ' × '.$this->height.get_option('woocommerce_dimension_unit');
|
||||
$this->dimensions .= ' × '.$this->height;
|
||||
}
|
||||
}
|
||||
// Append the unit
|
||||
$this->dimensions .= ' '.get_option('woocommerce_dimension_unit');
|
||||
}
|
||||
endif;
|
||||
return $this->dimensions;
|
||||
|
|
|
@ -87,6 +87,11 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
|
|||
* Classes added to my-account
|
||||
* Fix for price filtering when the shop is the homepage
|
||||
* Renamed orderby GET variable to 'sort' to prevent conflicts with permalinks
|
||||
* Fixed a bug allowing checkout when items are out of stock
|
||||
* Added a cart item error page for checkout, if the items are invalid
|
||||
* Hidden shipping text when calculator is hidden
|
||||
* If theres 1 shipping method, don't show a select box (thanks GeertDD)
|
||||
* Don't repeat weight units after each measurement (GeertDD is on a role)
|
||||
|
||||
= 1.4.2 - 09/02/2012 =
|
||||
* Uninstall fix
|
||||
|
|
|
@ -21,11 +21,20 @@ function woocommerce_checkout( $atts ) {
|
|||
|
||||
if (sizeof($woocommerce->cart->get_cart())==0) return;
|
||||
|
||||
$non_js_checkout = (isset($_POST['woocommerce_checkout_update_totals']) && $_POST['woocommerce_checkout_update_totals']) ? true : false;
|
||||
|
||||
do_action('woocommerce_check_cart_items');
|
||||
|
||||
if ( $woocommerce->error_count()==0 && $non_js_checkout) $woocommerce->add_message( __('The order totals have been updated. Please confirm your order by pressing the Place Order button at the bottom of the page.', 'woocommerce') );
|
||||
if ( $woocommerce->error_count()>0 ) {
|
||||
|
||||
woocommerce_get_template('checkout/cart-errors.php');
|
||||
|
||||
} else {
|
||||
|
||||
$non_js_checkout = (isset($_POST['woocommerce_checkout_update_totals']) && $_POST['woocommerce_checkout_update_totals']) ? true : false;
|
||||
|
||||
if ( $woocommerce->error_count()==0 && $non_js_checkout) $woocommerce->add_message( __('The order totals have been updated. Please confirm your order by pressing the Place Order button at the bottom of the page.', 'woocommerce') );
|
||||
|
||||
woocommerce_get_template('checkout/form-checkout.php');
|
||||
|
||||
}
|
||||
|
||||
woocommerce_get_template('checkout/form-checkout.php');
|
||||
}
|
|
@ -29,57 +29,66 @@ $available_methods = $woocommerce->shipping->get_available_shipping_methods();
|
|||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($woocommerce->cart->needs_shipping()) : ?>
|
||||
<?php if ($woocommerce->cart->needs_shipping() && ( $available_methods || get_option('woocommerce_enable_shipping_calc') == 'yes' )) : ?>
|
||||
|
||||
<tr class="shipping">
|
||||
<th><?php _e('Shipping', 'woocommerce'); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
if (sizeof($available_methods)>0) :
|
||||
|
||||
echo '<select name="shipping_method" id="shipping_method">';
|
||||
|
||||
foreach ($available_methods as $method ) :
|
||||
|
||||
echo '<option value="'.esc_attr($method->id).'" '.selected($method->id, $_SESSION['_chosen_shipping_method'], false).'>'.$method->label;
|
||||
if ($method->cost>0) :
|
||||
|
||||
echo ' — ';
|
||||
|
||||
if ($woocommerce->cart->display_totals_ex_tax || !$woocommerce->cart->prices_include_tax) :
|
||||
|
||||
echo woocommerce_price($method->cost);
|
||||
if ( $method->get_shipping_tax()>0 && $woocommerce->cart->prices_include_tax ) :
|
||||
echo ' ' . $woocommerce->countries->ex_tax_or_vat();
|
||||
endif;
|
||||
|
||||
else :
|
||||
|
||||
echo woocommerce_price($method->cost + $method->get_shipping_tax());
|
||||
if ( $method->get_shipping_tax()>0 && !$woocommerce->cart->prices_include_tax ) :
|
||||
echo ' ' . $woocommerce->countries->inc_tax_or_vat();
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
echo '</option>';
|
||||
|
||||
endforeach;
|
||||
|
||||
echo '</select>';
|
||||
|
||||
else :
|
||||
|
||||
if ( !$woocommerce->customer->get_shipping_country() || !$woocommerce->customer->get_shipping_state() || !$woocommerce->customer->get_shipping_postcode() ) :
|
||||
// If at least one shipping method is available
|
||||
if ( $available_methods ) {
|
||||
|
||||
// Prepare text labels with price for each shipping method
|
||||
foreach ( $available_methods as $method ) {
|
||||
$method->full_label = $method->label;
|
||||
|
||||
if ( $method->cost > 0 ) {
|
||||
$method->full_label .= ' — ';
|
||||
|
||||
// Append price to label using the correct tax settings
|
||||
if ( $woocommerce->cart->display_totals_ex_tax || ! $woocommerce->cart->prices_include_tax ) {
|
||||
$method->full_label .= woocommerce_price( $method->cost );
|
||||
if ( $method->get_shipping_tax() > 0 && $woocommerce->cart->prices_include_tax ) {
|
||||
$method->full_label .= ' '.$woocommerce->countries->ex_tax_or_vat();
|
||||
}
|
||||
} else {
|
||||
$method->full_label .= woocommerce_price( $method->cost + $method->get_shipping_tax() );
|
||||
if ( $method->get_shipping_tax() > 0 && ! $woocommerce->cart->prices_include_tax ) {
|
||||
$method->full_label .= ' '.$woocommerce->countries->inc_tax_or_vat();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Print a single available shipping method as plain text
|
||||
if ( 1 === count( $available_methods ) ) {
|
||||
|
||||
echo esc_html( $method->full_label );
|
||||
echo '<input type="hidden" name="shipping_method" id="shipping_method" value="'.esc_attr( $method->id ).'">';
|
||||
|
||||
// Show multiple shipping methods in a select list
|
||||
} else {
|
||||
|
||||
echo '<select name="shipping_method" id="shipping_method">';
|
||||
foreach ( $available_methods as $method ) {
|
||||
echo '<option value="'.esc_attr( $method->id ).'" '.selected( $method->id, $_SESSION['_chosen_shipping_method'], false).'>';
|
||||
echo esc_html( $method->full_label );
|
||||
echo '</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
|
||||
}
|
||||
|
||||
// No shipping methods are available
|
||||
} else {
|
||||
|
||||
if ( ! $woocommerce->customer->get_shipping_country() || ! $woocommerce->customer->get_shipping_state() || ! $woocommerce->customer->get_shipping_postcode() ) {
|
||||
echo '<p>'.__('Please fill in your details above to see available shipping methods.', 'woocommerce').'</p>';
|
||||
else :
|
||||
} else {
|
||||
echo '<p>'.__('Sorry, it seems that there are no available shipping methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce').'</p>';
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?></td>
|
||||
|
||||
</tr>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* Cart errors page
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php $woocommerce->show_messages(); ?>
|
||||
|
||||
<p><?php _e('There are some issues with the items in your cart (shown above). Please go back to the cart page and resolve these issues before checking out.', 'woocommerce') ?></p>
|
||||
|
||||
<?php do_action('woocommerce_cart_has_errors'); ?>
|
||||
|
||||
<p><a class="button" href="<?php echo get_permalink(woocommerce_get_page_id('cart')); ?>"><?php _e('← Return To Cart', 'woocommerce') ?></a></p>
|
|
@ -1,4 +1,12 @@
|
|||
<?php global $woocommerce; ?>
|
||||
<?php
|
||||
/**
|
||||
* Review Order
|
||||
*/
|
||||
|
||||
global $woocommerce;
|
||||
|
||||
$available_methods = $woocommerce->shipping->get_available_shipping_methods();
|
||||
?>
|
||||
<div id="order_review">
|
||||
|
||||
<table class="shop_table">
|
||||
|
@ -31,59 +39,60 @@
|
|||
<th colspan="2"><?php _e('Shipping', 'woocommerce'); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
$available_methods = $woocommerce->shipping->get_available_shipping_methods();
|
||||
|
||||
if (sizeof($available_methods)>0) :
|
||||
|
||||
echo '<select name="shipping_method" id="shipping_method">';
|
||||
|
||||
foreach ($available_methods as $method ) :
|
||||
|
||||
echo '<option value="'.esc_attr($method->id).'" ';
|
||||
|
||||
if ($method->id==$_SESSION['_chosen_shipping_method']) echo 'selected="selected"';
|
||||
|
||||
echo '>'.esc_html($method->label);
|
||||
|
||||
if ($method->cost>0) :
|
||||
|
||||
echo ' — ';
|
||||
|
||||
if ($woocommerce->cart->display_totals_ex_tax || !$woocommerce->cart->prices_include_tax) :
|
||||
// If at least one shipping method is available
|
||||
if ( $available_methods ) {
|
||||
|
||||
echo woocommerce_price($method->cost);
|
||||
if ( $method->get_shipping_tax()>0 && $woocommerce->cart->prices_include_tax ) :
|
||||
echo ' ' . $woocommerce->countries->ex_tax_or_vat();
|
||||
endif;
|
||||
// Prepare text labels with price for each shipping method
|
||||
foreach ( $available_methods as $method ) {
|
||||
$method->full_label = $method->label;
|
||||
|
||||
else :
|
||||
if ( $method->cost > 0 ) {
|
||||
$method->full_label .= ' — ';
|
||||
|
||||
echo woocommerce_price($method->cost + $method->get_shipping_tax());
|
||||
if ( $method->get_shipping_tax()>0 && !$woocommerce->cart->prices_include_tax ) :
|
||||
echo ' ' . $woocommerce->countries->inc_tax_or_vat();
|
||||
endif;
|
||||
// Append price to label using the correct tax settings
|
||||
if ( $woocommerce->cart->display_totals_ex_tax || ! $woocommerce->cart->prices_include_tax ) {
|
||||
$method->full_label .= woocommerce_price( $method->cost );
|
||||
if ( $method->get_shipping_tax() > 0 && $woocommerce->cart->prices_include_tax ) {
|
||||
$method->full_label .= ' '.$woocommerce->countries->ex_tax_or_vat();
|
||||
}
|
||||
} else {
|
||||
$method->full_label .= woocommerce_price( $method->cost + $method->get_shipping_tax() );
|
||||
if ( $method->get_shipping_tax() > 0 && ! $woocommerce->cart->prices_include_tax ) {
|
||||
$method->full_label .= ' '.$woocommerce->countries->inc_tax_or_vat();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
echo '</option>';
|
||||
// Print a single available shipping method as plain text
|
||||
if ( 1 === count( $available_methods ) ) {
|
||||
|
||||
endforeach;
|
||||
|
||||
echo '</select>';
|
||||
|
||||
else :
|
||||
|
||||
if ( !$woocommerce->customer->get_shipping_country() || !$woocommerce->customer->get_shipping_state() || !$woocommerce->customer->get_shipping_postcode() ) :
|
||||
echo esc_html( $method->full_label );
|
||||
echo '<input type="hidden" name="shipping_method" id="shipping_method" value="'.esc_attr( $method->id ).'">';
|
||||
|
||||
// Show multiple shipping methods in a select list
|
||||
} else {
|
||||
|
||||
echo '<select name="shipping_method" id="shipping_method">';
|
||||
foreach ( $available_methods as $method ) {
|
||||
echo '<option value="'.esc_attr( $method->id ).'" '.selected( $method->id, $_SESSION['_chosen_shipping_method'], false).'>';
|
||||
echo esc_html( $method->full_label );
|
||||
echo '</option>';
|
||||
}
|
||||
echo '</select>';
|
||||
|
||||
}
|
||||
|
||||
// No shipping methods are available
|
||||
} else {
|
||||
|
||||
if ( ! $woocommerce->customer->get_shipping_country() || ! $woocommerce->customer->get_shipping_state() || ! $woocommerce->customer->get_shipping_postcode() ) {
|
||||
echo '<p>'.__('Please fill in your details above to see available shipping methods.', 'woocommerce').'</p>';
|
||||
else :
|
||||
} else {
|
||||
echo '<p>'.__('Sorry, it seems that there are no available shipping methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce').'</p>';
|
||||
endif;
|
||||
|
||||
endif;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?></td>
|
||||
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue