You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

(SOLVED) bug, enabling seo shows wrong language on category page but not prod.

Started by gallego.d, December 01, 2021, 14:50:25 PM

Previous topic - Next topic


Hi all, I just post this here in hopes of avoiding someone else the trouble of finding this,
I don't know if it's a general issue or just one of our custom installs (no code modified, I say custom in the sense that it's a full website with other plugins - themes),

The thing started a couple of versions back (3.x, we suspect 3.2-3.4), and as a result, any one who visited the shop in a non-main language, would see the category page (category description and product names) in the main shop language (in this case es-ES), for instance, visiting one of the categories in /en/ would print the /es/ version,. even when having all content translated, fully working language switcher, home menus, etc...

We found out that (at least in our case) the problem can be fixed by 'overriding' the setLangByTag function in admin/com_virtuemart/helpers/vmlanguage.php (around line 84), by adding :

at the start of the function, since we noticed (vmdebuggin) that some part of the VM was trying to set the language to the main (es-ES) somewhere between start and the getChildCategoryListObject which loads the data,

as we understand, this obviates the lang tag passed and always sets the current joomla language as the language for VM

we don't fully know if this could cause some issue with any other (or even our) install, but if it's being looked at, or if this can help fix (what we refer as, but maybe not be a) bug I'd be happy to explain in more detail the testing we used to arrive to this line, or if these changes need to get somewhere (i.e. bugs panel somewhere?).

Also, Thanks to all the community for an amazing ecommerce platform!!

GJC Web Design

Just to say thank you for the report and I'm sure Max will have seen this ...
GJC Web Design
VirtueMart and Joomla Developers - php developers [url=""][/url]
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
Contact for any VirtueMart or Joomla development & customisation