Skip to content

Instantly share code, notes, and snippets.

@J-H-Mojumder
Last active June 8, 2022 16:01
Show Gist options
  • Save J-H-Mojumder/d4f91467f81058ac50d5382aa23796c2 to your computer and use it in GitHub Desktop.
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
<? 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