Created
August 11, 2020 13:22
-
-
Save hedqvist/630bfaf22dfda7920aa938d06dda07b9 to your computer and use it in GitHub Desktop.
Unifaun - Force 250g on all parcels
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
| /** | |
| * @snippet WooCommerce - Sets Weight on Parcels (Overwrites weight total) | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 4.4.0 | |
| */ | |
| function redlight_unifaun_parcel_weight( $shipment, $order) { | |
| foreach( $shipment['parcels'] as $i => $parcel ) { | |
| $shipment['parcels'][$i]['weight'] = 0.250; | |
| } | |
| return $shipment; | |
| } | |
| add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_parcel_weight', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment