Error with weight array key

  • Posts: 64
  • Thank you received: 6
  • Hikashop Business
2 years 1 month ago #345241

-- HikaShop version -- : 4.6.2
-- Joomla version -- : 4.2.3
-- PHP version -- : 8.0
-- Error-message(debug-mod must be tuned on) -- : Warning: Undefined array key "gr" in L:\laragon\www\zoe4\administrator\components\com_hikashop\helpers\weight.php on line 42

Hello everyone,
I am migrating from version 3.10 to 4.2.3.
When I go to the checkout page an error is thrown:
Warning: Array key "gr" undefined in L:\laragon\www\zoe4\administrator\components\com_hikashop\helpers\weight.php at line 42

I had added the unit 'gr' in the configuration/advanced/weight symbols page, but the system replies that 'The weight unit "gr" is not in the list of possible units: mg,g,dag,kg,t,lb,oz,ozt,l,ml,cl'.
Has anything changed? This value comes from Joomla version 3.9, and I had no problems there.

Thank you
Davide

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 1 month ago #345243

Hi,

No, that message "The weight unit "gr" is not in the list of possible units: mg,g,dag,kg,t,lb,oz,ozt,l,ml,cl" was always there. You cannot provide a weight unit different than the ones in there.
If you want to use grams but you want to display gr instead of g, what you can do is to use g and then add a translation override like this:
G="gr"
www.hikashop.com/download/languages.html#modify

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

  • Posts: 64
  • Thank you received: 6
  • Hikashop Business
2 years 1 month ago #345286

Hi
that's really funny cause the message has only now appeared. The same site, before the update to J4, did not show any error; I was able to select 'gr" from the dropdown menu in the product page (admin) and there were no error about that unit in the checkout process.

Anyway, I've created a mass action and changed all the values to the defalut 'g' unit.

Thank you for the reply!
Davide

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

Time to create page: 0.050 seconds
Powered by Kunena Forum