Created
May 2, 2023 10:50
-
-
Save hedqvist/ec404ce0435e81d7c4052a1896017c30 to your computer and use it in GitHub Desktop.
nShift - DoorCode
This file contains hidden or 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 | |
/** | |
* @snippet WooCommerce - Sets customer note as deliveryInstruction in Unifaun | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 7.5.0 | |
*/ | |
function redlight_unifaun_customer_portkod( $shipment, $order ) { | |
// How to add Custom DoorCode | |
if(!empty( $order->get_meta('portkod') ) ){ | |
$shipment['receiver']['doorCode'] = $order->get_meta('portkod'); | |
$shipment['doorCode'] = $order->get_meta('portkod'); | |
} | |
return $shipment; | |
} | |
add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_customer_portkod', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment