Created
March 8, 2019 08:29
-
-
Save hedqvist/acee9fcc417998c31bfe4d8ca8c71365 to your computer and use it in GitHub Desktop.
Angry Creative Unifaun - Schenker Dimensions on Parcel
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 Dimensions to Schenker Parcel | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.5.3 | |
| */ | |
| function redlight_unifaun_schenker_dimensions( $shipment, $order) { | |
| if( 'BHP' === $shipment['service']['id'] ){ | |
| foreach( $shipment['parcels'] as $i => $parcel ) { | |
| $shipment['parcels'][$i]['length'] = 240; | |
| $shipment['parcels'][$i]['width'] = 190; | |
| $shipment['parcels'][$i]['height'] = 90; | |
| } | |
| } | |
| return $shipment; | |
| } | |
| add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_schenker_dimensions', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment