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

  • Posts: 35
  • Thank you received: 2
  • Hikaserial Subscription Hikashop Business
1 week 54 minutes ago #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 "tax_amount" on null

Hi,

we have the following discount code set up in HikaShop:
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_

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:
\\administrator\components\com_hikashop\classes\discount.php and around line 703 added:

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

Can you include an official fix in the next version?

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 84199
  • Thank you received: 13659
  • MODERATOR
6 days 13 hours ago #368089

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

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum