Created
October 14, 2016 17:27
-
-
Save WooForce/60a28eadb503da725d6e7397f3faceb6 to your computer and use it in GitHub Desktop.
DHL Paket - alter createshipment data
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
add_filter('wf_dhl_paket_create_shipment_request', 'wf_dhl_paket_modify_shipment_request', 10, 2); | |
function wf_dhl_paket_modify_shipment_request($request, $order){ | |
$street_parts = explode(" ",$order->shipping_address_1); | |
$request['ShipmentOrder']['Shipment']['Receiver']['Address']['streetName'] = current($street_parts); | |
$request['ShipmentOrder']['Shipment']['Receiver']['Address']['streetNumber']= end($street_parts); | |
$request['ShipmentOrder']['Shipment']['Receiver']['Address']['addressAddition']= $order->shipping_address_2; | |
return $request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment