Last active
May 14, 2020 08:08
-
-
Save hedqvist/8c436eeac0cc6fe15be23fe949b8c205 to your computer and use it in GitHub Desktop.
Unifaun - Declaration value before discounts
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 -Unifaun - Set Customs Line Value | |
| * @author Redlight Media AB / Christopher Hedqvist | |
| * @compatible WooCommerce 3.9.0 | |
| */ | |
| function redlight_unifaun_customs_line_value( $line, $shipment, $order, $product, $item ) { | |
| $line['value'] = $item->get_subtotal() - $item->get_subtotal_tax(); | |
| return $line; | |
| } | |
| add_filter('ac_wc_unifaun_shipment_customs_declaration_line', 'redlight_unifaun_customs_line_value', 10, 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment