From 4acf8b80cd5e186223faad555a4b8309b4707b2b Mon Sep 17 00:00:00 2001 From: nishitlangaliya Date: Wed, 31 Oct 2018 21:32:31 +0530 Subject: [PATCH 1/2] fix: Manually adding fee on order generate html code --- includes/admin/meta-boxes/views/html-order-fee.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/meta-boxes/views/html-order-fee.php b/includes/admin/meta-boxes/views/html-order-fee.php index d5f3945d028..e4a8b36e289 100644 --- a/includes/admin/meta-boxes/views/html-order-fee.php +++ b/includes/admin/meta-boxes/views/html-order-fee.php @@ -15,10 +15,10 @@ if ( ! defined( 'ABSPATH' ) ) {
- get_name() ? $item->get_name() : __( 'Fee', 'woocommerce' ) ); ?> + get_name() ? $item->get_name() : __( 'Fee', 'woocommerce' ) ); ?>
From b7cf72d626c35a37d705e458fc3ae7f26afb7104 Mon Sep 17 00:00:00 2001 From: nishitlangaliya Date: Sat, 3 Nov 2018 00:19:30 +0530 Subject: [PATCH 2/2] fix: save fee name without html from base source --- includes/admin/meta-boxes/views/html-order-fee.php | 4 ++-- includes/class-wc-ajax.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/admin/meta-boxes/views/html-order-fee.php b/includes/admin/meta-boxes/views/html-order-fee.php index e4a8b36e289..d5f3945d028 100644 --- a/includes/admin/meta-boxes/views/html-order-fee.php +++ b/includes/admin/meta-boxes/views/html-order-fee.php @@ -15,10 +15,10 @@ if ( ! defined( 'ABSPATH' ) ) {
- get_name() ? $item->get_name() : __( 'Fee', 'woocommerce' ) ); ?> + get_name() ? $item->get_name() : __( 'Fee', 'woocommerce' ) ); ?>
diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 51500c6c916..50c42247b77 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -944,7 +944,7 @@ class WC_AJAX { $fee = new WC_Order_Item_Fee(); $fee->set_amount( $amount ); $fee->set_total( $amount ); - $fee->set_name( sprintf( __( '%s fee', 'woocommerce' ), $formatted_amount ) ); + $fee->set_name( sprintf( __( '%s fee', 'woocommerce' ), wc_clean( $formatted_amount ) ) ); $order->add_item( $fee ); $order->calculate_taxes( $calculate_tax_args );