Mailchimp Banner | Q2 2024

added by Latoya

Product Icon

WooCommerce Shipping

by  Woo
Print USPS and DHL labels right from your WooCommerce dashboard and instantly save on shipping. WooCommerce Shipping is free to use and saves you time and money.

Validate Address, Before Submit and Hide Shipping Methods if Po Box Shipping is Unavailable

customer->get_shipping_address_1() ) ) ? $woocommerce->customer->get_shipping_address_1() : $woocommerce->customer->get_billing_address_1();
$postcode = ( !empty( $woocommerce->customer->get_shipping_postcode() ) ) ? $woocommerce->customer->get_shipping_postcode() : $woocommerce->customer->get_billing_postcode();
$replace = array(” “, “.”, “,”);
$address2 = strtolower( str_replace( $replace, ”, $address ) );
if ( strstr( $address2, ‘pobox’ ) ) {
foreach ($available_shipping_methods as $shipping_method => $value) {
if( strpos( $shipping_method, $shipping_method_to_hide, $shipping_method_to_hides ) !== false ) {
unset($available_shipping_methods[$shipping_method]);
}
}
}
return $available_shipping_methods;
}
?>

Author

Current Status

Open

Last updated: March 24, 2021

0 comments

Log in to comment on this feature request.