Ship to billing default option

This commit is contained in:
Mike Jolley 2011-11-28 16:20:39 +00:00
parent c4407d1b6f
commit 21f9723479
3 changed files with 19 additions and 1 deletions

View File

@ -107,6 +107,14 @@ $woocommerce_settings['general'] = apply_filters('woocommerce_general_settings',
'checkboxgroup' => ''
),
array(
'desc' => __( '"Ship to same address option" checked by default', 'woothemes' ),
'id' => 'woocommerce_ship_to_same_address',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Show order comments section', 'woothemes' ),
'id' => 'woocommerce_enable_order_comments',

View File

@ -220,7 +220,16 @@ class woocommerce_checkout {
// Shipping Details
if ($woocommerce->cart->needs_shipping() && !$woocommerce->cart->ship_to_billing_address_only()) :
if (!isset($_POST) || !$_POST) $shiptobilling = apply_filters('woocommerce_shiptobilling_default', 1); else $shiptobilling = $this->get_value('shiptobilling');
if (!isset($_POST) || !$_POST) :
$shiptobilling = (get_option('woocommerce_ship_to_same_address')=='yes') ? 1 : 0;
$shiptobilling = apply_filters('woocommerce_shiptobilling_default', $shiptobilling);
else :
$shiptobilling = $this->get_value('shiptobilling');
endif;
echo '<p class="form-row" id="shiptobilling"><input class="input-checkbox" '.checked($shiptobilling, 1, false).' type="checkbox" name="shiptobilling" value="1" /> <label for="shiptobilling" class="checkbox">'.__('Ship to same address?', 'woothemes').'</label></p>';

View File

@ -113,6 +113,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
* Added settings API to be used by Shipping Methods and Payment Gateways
* Free shipping/Flat rate uses setting API
* Free shipping coupons
* Ship to billing default option
= 1.2.4 - 18/11/2011 =
* More sale price logic fixes for variations. Now correctly compares variation's prices.