Price Calculations v2.4.1 not working after HikaShop 6.4.1 update

  • Posts: 625
  • Thank you received: 24
  • Hikaserial Subscription Hikashop Multisite
2 days 4 hours ago #371921

-- HikaShop version -- : 6.4.1
-- Joomla version -- : 6.1.0
-- PHP version -- : 8.4

I hope you can help me. Since updating HikaShop and the Price Calculations plugin, the price calculations on my product pages are no longer working. I am not a developer myself, so I reached out to Claude (AI assistant by Anthropic) for help investigating the issue. I want to be upfront about this — I am not certain whether the findings below are the actual cause, but I wanted to share everything we found so you have as much context as possible.

Environment:
- HikaShop Business: v6.4.1
- Price Calculations plugin: v2.4.1
- Joomla version: 6.1.0

What we found during investigation:

1. The browser console shows the following error on the product page:
"Cannot read properties of null (reading 'price')"
at aluminium-naam-typeplaat/:140
at xhr.onreadystatechange (hikashop.js:1587)

2. The AJAX call to /component/hikashop/calculations/calculate/ returns: "No product id"

3. When inspecting the form element on the product page via the browser console:
- document.getElementById('hikashop_product_form') exists
- However, the form only contains basic cart fields (cart_type, add, ctrl, task, return_url)
- There is no product_id field and no custom fields present in the form
- window.Oby.getFormData() therefore returns no product_id

4. In calculations.php (line 81), the generated JavaScript uses resp.price to read the AJAX response. Based on the changelog of v2.3.0, the response now returns price_value instead of price. I have already updated this line locally as a test, but this did not resolve the issue because the form is empty. After this test I bring everyting back to normal to instal the latets plugin again.

5. The form[name="hikashop_product_form"] appears to no longer contain the product data and custom field values that the plugin relies on. This may be related to a change in HikaShop 6.4.x in how the product form is structured or populated.

Thank you very much for your time and support.

Kind regards,
Lumiga


Kind regards,
Lumiga

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

  • Posts: 85610
  • Thank you received: 14019
  • MODERATOR
2 days 40 minutes ago #371924

Hi,

Thanks for the very detailed report, it gives us a good starting point. One small correction first: the AJAX response of the plugin still returns a "price" field (not "price_value"), so that part of the AI's analysis was off. The real issue is the one you spotted right after it: the product form on the page is missing the product_id input, so the AJAX call goes out without a product_id and the server replies "No product id". Without a product_id, the JavaScript then tries to read the price out of an empty response, which is the "Cannot read properties of null (reading 'price')" error you see in the console.

This is a known side effect of the product form restructuring that happened in HikaShop 6.4.0. HikaShop 6.4.1 already includes the fixes for it, both on the form side and on the JavaScript helper that the Price Calculations plugin uses to read the form. So in principle, on 6.4.1 it should be working out of the box.

The two most common reasons it still doesn't work after the update are:

1. A cached copy of HikaShop's main JavaScript file is still being served to your browser, so the fix is technically deployed on the server but your browser is still running the old version. Could you try a hard refresh on the product page (Ctrl + Shift + R on Windows/Linux, Cmd + Shift + R on Mac), and also clear the Joomla cache from System > Maintenance > Clear Cache? Then reload the product page and check whether the calculation comes back.

2. Your Joomla template has a custom override of the HikaShop product view. Joomla template overrides take precedence over HikaShop's own files, so if the override was created before the 6.4.0 restructuring, it can keep the old form structure on the page and prevent the fix from taking effect. To check: in your Joomla files, look for a folder like templates/<your_template>/html/com_hikashop/product/ . If you see files like show_default.php, show.php, quantity.php inside it, then you do have overrides for the product page. If that is the case, the simplest test is to rename that "product" folder temporarily to "product_backup" and reload the product page, to see whether the calculation comes back. If it does, the overrides are the culprit and they need to be regenerated from the 6.4.1 versions.

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

Time to create page: 0.050 seconds
Powered by Kunena Forum