Created
March 7, 2020 12:39
-
-
Save hedqvist/4ed37b5e13b50e3ac96fb9f8f59a7be8 to your computer and use it in GitHub Desktop.
Unifaun - MyPack over 1500
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 - Change Service to MyPack Collect if order total over 1500 | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_mypack_over_1500( $shipment, $order ) { | |
| if($order->get_total() > 1500 ){ | |
| $shipment['service']['id'] = 'P19'; | |
| } | |
| return $shipment; | |
| } | |
| add_filter('ac_wc_unifaun_shipment_data', 'redlight_unifaun_mypack_over_1500', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment