Important

Okay
  Public Ticket #1495311
admin 'division by 0' error when product in quote has price of $0.00
Closed

Comments

  • Rich Samartino started the conversation

    I'm getting the attached error, 'division by 0' when trying to view a quotation in the backend at Sales > Quotations that contains a product with a price of $0. If the quotation contains only products that have a price, I can view the quotation no problem. I'm using the 2.2.x version of the extension with Magento Commerce 2.2.2 .

  •  1,319
    Land of replied

    Hello Rich,

    Have a nice day!

    Thanks you for your report!

    We resolved it on the latest module version. It was updated the check code for zero value of product price as this:


    <?php
              $base_price = (float)$base_price;
            if($base_price && $base_price > 0) {
             $gp_margin = round((($custom_price - $base_price)/$base_price)*100);
             echo $gp_margin."%"; 
          }
        ?>


  • Rich Samartino replied

    Ok thanks, I'll make sure I have the latest version installed.

  •  1,319
    Land of replied

    Hello Rich,

    Please try to download the module file again on our site. We updated the module version to 1.0.3 (just same file name on download page). 

    Then upload module files and update it for your site.

  • Rich Samartino replied

    will do, thanks