Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Created August 24, 2020 08:41
Show Gist options
  • Save hedqvist/9c17eade9b0b118c8a1114a468bd8f62 to your computer and use it in GitHub Desktop.
Save hedqvist/9c17eade9b0b118c8a1114a468bd8f62 to your computer and use it in GitHub Desktop.
Unifaun - SecurityDeclaration
<?php
/**
* @snippet WooCommerce -Unifaun - Set Customs Security printset
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.9.0
*/
function redlight_unifaun_customs_security( $customsDeclaration, $shipment, $order_id) {
//$order = new WC_Order($order_id);
if( 'BREKI' === $shipment['service']['id'] ){
$customsDeclaration['printSet'] = ['SECURITY'];
}
return $customsDeclaration;
}
add_filter('ac_wc_unifaun_shipment_customs_declaration', 'redlight_unifaun_customs_security', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment