Plugin Directory

Changeset 3453175


Ignore:
Timestamp:
02/03/2026 06:50:51 PM (2 months ago)
Author:
aescobar0
Message:

1.0.7: Added Taxes in discount and shipping

Location:
zafepay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zafepay/tags/1.0.7/includes/class-wc-gateway-zafepay.php

    r3453123 r3453175  
    132132      $email = $email ? $email : 'no_email@zafepay.com';
    133133
    134       // Discounts: total and coupon codes
    135       $discount_total = (int) number_format((float) $order->get_discount_total(), 0, ',', '');
     134      $discount_total = (int) round(
     135        (float) $order->get_discount_total() + (float) $order->get_discount_tax(),
     136        0
     137      );
    136138      $coupon_codes = $order->get_coupon_codes();
    137139
    138       // Shipping: total cost and method(s)
    139       $shipping_total = (int) number_format((float) $order->get_shipping_total(), 0, ',', '');
     140      $shipping_total = (int) number_format((float) $order->get_shipping_total(), 0, ',', '') + (int) number_format((float) $order->get_shipping_tax(), 0, ',', '');
    140141      $shipping_methods = array();
    141142      foreach ($order->get_items('shipping') as $item_id => $shipping_item) {
  • zafepay/trunk/includes/class-wc-gateway-zafepay.php

    r3453123 r3453175  
    132132      $email = $email ? $email : 'no_email@zafepay.com';
    133133
    134       // Discounts: total and coupon codes
    135       $discount_total = (int) number_format((float) $order->get_discount_total(), 0, ',', '');
     134      $discount_total = (int) round(
     135        (float) $order->get_discount_total() + (float) $order->get_discount_tax(),
     136        0
     137      );
    136138      $coupon_codes = $order->get_coupon_codes();
    137139
    138       // Shipping: total cost and method(s)
    139       $shipping_total = (int) number_format((float) $order->get_shipping_total(), 0, ',', '');
     140      $shipping_total = (int) number_format((float) $order->get_shipping_total(), 0, ',', '') + (int) number_format((float) $order->get_shipping_tax(), 0, ',', '');
    140141      $shipping_methods = array();
    141142      foreach ($order->get_items('shipping') as $item_id => $shipping_item) {
Note: See TracChangeset for help on using the changeset viewer.