Home Forums WoodMart support forum Issues with WooCommerce Prices By User Role plugin

Issues with WooCommerce Prices By User Role plugin

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #529420

    bathorimatyas
    Participant

    <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!

    #529429

    bathorimatyas
    Participant

    Please fix the issue like this in the patcher!

    #529431

    bathorimatyas
    Participant

    $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.

    #529533

    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.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Issues with WooCommerce Prices By User Role plugin’ is closed to new replies.