Title: Uncaught DivisionByZeroError
Last modified: October 23, 2024

---

# Uncaught DivisionByZeroError

 *  [Dessi Cubbex](https://wordpress.org/support/users/dessicubbex/)
 * (@dessicubbex)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/uncaught-divisionbyzeroerror-2/)
 *     ```wp-block-code
       // Version 3.3.1PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /wp-content/plugins/woo-postfinance-checkout/includes/service/class-wc-postfinancecheckout-service-line-item.php:350// Version 3.2.0 - 3.3.0PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /wp-content/plugins/woo-postfinance-checkout/includes/service/class-wc-postfinancecheckout-service-line-item.php:345
       ```
   
 * If I add a coupon on the checkout page that makes the total payment 0 it will
   show the error above.
   I had to rolback to version 3.0.11 to get rid of the error,
   but in the debug.log it will show errors for a table that doesn’t exist (wc_postfinancecheckout_method_config).

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [mranner](https://wordpress.org/support/users/mranner/)
 * (@mranner)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/uncaught-divisionbyzeroerror-2/#post-18162131)
 * We have the same error: if cart total is 0, we will have an exception (crash)
   on the checkout page. We have fixed this issue in
   ./includes/service/class-wc-
   postfinancecheckout-service-line-item.php on line 350:`$proportional_discount_amount
   = empty($total_amount) ? 0 : $total_discount_amount * ( $data['total'] / $total_amount);`
    -  This reply was modified 1 year, 6 months ago by [mranner](https://wordpress.org/support/users/mranner/).
 *  Thread Starter [Dessi Cubbex](https://wordpress.org/support/users/dessicubbex/)
 * (@dessicubbex)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/uncaught-divisionbyzeroerror-2/#post-18163115)
 * Thanks for the reply, but if we change it ourselves, the changes will be overwritten
   if the plugin is updated and the developer doesn’t fix the error.
 *  [mranner](https://wordpress.org/support/users/mranner/)
 * (@mranner)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/uncaught-divisionbyzeroerror-2/#post-18163451)
 * Sure, we know. We commented it for the developers, because they shutdown the 
   issue tab on github and you cannot longer report issues on the github repo.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Uncaught DivisionByZeroError’ is closed to new replies.

 * ![](https://ps.w.org/woo-postfinance-checkout/assets/icon-256x256.png?rev=2919636)
 * [PostFinance Checkout](https://wordpress.org/plugins/woo-postfinance-checkout/)
 * [Support Threads](https://wordpress.org/support/plugin/woo-postfinance-checkout/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-postfinance-checkout/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-postfinance-checkout/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-postfinance-checkout/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [mranner](https://wordpress.org/support/users/mranner/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/uncaught-divisionbyzeroerror-2/#post-18163451)
 * Status: not resolved