Switch data_type
This commit is contained in:
parent
1e0ed1d20c
commit
eb45b94edb
|
@ -90,7 +90,7 @@ class WC_Meta_Box_Coupon_Data {
|
||||||
'label' => __( 'Coupon amount', 'woocommerce' ),
|
'label' => __( 'Coupon amount', 'woocommerce' ),
|
||||||
'placeholder' => wc_format_localized_price( 0 ),
|
'placeholder' => wc_format_localized_price( 0 ),
|
||||||
'description' => __( 'Value of the coupon.', 'woocommerce' ),
|
'description' => __( 'Value of the coupon.', 'woocommerce' ),
|
||||||
'data_type' => 'price',
|
'data_type' => 'percent' === $coupon->get_discount_type( 'edit' ) ? 'decimal' : 'price',
|
||||||
'desc_tip' => true,
|
'desc_tip' => true,
|
||||||
'value' => $coupon->get_amount( 'edit' ),
|
'value' => $coupon->get_amount( 'edit' ),
|
||||||
)
|
)
|
||||||
|
|
|
@ -199,7 +199,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
||||||
* @return float
|
* @return float
|
||||||
*/
|
*/
|
||||||
public function get_amount( $context = 'view' ) {
|
public function get_amount( $context = 'view' ) {
|
||||||
return (float) $this->get_prop( 'amount', $context );
|
return wc_format_decimal( $this->get_prop( 'amount', $context ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue