WC_Order::get_total_refunded PHP Method

get_total_refunded() public method

Get amount already refunded.
Since: 2.2
public get_total_refunded ( ) : string
return string
    public function get_total_refunded()
    {
        return $this->data_store->get_total_refunded($this);
    }

Usage Example

 /**
  * Get the total amount with or without refunds
  * @return string
  */
 public function get_total()
 {
     $total = '';
     if ($this->order->get_total_refunded() > 0) {
         $total_after_refund = $this->order->get_total() - $this->order->get_total_refunded();
         $total = '<del class="total-without-refund">' . strip_tags($this->order->get_formatted_order_total()) . '</del> <ins>' . wc_price($total_after_refund, array('currency' => $this->order->get_order_currency())) . '</ins>';
     } else {
         $total = $this->order->get_formatted_order_total();
     }
     return $total;
 }
All Usage Examples Of WC_Order::get_total_refunded
WC_Order