-
-
Save laurikar/d7d62e95d979266d6959018ca0df7726 to your computer and use it in GitHub Desktop.
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_filter( 'wc_shipit_shipment_body', 'snippet_shipit_receiver_info', 10, 2 ); | |
function snippet_shipit_receiver_info( $body, $order ) { | |
$shipping_phone = get_post_meta( $order->get_id(), '_shipping_phone', true ); // voi olla myös shipping_phone eli ilman alaviivaa | |
$shipping_email = get_post_meta( $order->get_id(), '_shipping_email', true ); // voi olla myös shipping_email eli ilman alaviivaa | |
if ( $shipping_phone ) { | |
$body['receiver']['phone'] = $shipping_phone; | |
} | |
if ( $shipping_email ) { | |
$body['receiver']['email'] = $shipping_email; | |
} | |
return $body; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment