prevented some errors when the order has no taxes

This commit is contained in:
claudiosmweb 2014-07-28 10:59:55 -03:00
parent fda7a5565c
commit 7c141fcd41
1 changed files with 7 additions and 1 deletions

View File

@ -579,6 +579,12 @@ function wc_create_refund( $args = array() ) {
if ( empty( $refund_item['qty'] ) && empty( $refund_item['refund_total'] ) && empty( $refund_item['refund_tax'] ) ) {
continue;
}
// Prevents errors when the order has no taxes
if ( ! isset( $refund_item['refund_tax'] ) ) {
$refund_item['refund_tax'] = array();
}
switch ( $order_items[ $refund_item_id ]['type'] ) {
case 'line_item' :
$args = array(