Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Created October 28, 2020 13:42
Show Gist options
  • Save hedqvist/5aedf4dcb204828a5936dce768b8f4d8 to your computer and use it in GitHub Desktop.
Save hedqvist/5aedf4dcb204828a5936dce768b8f4d8 to your computer and use it in GitHub Desktop.
Unifaun - Best Transport NoSIGN
<?php
/**
* @snippet WooCommerce - Adds ADDON to Shipment
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 4.0.1
*/
function redlight_unifaun_best_nosign( $shipment, $order ) {
// Only Best Hemleverans SMALL
if( 'BESTHLE' === $shipment['service']['id'] ){
$shipment['service']['addons'][] = array(
'id' => 'NOSIGN'
);
}
return $shipment;
}
add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_best_nosign', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment