Skip to content

Commit

Permalink
POST is not needed here; form never updates
Browse files Browse the repository at this point in the history
Fixes #11006
  • Loading branch information
mikejolley committed May 31, 2016
1 parent b8d76ba commit da2337b
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions templates/checkout/form-shipping.php
Expand Up @@ -24,22 +24,9 @@
<div class="woocommerce-shipping-fields">
<?php if ( true === WC()->cart->needs_shipping_address() ) : ?>

<?php
if ( empty( $_POST ) ) {

$ship_to_different_address = get_option( 'woocommerce_ship_to_destination' ) === 'shipping' ? 1 : 0;
$ship_to_different_address = apply_filters( 'woocommerce_ship_to_different_address_checked', $ship_to_different_address );

} else {

$ship_to_different_address = $checkout->get_value( 'ship_to_different_address' );

}
?>

<h3 id="ship-to-different-address">
<label for="ship-to-different-address-checkbox" class="checkbox"><?php _e( 'Ship to a different address?', 'woocommerce' ); ?></label>
<input id="ship-to-different-address-checkbox" class="input-checkbox" <?php checked( $ship_to_different_address, 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" />
<input id="ship-to-different-address-checkbox" class="input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" />
</h3>

<div class="shipping_address">
Expand Down

0 comments on commit da2337b

Please sign in to comment.