Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1.  
  2. /**
  3. * Unset Fee tax for partial amount
  4. * @param array $fee_taxes
  5. * @param object $fee
  6. * @return array
  7. */
  8. public function woocommerce_cart_totals_get_fees_from_cart_taxes($fee_taxes, $fee) {
  9. if ('_via_wallet_partial_payment' === $fee->object->id) {
  10. $cart_total = abs($fee->total + array_sum( $fee_taxes )) ;
  11. $wallet_total = abs($fee->object->amount)*100;
  12. if($cart_total > $wallet_total) $fee->total = -1*$wallet_total ;
  13. else $fee->total = -1*$cart_total;
  14. $fee_taxes = array();
  15. }
  16. return $fee_taxes;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement