Use extra_data
This commit is contained in:
parent
c06c357399
commit
1fdfd02766
|
@ -21,17 +21,24 @@ class WC_Order_Refund extends WC_Abstract_Order {
|
|||
*/
|
||||
protected $data_store_name = 'order-refund';
|
||||
|
||||
/**
|
||||
* Stores product data.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $extra_data = array(
|
||||
'amount' => '',
|
||||
'reason' => '',
|
||||
'refunded_by' => 0,
|
||||
);
|
||||
|
||||
/**
|
||||
* Extend the abstract _data properties and then read the order object.
|
||||
*
|
||||
* @param int|object|WC_Order $read Order to init.
|
||||
*/
|
||||
public function __construct( $read = 0 ) {
|
||||
$this->data = array_merge( $this->data, array(
|
||||
'amount' => '',
|
||||
'reason' => '',
|
||||
'refunded_by' => 0,
|
||||
) );
|
||||
$this->data = array_merge( $this->data, $this->extra_data );
|
||||
parent::__construct( $read );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue