Created
August 10, 2021 20:58
-
-
Save jrick1229/542dfbaefb75e57f23cdcfa36e61c254 to your computer and use it in GitHub Desktop.
Notice in cart that all shipping options may not show until address is entered in during checkout.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_cart_totals_before_shipping', 'local_pickup_order_comment_validation' ); | |
function local_pickup_order_comment_validation() { | |
$chosen_shipping = WC()->session->get( 'chosen_shipping_methods' )[0]; | |
$chosen_shipping = explode(':', $chosen_shipping); | |
if ( $chosen_shipping[0] == 'local_pickup' ){ | |
echo '<p style="font-weight:bold;border:1px solid #000;padding:4px;">Address must be entered into checkout for more shipping options.</p>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment