Open rafaelcalero opened 4 years ago
Describe the bug Discount assigned to role doesn't work if you do not have a general discount on the product (no role).
To Reproduce Steps to reproduce the behavior:
Expected behavior They should appear in the format wc_format_sale_price()
wc_format_sale_price()
Additional context
The problem seems to be in the WooCommerce_Role_Based_Price_Product_Pricing->get_price_html_wc3();
WooCommerce_Role_Based_Price_Product_Pricing->get_price_html_wc3();
$product->is_on_sale() returns false because for wordpress that product is not on sale.
... } else if( $product->is_on_sale() && $prices['min_reg_price'] === $prices['max_reg_price'] ) { $price = wc_format_sale_price(wc_price($prices['max_reg_price']), wc_price($prices['min_price'])); } else { ....
A possible fix could be add filter on the woocommerce_product_is_on_sale hook and modify this value for products that they have different regular and sale price or perhaps put one more condition in that same function.
woocommerce_product_is_on_sale
Regards
Describe the bug Discount assigned to role doesn't work if you do not have a general discount on the product (no role).
To Reproduce Steps to reproduce the behavior:
Expected behavior They should appear in the format
wc_format_sale_price()
Additional context
The problem seems to be in the
WooCommerce_Role_Based_Price_Product_Pricing->get_price_html_wc3();
$product->is_on_sale() returns false because for wordpress that product is not on sale.
A possible fix could be add filter on the
woocommerce_product_is_on_sale
hook and modify this value for products that they have different regular and sale price or perhaps put one more condition in that same function.Regards