Uncaught TypeError: Cannot read property 'classList' of null in the cart

  • Posts: 4
  • Thank you received: 0
5 years 10 months ago #302337

-- Error-message(debug-mod must be tuned on) -- : Uncaught TypeError: Cannot read property 'classList' of null

Hello,

I get the following message when I try to change the amount of a product in the Hikashop cart page:

Uncaught TypeError: Cannot read property 'classList' of null

Does anyone know how to fix this? I don't get this error when I switch the template so It's probably a template isue, but I cannot seem to find where it originates from.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
5 years 10 months ago #302340

Hello,

It means that your template do not include an HTML element which is required by the javascript.
So when the JS try to access that element to change the "class", it do not retrieve it and you got the error.
In order to fix it, it would require to know what is the concerned element. Unfortunately with just the message it do not allow to determine that. It needs more details (JS line, etc).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 4
  • Thank you received: 0
5 years 10 months ago #302388

Yeah I thought something like that already. So here are some more details:

Uncaught TypeError: Cannot read property 'classList' of null
at Object.addClass (hikashop.js?v=401:25)
at Object.setLoading (checkout.js:143)
at Object.submitBlock (checkout.js:93)
at Object.window.checkout.submitCart (checkout:284)
at HTMLAnchorElement.onclick (checkout:228)

Do you need anything more to pinpoint the problem? It occurs when I change the amount in my cart and press the refresh button.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
5 years 10 months ago #302392

Hi,

This indicates that the "next" button on your checkout doesn't have the id "hikabtn_checkout_next" as it is supposed to have.
The id is hard coded in the file "show_block_buttons" that you can see via the menu Display>Views.
So I suppose that this view file has been customized either by you or your template provider and that id has been changed, leading to that javascript error.
We'll change a bit the code on our end to avoid that, however, I would recommend to restore the id on that button so that it can work properly.

The following user(s) said Thank You: yuhs

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

Time to create page: 0.060 seconds
Powered by Kunena Forum