Fix - Javascript show/hide of option in free shipping method.
This commit is contained in:
parent
9e574ab4d4
commit
bc87f4a47e
|
@ -46,6 +46,18 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method {
|
|||
* @return array
|
||||
*/
|
||||
public function get_instance_form_fields() {
|
||||
wc_enqueue_js( "
|
||||
jQuery( function( $ ) {
|
||||
$('#woocommerce_free_shipping_requires').change(function(){
|
||||
if ( $(this).val() === 'coupon' || $(this).val() === '' ) {
|
||||
$('#woocommerce_free_shipping_min_amount').closest('tr').hide();
|
||||
} else {
|
||||
$('#woocommerce_free_shipping_min_amount').closest('tr').show();
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
" );
|
||||
|
||||
return array(
|
||||
'title' => array(
|
||||
'title' => __( 'Title', 'woocommerce' ),
|
||||
|
@ -76,18 +88,6 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method {
|
|||
'desc_tip' => true
|
||||
)
|
||||
);
|
||||
|
||||
wc_enqueue_js( "
|
||||
jQuery( function( $ ) {
|
||||
$('#woocommerce_free_shipping_requires').change(function(){
|
||||
if ( $(this).val() === 'coupon' || $(this).val() === '' ) {
|
||||
$('#woocommerce_free_shipping_min_amount').closest('tr').hide();
|
||||
} else {
|
||||
$('#woocommerce_free_shipping_min_amount').closest('tr').show();
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
" );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -167,6 +167,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
|
|||
* Fix - wp_cache_flush after term meta migration/update.
|
||||
* Fix - wc_add_to_cart_message() when non-array is passed.
|
||||
* Fix - woocommerce_redirect_single_search_result type check was incorrect.
|
||||
* Fix - Javascript show/hide of option in free shipping method.
|
||||
* Tweak - Made customer pay link display if order needs_payment() rather than checking pending status.
|
||||
* Tweak - Zones - Wording clarifications.
|
||||
* Tweak - Zones - Match zones with postcodes but no country.
|
||||
|
|
Loading…
Reference in New Issue