Last active
March 5, 2021 12:11
-
-
Save hedqvist/ee46de779cdef3ab2f820c0fab3ebe42 to your computer and use it in GitHub Desktop.
Unifaun - Set Dimensions
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_dimensions( $shipment, $order) { | |
| if( 'AIRMEE' === $shipment['service']['id'] ){ | |
| foreach( $shipment['parcels'] as $i => $parcel ) { | |
| $shipment['parcels'][$i]['length'] = 150; | |
| $shipment['parcels'][$i]['width'] = 150; | |
| $shipment['parcels'][$i]['height'] = 150; | |
| } | |
| } | |
| return $shipment; | |
| } | |
| add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_dimensions', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment