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

#   Bug report: 100% discount causes a fatal error and makes the website unusable

##

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

Less More

- Posts: 36
- Thank you received: 2
-
-

1 year 2 months ago [\#368084](#368084) by [jcamus](/forum/user/33993-jcamus "View jcamus's Profile")  *[Bug report: 100% discount causes a fatal error and makes the website unusable](/forum/46-discount-coupon/909618-bug-report-100-discount-causes-a-fatal-error-and-makes-the-website-unusable#368084 "-- HikaShop version -- : 6.0.0 -- Joomla version -- : 4.4.3 -- PHP version -- : 8.2 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : Attempt to assign property &quot;tax&#95;amount&quot; on null  Hi,  we have the following discount code set up in HikaShop:   prnt.sc/MqVO4V&#95;4aAYr  In combination with particular products in the cart, it results in the following error:  Attempt to assign property &quot;tax&#95;amount&quot; on null  Screenshot:   prnt.sc/yvZW&#95;qPkwnz&#95;  The user can no longer use the website at all as every page visit results in the same error.  Stack trace:   prnt.sc/vOAmxB1yOVZ9  Our developer investigated this and determined it is indeed a bug.  Here is what he said:  For a quick fix, I updated the file: &#92;&#92;administrator&#92;components&#92;com&#95;hikashop&#92;classes&#92;discount.php and around line 703 added:  Can you include an official fix in the next version?  Thank you")* was created by *[jcamus](/forum/user/33993-jcamus "View jcamus's Profile")*

-- HikaShop version -- : 6.0.0
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.2
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : Attempt to assign property "tax_amount" on null

Hi,

we have the following discount code set up in HikaShop:
[ prnt.sc/MqVO4V\_4aAYr](https://prnt.sc/MqVO4V_4aAYr)

In combination with particular products in the cart, it results in the following error:

**Attempt to assign property "tax\_amount" on null**

Screenshot:
[ prnt.sc/yvZW\_qPkwnz\_](https://prnt.sc/yvZW_qPkwnz_)

The user can no longer use the website at all as every page visit results in the same error.

Stack trace:
[ prnt.sc/vOAmxB1yOVZ9](https://prnt.sc/vOAmxB1yOVZ9)

Our developer investigated this and determined it is indeed a bug.

Here is what he said:

For a quick fix, I updated the file:
\\administrator\components\com_hikashop\classes\discount.php and around line 703 added:
Code:

if ( ! isset( $cart-&gt;coupon-&gt;total-&gt;prices[0]-&gt;taxes ) &amp;&amp; isset ( $cart-&gt;coupon-&gt;total-&gt;prices[0]-&gt;taxes_without_discount ) ) $cart-&gt;coupon-&gt;total-&gt;prices[0]-&gt;taxes = $cart-&gt;coupon-&gt;total-&gt;prices[0]-&gt;taxes_without_discount; # seyi_code

Can you include an official fix in the next version?

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk2MTgtYnVnLXJlcG9ydC0xMDAtZGlzY291bnQtY2F1c2VzLWEtZmF0YWwtZXJyb3ItYW5kLW1ha2VzLXRoZS13ZWJzaXRlLXVudXNhYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86323
- Thank you received: 14283
-
-

1 year 2 months ago [\#368089](#368089) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Bug report: 100% discount causes a fatal error and makes the website unusable](/forum/46-discount-coupon/909618-bug-report-100-discount-causes-a-fatal-error-and-makes-the-website-unusable#368089 "-- HikaShop version -- : 6.0.0 -- Joomla version -- : 4.4.3 -- PHP version -- : 8.2 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : Attempt to assign property &quot;tax&#95;amount&quot; on null  Hi,  we have the following discount code set up in HikaShop:   prnt.sc/MqVO4V&#95;4aAYr  In combination with particular products in the cart, it results in the following error:  Attempt to assign property &quot;tax&#95;amount&quot; on null  Screenshot:   prnt.sc/yvZW&#95;qPkwnz&#95;  The user can no longer use the website at all as every page visit results in the same error.  Stack trace:   prnt.sc/vOAmxB1yOVZ9  Our developer investigated this and determined it is indeed a bug.  Here is what he said:  For a quick fix, I updated the file: &#92;&#92;administrator&#92;components&#92;com&#95;hikashop&#92;classes&#92;discount.php and around line 703 added:  Can you include an official fix in the next version?  Thank you")*

Hi,

Thank you for your feedback. I've made a patch for it.
Download the install package of the 6.0.0 and install it on your website and it will add the patch. Otherwise, it will also be in the next version.

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDk2MTgtYnVnLXJlcG9ydC0xMDAtZGlzY291bnQtY2F1c2VzLWEtZmF0YWwtZXJyb3ItYW5kLW1ha2VzLXRoZS13ZWJzaXRlLXVudXNhYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.070 seconds

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