-- HikaShop version -- : 4.6.0
-- Joomla version -- : 3.10.9
-- PHP version -- : 8.0
-- Browser(s) name and version -- : Chrome Version 77.0.3865.120 (Official Build) (32-bit)
-- Error-message(debug-mod must be tuned on) -- : The product has characteristics but not variants. Click on the 'Variants' tab and add variants to it.
Hello Nicolas,
We encountered another issue when trying to add product variants. I checked the error console and fixed the issues but wanted to bring this to your attention so you can hopefully address it and we won't have to apply this hack every time we update the software.
Javascript Errors:
hikashop.js?v=460:1467 Uncaught TypeError: this.addScript is not a function
at hikashop.js?v=460:1467
at XMLHttpRequest.xhr.onreadystatechange (hikashop.js?v=460:1504)
index.php?option=com_hikashop&ctrl=product:1 Uncaught TypeError: Cannot read property 'focus' of undefined
at HTMLInputElement.onfocus (index.php?option=com_hikashop&ctrl=product:1)'
CSS and Javascript Issues:
CSS Issue: The input field inside the 'Characteristic' field box (appears when we click on add variant button) was small in width, so when we click on the field it was not focusing properly to display the list of characteristics. So, I made the width of input fields the same width as the box by adding an inline style. I think only the javascript fix will also work, so no need to do this css fix. It seems the javascript issue was the main issues causing the trouble with the css too. So, no actual need to fix the css.
Javascript Issue: "this.addScript" function was not being called for some reason, so I changed it to "window.hikashop.addScript" and now it works.
Fixes:
- File: //administrator/components/com_hikashop/types/namebox.php #: 459-459, #: 491-492
- File: //media/com_hikashop/js/hikashop.js #: 1467, #: 1470
I hope this helps!
-JM