From 9302f3ac6d3c4366b85fc665ca0b82150d70f596 Mon Sep 17 00:00:00 2001 From: Mehul Date: Wed, 10 Feb 2016 15:32:34 +0530 Subject: [PATCH] template_html & template_plain variables duplicate code in both if and else conditions when there is no change in template files for partial refund or full refund --- includes/emails/class-wc-email-customer-refunded-order.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/emails/class-wc-email-customer-refunded-order.php b/includes/emails/class-wc-email-customer-refunded-order.php index 923a5f62bd3..f4b23c33936 100644 --- a/includes/emails/class-wc-email-customer-refunded-order.php +++ b/includes/emails/class-wc-email-customer-refunded-order.php @@ -60,12 +60,13 @@ class WC_Email_Customer_Refunded_Order extends WC_Email { $this->heading_full = $this->get_option( 'heading_full', __( 'Your order has been fully refunded', 'woocommerce' ) ); $this->heading_partial = $this->get_option( 'heading_partial', __( 'Your order has been partially refunded', 'woocommerce' ) ); + $this->template_html = 'emails/customer-refunded-order.php'; + $this->template_plain = 'emails/plain/customer-refunded-order.php'; + if ( $partial_refund ) { $this->id = 'customer_partially_refunded_order'; $this->title = __( 'Partially Refunded order', 'woocommerce' ); $this->description = __( 'Order partially refunded emails are sent to customers when their orders are partially refunded.', 'woocommerce' ); - $this->template_html = 'emails/customer-refunded-order.php'; - $this->template_plain = 'emails/plain/customer-refunded-order.php'; $this->heading = $this->heading_partial; $this->subject = $this->subject_partial; } @@ -73,8 +74,6 @@ class WC_Email_Customer_Refunded_Order extends WC_Email { $this->id = 'customer_refunded_order'; $this->title = __( 'Refunded order', 'woocommerce' ); $this->description = __( 'Order refunded emails are sent to customers when their orders are marked refunded.', 'woocommerce' ); - $this->template_html = 'emails/customer-refunded-order.php'; - $this->template_plain = 'emails/plain/customer-refunded-order.php'; $this->heading = $this->heading_full; $this->subject = $this->subject_full; }