Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Created October 22, 2020 06:59
Show Gist options
  • Save hedqvist/28c2dfb84bab9745d63fce01e55f3d81 to your computer and use it in GitHub Desktop.
Save hedqvist/28c2dfb84bab9745d63fce01e55f3d81 to your computer and use it in GitHub Desktop.
Unifaun - Schenker Return Print
<?
/**
* @snippet WooCommerce - Adds ADDON to Shipment
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.9.0
*/
function redlight_unifaun_bhp_return_print( $shipment, $order ) {
// Only Schenker Ombud
if( 'BHP' === $shipment['service']['id'] ){
$shipment['service']['addons'][] = array(
'id' => 'RETPP',
'misc' => 'PRINT'
);
}
return $shipment;
}
add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_bhp_return_print', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment