WC_Order::get_remaining_refund_amount PHP Method

get_remaining_refund_amount() public method

How much money is left to refund?
    public function get_remaining_refund_amount()
    {
        return wc_format_decimal($this->get_total() - $this->get_total_refunded(), wc_get_price_decimals());
    }

Usage Example

Beispiel #1
0
 /**
  * Check whether a refund is made in full.
  *
  * @param WC_Order $order Order object
  *
  * @return bool True if order is fully refunded, False otherwise
  */
 public function isFullyRefunded($order)
 {
     if (!empty($order) && $order->get_remaining_refund_amount() > 0 || !empty($order) && $order->has_free_item() && $order->get_remaining_refund_items() > 0) {
         // Order partially refunded
         return false;
     } else {
         // Order fully refunded
         return true;
     }
 }
All Usage Examples Of WC_Order::get_remaining_refund_amount
WC_Order