[Skip to main content](#vessel-content)

#   Division by Zero ... only Warning

##

- **[politikchronist](/forum/user/61141-politikchronist "View politikchronist's Profile")**
- [![politikchronist's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/61141-politikchronist "View politikchronist's Profile") Topic Author
- [ Offline](/forum/user/61141-politikchronist)

Less More

- Posts: 69
- Thank you received: 5
-
-

4 years 9 months ago [\#339239](#339239) by [politikchronist](/forum/user/61141-politikchronist "View politikchronist's Profile")  *[Division by Zero ... only Warning](/forum/35-orders-management/903940-division-by-zero-only-warning#339239 "-- url of the page with the problem -- :   www.politikchronist.org  -- HikaShop version -- : 4.4.5 -- Joomla version -- : 3.10.5 -- Error-message(debug-mod must be tuned on) -- : Division by zero  Hello, not urgent because seldom happening. When giving 100% discount on article and coupon of 100% for delivery cost, the following warning appears: Warning: Division by zero in /var/www/html/joomla/administrator/components/com&#95;hikashop/classes/currency.php on line 2334 The result nevertheless is correct. Thanks for comments.")* was created by *[politikchronist](/forum/user/61141-politikchronist "View politikchronist's Profile")*

-- url of the page with the problem -- : [ www.politikchronist.org](http://www.politikchronist.org)
-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.10.5
-- Error-message(debug-mod must be tuned on) -- : Division by zero

Hello,
not urgent because seldom happening. When giving 100% discount on article and coupon of 100% for delivery cost, the following warning appears:
Warning: Division by zero in /var/www/html/joomla/administrator/components/com_hikashop/classes/currency.php on line 2334
The result nevertheless is correct.
Thanks for comments.

- [ ![FEHLER-HIKA-GUTSCHEIN.JPG](/forum/attachment/54335) ](/forum/attachment/54335 "...-GUTSCHEIN.JPG") [ ](/forum/attachment/54335?download=1 "...-GUTSCHEIN.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMzk0MC1kaXZpc2lvbi1ieS16ZXJvLW9ubHktd2FybmluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

4 years 9 months ago -  4 years 9 months ago [\#339254](#339254) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Division by Zero ... only Warning](/forum/35-orders-management/903940-division-by-zero-only-warning#339254 "-- url of the page with the problem -- :   www.politikchronist.org  -- HikaShop version -- : 4.4.5 -- Joomla version -- : 3.10.5 -- Error-message(debug-mod must be tuned on) -- : Division by zero  Hello, not urgent because seldom happening. When giving 100% discount on article and coupon of 100% for delivery cost, the following warning appears: Warning: Division by zero in /var/www/html/joomla/administrator/components/com&#95;hikashop/classes/currency.php on line 2334 The result nevertheless is correct. Thanks for comments.")*

Hi,

Thank you for your feedback.
We'll fix this by adding the code: Code:

if(empty($total)) { return $taxes; }

before the code: Code:

foreach($products as $product){ if(empty($product-&gt;prices) &#124;&#124; empty($product-&gt;prices[0]-&gt;taxes)) continue;

in that file a bit before the line of the warning.
The error happens because the system tries to get the taxes of the products to calculate the taxes on the shipping fee, but since the amount is 0, it tries to divide by 0 during the calculations, instead of skipping the caclulation process and just returning no taxes (which is what this patch does).

We'll add that for the next version of HikaShop.

Last edit: 4 years 9 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

The following user(s) said Thank You: [politikchronist](/forum/user/61141-politikchronist "View politikchronist's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwMzk0MC1kaXZpc2lvbi1ieS16ZXJvLW9ubHktd2FybmluZz90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.051 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
