Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Last active May 14, 2020 08:08
Show Gist options
  • Select an option

  • Save hedqvist/8c436eeac0cc6fe15be23fe949b8c205 to your computer and use it in GitHub Desktop.

Select an option

Save hedqvist/8c436eeac0cc6fe15be23fe949b8c205 to your computer and use it in GitHub Desktop.
Unifaun - Declaration value before discounts
<?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