Problem with multilanguage categories

  • Posts: 80
  • Thank you received: 4
4 months 4 days ago #338633

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.10.4
-- PHP version -- : 7.4

Hi, I am having a problem with setting up multilanguage categories in Hikashop starter: when I put a language string (like SHOP_MY_CAT) as the name of a category, the string is translated into the backend language and saved, so it looses the possibility of being translated with the native Joomla language override.
Is it a bug or should I do that differently?
thanks a lot

Giuse

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
4 months 3 days ago #338645

Hi,

What do you mean exactly by "the string is translated into the backend language and saved" ?
Havign a translation key in the name of a product / category and then using a translation override to provide a different text for each language is what I would recommend doing.
It seems that it is what you're doing so I don't see why you say that "it looses the possibility of being translated with the native Joomla language override"
I guess I'm missing something here to understand your problematic.

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

  • Posts: 80
  • Thank you received: 4
4 months 3 days ago #338686

Hi Nicholas, if I type "SHOP_CAT" into the name of the category (after having created overrides for it for the front-end like "Category" for English and "Categoria" for Italian), I need that HikaShop saves "SHOP_CAT" into the DB and not "Category". Maybe now I was more clear?
thanks a lot!
cheers

Giuse

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
4 months 3 days ago #338690

Hi,

No, I understood what you wrote, but I'm not able to reproduce the issue.
I suppose that your problem is different. The issue I think is that when you edit a category, the name and description displayed in the input fields are the translated ones instead of the original ones. I was able to reproduce that issue.
I've made a patch for this on our end.
Download the install package of HikaShop on our website and install it on yours and you'll get the patch.

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

  • Posts: 80
  • Thank you received: 4
3 months 2 weeks ago #339262

Thanks, now the title is managed correctly in the backend but it does not work in the front-end: if the category alias is a string to be replaced with language override => on the front end clicking on the category does not enter the category. If the category alias is directly a string, it works.
If you need a test site with the case, I have one.
thanks

Giuse

Last edit: 3 months 2 weeks ago by Giuse.

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
3 months 2 weeks ago #339264

Hi,

I think that it is probably linked with the alias of the category and not the name.
What did you configure for it ? Did you enter a translation for the alias ? Is the alias different from the name ?

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

  • Posts: 80
  • Thank you received: 4
3 months 2 weeks ago #339271

Yes, it is the alias - I first wrote "name" and then edited the post to correct with the alias.
The alias has translations in the various language and infact the URL shows correctly translated but actually clicking on it, you don't enter into the category. Yes, the category alias is different (typically shorter) than the category name.
hi

Giuse

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
3 months 2 weeks ago #339283

Hi,

Could you provide a complete example with the generated URLs and screenshots of the settings of the category and the translations so that we can reproduce the issue locally in order to understand the situation and fix it ?

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

  • Posts: 80
  • Thank you received: 4
3 months 1 week ago #339331

Sure, here is a description of the case (if you need I can provide access to a test site):
site with 2 languages (no Falang, just vanilla Joomla multilanguage)
Product Category hierarchy: root / Type of Product / Second-hand market
Product Category name for "Second hand market" = SHOP_CAT_USED_NAME
Product Category alias for "Second hand market" = SHOP_CAT_USED_ALIAS
Language overrides:
SHOP_CAT_USED_ALIAS = second-hand
SHOP_CAT_USED_NAME = Second-hand Quality Market
.
Menu items: just one "Shop" as category listing (URL: index.php?option=com_hikashop&view=category&layout=listing)

Problem in the front-end:
-) you go to the Shop and there is a link for "Second-hand market" category with URL "<site>/en/shop/category/second-hand"
-) clicking on that link reloads current page and does not enter into category.

cheers

The following user(s) said Thank You: nicolas

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
3 months 1 week ago #339336

Hi,

I'm not able to reproduce the problem on my end. The link is index.php/en/hikashop-menu-for-categories-listing/category/second-hand on my test website and it works fine when I try the same setup.
So there must be something else I'm missing.

I'll need a backend and a FTP access to your test website to check the situation directly there then.
Can you provide this via our contact form ?
www.hikashop.com/support/contact-us.html

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

  • Posts: 80
  • Thank you received: 4
3 months 1 week ago #339342

just done, thanks

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
3 months 1 week ago #339379

Hi,

Thank you for the access.
I tried to look into it but while I can log on your backend and access some components and Joomla, whenever I try to access HikaShop, I get an error:
i.imgur.com/fcdPjfg.png
And I can't access the frontend at all:
i.imgur.com/lHiLRMR.png
Also, you didn't provide a FTP access so I won't be able to debug the issue even if I can see it there.

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

  • Posts: 80
  • Thank you received: 4
3 months 1 week ago #339383

Hi Nicolas, that is very strange: I used the test site this morning and was ok, I just reinstalled HikaShop and it works again .... It's not the first time it happens, as something in Hika breaks the site that throws error 500... anyway that's another problem
I also sent you the ftp access
thanks

Giuse

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
3 months 1 week ago #339394

For the 500 error, it's hard to say where it comes from.
You would have to check the PHP error log of your server. There, the corresponding "fatal error" message should be logged with the reason of the error and the line number and file path where it happened. That would allow us to understand why this is happening and tell you what to do.

Regarding the FTP access, I got it, however you only provided the username and password, not the host, so I don't know how to connect to it.
Could you provide the host too please ?

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

  • Posts: 80
  • Thank you received: 4
3 months 1 week ago #339395

done

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

  • Posts: 80
  • Thank you received: 4
3 months 1 week ago #339399

About error 503, it is happening again now and the php-fpm log just says

[10-Feb-2022 16:04:34] WARNING: [pool www] child 1067 exited on signal 11 (SIGSEGV) after 59917.442426 seconds from start
[10-Feb-2022 16:04:34] NOTICE: [pool www] child 4863 started

so nothing that can help. I'm quite sure that reinstalling again Hika Shop temporary solves the problem, but I've not done yet since I gave you access to the test site for the multilanguage problem, but let me know if you want me to do something. thanks

Giuse

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
3 months 1 week ago #339424

Hi,

Thanks, I was able to access the FTP.
However, I had again the 500 error, which prevented me from looking into the issue.
So first, it would be great to find a solution to that 500 error.

The log you provided is from the apache server log, not the PHP error log. Could you please look into the PHP error log instead ?
If you don't know how, please check with your hosting support.

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

  • Posts: 80
  • Thank you received: 4
3 months 1 week ago #339425

Hi, as in the other situations, just reinstalling Hika solves (temporary) the error 500.
The php-fpm/www-error.log indicates the following

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 151823148652 bytes) in 
 .../administrator/components/com_hikashop/helpers/helper.php on line 1418

i.e. the PHP process is requesting more than 128 MB (even 151 GB!!!). That line is the closing line of hikashop_loadTranslationFile, after
		$lang = JFactory::getLanguage();
		$loadOverrideCB = $loadOverride->bindTo($lang, 'JLanguage');
		$loadOverrideCB($path);
it seems a memory problem loading the language override value..... ::blink:: ?

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

  • Posts: 75520
  • Thank you received: 11752
  • MODERATOR
3 months 1 week ago #339426

Hi,

That's the error I needed, thanks !

So the issue is not with the loading of that translation file.
It's just that when that translation file was loaded that one time, it hit the memory limit set in your php.ini
But the error could happen anywhere where things need to be loaded in memory.
While 128MB is a lot, you have a lot of extensions on your website.
Increase the "memory_limit" parameter of your php.ini from 128M to 256M and it should fix the problem.

Now I'm not sure why you say "even 151 GB!!!" ?
If you mean that even if you increase the memory to 256M you still have the same issue with the memory_limit being hit, then it means that there is a loop in the code for some reason. In that case, I might be able to debug it with the FTP access you provided. However, it would be a lot easier if the PHP error could be displayed directly on the page. Maybe the fatal error doesn't always happen in that place pointed by the error message you provided, and I will be adding debug at the wrong place.

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

  • Posts: 80
  • Thank you received: 4
3 months 6 days ago #339447

Hi, yes, the error blames much more than 128 MB needed for PHP so it should be some sort of loop. I reinstalled the test site and in the last 24 hours no more error 500 on Hika, if you want to check the original multilanguage category alias problem, I am sure we can solve that :)
thanks and let me know if you need something else
cheers

Giuse

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

Time to create page: 0.092 seconds
Powered by Kunena Forum