wordpress - WooCommerce reverse behavior of Ship to different address checkbox? -


i'd reverse behavior of "ship different address" checkbox on checkout page. when checked, shipping form goes hide , billing form takes information. found , changed line in checkout.js

$( 'div.shipping_address' ).hide(); if ( $( ).is( ':checked' ) ) {     $( 'div.shipping_address' ).slidedown(); } 

to

$( 'div.shipping_address' ).slidedown(); if ( $( ).is( ':checked' ) ) {     $( 'div.shipping_address' ).hide(); } 

it works fine (display reverse) when place order shipping-form data updating. how fix it?

below code prevent updating shipping-form data during place order

add_action('woocommerce_checkout_fields', 'woo_optional_fields');     function woo_optional_fields($wccheckout_fields) {         if(//check shipping condition here){                    //unset shipping fields manually here..!!!             unset($wccheckout_fields['shipping']['your_all_shipping_fields']);         }     } 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -