Fix bulk sale/regular price percentage handling

This commit is contained in:
claudiulodro 2018-02-02 10:52:24 -08:00
parent 8579c1fecc
commit 680b8b6b01
1 changed files with 8 additions and 2 deletions

View File

@ -511,7 +511,10 @@ class WC_Admin_Post_Types {
if ( ! empty( $_REQUEST['change_regular_price'] ) && isset( $_REQUEST['_regular_price'] ) ) { // WPCS: input var ok, sanitization ok.
$change_regular_price = absint( $_REQUEST['change_regular_price'] ); // WPCS: input var ok, sanitization ok.
$regular_price = wc_format_decimal( wc_clean( wp_unslash( $_REQUEST['_regular_price'] ) ) ); // WPCS: input var ok, sanitization ok.
$regular_price = wc_clean( wp_unslash( $_REQUEST['_regular_price'] ) ); // WPCS: input var ok, sanitization ok.
if ( ! strstr( $regular_price, '%' ) ) {
$regular_price = wc_format_decimal( $regular_price );
}
switch ( $change_regular_price ) {
case 1:
@ -547,7 +550,10 @@ class WC_Admin_Post_Types {
if ( ! empty( $_REQUEST['change_sale_price'] ) && isset( $_REQUEST['_sale_price'] ) ) { // WPCS: input var ok, sanitization ok.
$change_sale_price = absint( $_REQUEST['change_sale_price'] ); // WPCS: input var ok, sanitization ok.
$sale_price = wc_format_decimal( wc_clean( wp_unslash( $_REQUEST['_sale_price'] ) ) ); // WPCS: input var ok, sanitization ok.
$sale_price = wc_clean( wp_unslash( $_REQUEST['_sale_price'] ) ); // WPCS: input var ok, sanitization ok.
if ( ! strstr( $sale_price, '%' ) ) {
$sale_price = wc_format_decimal( $sale_price );
}
switch ( $change_sale_price ) {
case 1: