Created
June 17, 2024 13:25
-
-
Save dennisnissle/939e98a13c8b37b07a64930e7e64436e to your computer and use it in GitHub Desktop.
Use a different GLS contact id based on shipment data
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( 'woocommerce_gzd_gls_label_api_request', function( $request, $label ) { | |
if ( $shipment = $label->get_shipment() ) { | |
$country = $shipment->get_country(); | |
if ( 'AT' === $country ) { | |
$request['Shipment']['Shipper']['ContactID'] = '12345'; | |
} | |
} | |
return $request; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment