News:

Looking for documentation? Take a look on our wiki

Main Menu

Is this a bug in the language switcher? SOLVED - module updated - Works great

Started by six gun, December 14, 2018, 05:31:39 AM

Previous topic - Next topic

six gun

In have a Virtueplanet VP Smart template with 3.9.1 Joomla and the latest VM.
The site is multi-lingual.
The site is pretty a Virtueplanet out of the box website.

In the summer i developed problems with language switches. If you stayed in one language you would not know there was an issue but if you switched languages in the shop the url's were 404.
Turning the SEF off and it ran without problems.

It is strange these things just seem to crop up out of thin air.

At the time i had sh404sef and a translation component on the site.
i took advice from this forum and stripped both of these out, translated using Joomla, associated all the menus and used native Joomla SEF.
I also installed https://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm
All was cool then and i could even switch language on the product details page without getting thrown back to the category page.

I recently added an extra page - "Pick 'n' Mix" onto the site - all my previous VM menu item pages were category layout - this page was a VirtueMart » Product Details Layout page.
I installed a plugin Catproduct on the page - it is outdated now and the developers seems to have dropped out - it does not run on php7 which is causing a fatal error on the page so people are abandoning it, which is a shame b/c the idea is very good. i am hosted on siteground and can assign php5 to the Catproduct folder and run the rest of the site on php7 so that way i can run with it for now.

Everything seemed ok. The menu item for the page was off the shop menu, i created menus for each language which i associated. It ran smoothly.
Then i hit a problem where the SEF url for the page which started to cause a 404.
If i kept within the one language there were no problems. If i switched on the page it 404's.
Turn the Joomla SEF off and it switches perfectly.
i can see the non-SEF url is the same in all the associated language menu items.
index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=64

The Spanish SEF url for the page is https://www.c60inoliveoil.co.uk/es/tienda/escoger-y-mezclar
If then use the Studio 42 language switcher to go to say English - i get a 404
https://www.c60inoliveoil.co.uk/tienda/escoger-y-mezclar/pick-n-mix-c60-oils-detail
The correct SEF url is https://www.c60inoliveoil.co.uk/shop/pick-n-mix

I can get the page to work by creating an ALL languages main menu root item. The SEF url's for the pages vary depending on whether you get to the page by switching language on the page or coming off the main menu item for the page.

I took a look at the Studio 42 shop language switcher.
i turned it off and went back to the Joomla language switcher.

When i do that i can switch language on the Pick 'n' Mix page and it moves between language on the page perfectly. I have the problem where if i switch on a product details page coming of a category page it throws it back to the category page but that is normal for that language switcher.

Is this a bug in the Studio 42 language switcher? i have the mod_vmlang.2.6.0.0 which is the latest version.

Obviously i would like to run with the Studio 42 switcher - it sits better on the page and works better on product details pages - except in this case.
i have left the Studio 42 running at the moment.

GJC Web Design

Is this a bug in the Studio 42 language switcher?

You should contact Patrick directly

I installed a plugin Catproduct on the page - it is outdated now and the developers seems to have dropped out
Yes -- its a clever piece of software
I have rewritten it for php7 and fixed various bugs -- is working fine on the sites I use it on so it is possible to upgrade
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

six gun


Studio 42

Quote from: six gun on December 14, 2018, 12:24:11 PM
Thanks i have sent him a message.
Hi, i have no message from you.
But it should work. Have you try to rebuild your Joomla menu structure ?

six gun

#4
i sent a message through ask a question on https://shop.st42.fr/en/categories-tools/multi-language-for-virtuemart.htm

i checked all the items in the main menu and clicked rebuild.

The issue of wrong SEF url is the same with the Studio 42 switcher throwing a 404 when you try to change language on https://www.c60inoliveoil.co.uk/shop/pick-n-mix

i published both language switchers side-by-side. The standard Joomla switcher is ok, the Studio 42 results in the wrong url on the pick-n-mix page.

i uninstalled Studio 42 - cleared the cache and then reinstalled - everything is the same.

Studio 42

I think it's wrong because you added menu item to the product, it's possible that the code do not exist for this case.
Does the product have a category ?

six gun

The VM Category is Pick 'n' Mix - published. Not associated with a menu item

There are 4 products in this category.

One of these, Pick 'n' Mix Oils is published to the menu Pick 'n' Mix

The other 3 products are attached to Pick 'n' Mix Oils.

I wanted to use the Catproduct plugin so on the page is a list of products that can be selected and then added to the cart with a single click

So i created the category Pick 'n' Mix and 4 products in that category.

i created the menu item Pick 'n' Mix which is a VM product layout to which Pick 'n' Mix Oils is published.
The other 3 products in the category Pick 'n' Mix are not published to any menu.

As a custom field in the product Pick 'n' Mix Oils i have a custom field for Catproduct so a list of selectable products can appear on the page.

Through Catproduct i associated the 3 products i wanted to appear on the product Pick 'n' Mix Oils page.
i have set it up so you cannot buy Pick 'n' Mix Oils off the page but you can select the 3 other products.

I want to be able to access a product page straight off a shop menu where there is a list of products exist using the Catproduct plugin.
So that it looks as it does not.

six gun

i put a VP Smart (Virtueplanet) website on my PC local host- the same basic template i am using.

i created a VirtueMart » Product Details Layout submenu item.
I assigned a random product to this menu item.

A single product appears on the page.
With the standard Joomla language switcher i can switch backward and forward between English and German which come with the template.

http://localhost/vpsmart/index.php/de/women/clothing/bunte-mischun-g
http://localhost/vpsmart/index.php/women/clothing/pick-n-mix

i installed the Studio 42 language switcher.
When i switch languages on this page i get a 404 and the url is http://localhost/vpsmart/index.php/?Itemid=3

So briefly the Studio 42 language module will not switch between VirtueMart » Product Details Layout submenu items whilst the standard Joomla switcher manages it.

i have a workaround by publishing the Joomla language switcher to the product details layout pages and the Studio 42 to all the other pages.

Studio 42

Quote from: Studio 42 on December 14, 2018, 16:31:49 PM
I it's possible that the code do not exist for this case.
I need to check if i can ad this.
My switcher rewrite all urls for Virtuemart, because Virtuemart router cannot do it.
THe case of adding a product as menu is not managed for now. Thats all

GJC Web Design

THe case of adding a product as menu is not managed for now.

In this case why not simple use the core J lang system of linked menus?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

@GJC Web Design I already fixed the code(only a little typo on compare)  for some weeks but forgot to modify the Joomla update XML file.
@six gun please check your Joomla update and report me if you have same issue with the update.

six gun

i updated the module on the live website through the Joomla updating section in the backend.
i cleared the cache.
i have both the standard Joomla switcher and Studio 42 showing on the live site.
The standard Joomla language switcher flips over the languages fine with the VirtueMart » Product Details Layout menu item page.
The updated Studio 42 switcher still gets a 404.

So https://www.c60inoliveoil.co.uk/shop/pick-n-mix switched to German gets
https://www.c60inoliveoil.co.uk/de/geschaeft/bunte-mischun-g

Whilst Studio 42 gets
https://www.c60inoliveoil.co.uk/de/shop/pick-n-mix/bunte-mischun-g-c60-öle-detail

i did the same on the local host i sent up last night straight out of the box from Virtueplanet
Updated Studio 42 module.
Cleared the cache
With the standard Joomla switcher
http://localhost/vpsmart/index.php/women/clothing/pick-and-mix
Switches to
http://localhost/vpsmart/index.php/de/women/clothing/bunte-mischun-g

With Studio 42 there is a 404
http://localhost/vpsmart/index.php/de/?Itemid=3

GJC Web Design

and with the Joomla menus except en deleted?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

@six gun, please contact me using your order email.
It's a pain to check your answer here to know if it work.
I have apply another patch and tested in my own shop here https://shop.st42.fr/fr/mise-a-jour-et-maintenance-site-web and it work now.
Check Joomla update mod language for Virtuemart release 2.6.4.8 : Updated fix for product menu link

six gun

Bingo it works!  8)

Really pleased +++++++++++++