Created
September 8, 2020 11:56
-
-
Save hedqvist/5f08f9573d211a63c5259eb1b63c309b to your computer and use it in GitHub Desktop.
Unifaun - PreNOT
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
<?php | |
/** | |
* @snippet WooCommerce - Adds ADDON to Shipment | |
* @author Redlight Media AB / Christopher Hedqvist | |
* @compatible WooCommerce 4.2.0 | |
*/ | |
function redlight_unifaun_prenot( $shipment, $order ) { | |
// Only PUA and 'Varubrev - Lämnas vid dörr' | |
if( 'P19' === $shipment['service']['id'] ){ | |
$shipment['service']['addons'][] = array( | |
'id' => 'PRENOT' | |
); | |
} | |
return $shipment; | |
} | |
add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_prenot', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment