Sale Badge showing -100% when I have -50% with Woocommerce Dynamic Pricing.
-
Sale Badge is showing -100% when I have -50% discount set with Woocommerce Dynamic Pricing. The prices seem to calculate correctly. I don’t have any “badge”-plugins so I assume that it is Basel that calculate and render this badge.
What to do?
/Magnus
Attachments:
You must be
logged in to view attached files.
Hi,
It seems that this plugin change default WooCommerce prices values. Could you please provide us your FTP access so we can check if it is possible to fix this problem?
Regards
Hi. I just discovered another design “problem”. (ftp settings in private area)
I think i can patch this problem with CSS by abusing the :before and content settings so no need to find quick fix now, but I would appreciate that you address the problem in upcoming releases.
When having variable products the label only say SALE and I understand the logic in this as it’s possible to have many different discounts on the individual SKUs. It would of course be cool if the theme iterated through the SKUs and calculated the percentage (or percentage range)
The simple fix is to skip the percentage and go with Sale everywhere. This is what Woo’s Storefront does and it seem pretty fail safe. It would be ok for us at least.
Hi again. I understand why the problem appear now and I have hard coded a fix so I’m ok for now. Just gotta get through the Black Friday sale.
Ugly I know 🙂
if ( $percentage && basel_get_opt( 'percentage_label' ) ) {
// Just a quick fix to stop it from showing the wrong percentage
// $output[] = '<span class="onsale product-label">-' . $percentage . '%' . '</span>';
$output[] = '<span class="onsale product-label">' . esc_html__( 'Sale', 'basel' ) . '</span>';
}else{
$output[] = '<span class="onsale product-label">' . esc_html__( 'Sale', 'basel' ) . '</span>';
}
Hello,
We are glad that you found the solution. We investigated this problem too and noticed that this plugin rewrite WooCommerce function $product->get_sale_price();
and it always returns an empty value. That is why the percentage is always 100%.
Regards