Last active
June 8, 2022 16:01
-
-
Save J-H-Mojumder/d4f91467f81058ac50d5382aa23796c2 to your computer and use it in GitHub Desktop.
Show the shipping method description for local pickup so that the vendor can show the address in the check out page
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_after_shipping_rate' , 'function_to_show_description_for_local_pickup' ); | |
function function_to_show_description_for_local_pickup($method){ | |
if( array_key_exists( "description" , $method->meta_data ) ){ | |
if ( ( $method->id == "local_pickup:4") ){ | |
echo "</br><strong> Address: </strong>".$method->meta_data['description']; | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment