Issues with WooCommerce Prices By User Role plugin
-
<b>Fatal error</b>: Uncaught DivisionByZeroError: Division by zero in /home/vidastoycandy/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/template-tags.php:1379
Since your latest Woodmart update i have the issue on my website.
Can i rollback the theme somehow?
WooCommerce Prices By User Role
https://codecanyon.net/item/woocommerce-prices-by-user-role/8562616
I need to use this plugin, how to fix the issue!?
Please help!
Please fix the issue like this in the patcher!
$percentage = round( ( ( (float) $product->get_regular_price() – (float) $product->get_sale_price() ) / (float) $product->get_regular_price() ) * 100 );
FIXED WITH THIS:
$regular_price = (float) $product->get_regular_price();
$sale_price = (float) $product->get_sale_price();
if ($regular_price != 0) {
$percentage = round((($regular_price – $sale_price) / $regular_price) * 100);
} else {
// Kezelje le a nullával való osztás esetét, például állítsa be az eredményt valamilyen alapértelmezett értékre.
$percentage = 0; // vagy más alapértelmezett érték
}
// Most $percentage értéke érvényes és nem okoz nullás osztást.
Hello,
You are Most Welcome.
We are glad that you managed to solve the problem yourself. You are Great!!!
Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.
Have a wonderful day.
Topic Closed.
Best Regards.
The topic ‘Issues with WooCommerce Prices By User Role plugin’ is closed to new replies.