Skip to content

Instantly share code, notes, and snippets.

@sandeepwisetr
Created February 7, 2020 09:28
Show Gist options
  • Save sandeepwisetr/a8a0fa4d5b5e1f2083e052755b5ab578 to your computer and use it in GitHub Desktop.
Save sandeepwisetr/a8a0fa4d5b5e1f2083e052755b5ab578 to your computer and use it in GitHub Desktop.
This snippet belong to fluxair site
add_action( 'wfacp_before_process_checkout_template_loader', function () {
add_filter( 'woocommerce_no_shipping_available_html', function ( $message ) {
if ( 39648 !== WFACP_Common::get_id() ) {
return $message;
}
$packages = WC()->shipping()->get_packages();
$postcode = $_REQUEST['s_postcode'];
if ( count( $packages['rates'] ) == 0 && '' == $postcode ) {
return WFACP_Common::default_shipping_placeholder_text();
} else if ( count( $packages['rates'] ) == 0 && '' !== $postcode ) {
return $message;
}
return $message;
} );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment