Author Topic: Is this a bug in the language switcher? SOLVED - module updated - Works great  (Read 1858 times)

six gun

  • Beginner
  • *
  • Posts: 46
  • Why is coding so difficult sometimes?
    • C60 in olive oil
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Is this a bug in the language switcher?
« Reply #1 on: December 14, 2018, 10:34:38 am »
Code: [Select]
Is this a bug in the Studio 42 language switcher?
You should contact Patrick directly

Code: [Select]
I installed a plugin Catproduct on the page - it is outdated now and the developers seems to have dropped outYes -- 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 http://www.gjcwebdesign.com
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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

six gun

  • Beginner
  • *
  • Posts: 46
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Is this a bug in the language switcher?
« Reply #2 on: December 14, 2018, 12:24:11 pm »
Thanks i have sent him a message.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3901
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Is this a bug in the language switcher?
« Reply #3 on: December 14, 2018, 13:45:13 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

  • Beginner
  • *
  • Posts: 46
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Is this a bug in the language switcher?
« Reply #4 on: December 14, 2018, 15:09:52 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3901
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Is this a bug in the language switcher?
« Reply #5 on: December 14, 2018, 16:31:49 pm »
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

  • Beginner
  • *
  • Posts: 46
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Is this a bug in the language switcher?
« Reply #6 on: December 14, 2018, 17:02:19 pm »
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

  • Beginner
  • *
  • Posts: 46
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Is this a bug in the language switcher?
« Reply #7 on: December 14, 2018, 23:28:44 pm »
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

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3901
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Is this a bug in the language switcher?
« Reply #8 on: December 15, 2018, 09:57:22 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Is this a bug in the language switcher?
« Reply #9 on: December 15, 2018, 10:35:41 am »
Code: [Select]
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 http://www.gjcwebdesign.com
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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3901
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Is this a bug in the language switcher?
« Reply #10 on: December 15, 2018, 12:07:04 pm »
@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

  • Beginner
  • *
  • Posts: 46
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Is this a bug in the language switcher?
« Reply #11 on: December 15, 2018, 15:20:04 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8890
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Is this a bug in the language switcher?
« Reply #12 on: December 15, 2018, 15:33:15 pm »
and with the Joomla menus except en deleted?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3901
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Is this a bug in the language switcher?
« Reply #13 on: December 15, 2018, 16:01:33 pm »
@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

  • Beginner
  • *
  • Posts: 46
  • Why is coding so difficult sometimes?
    • C60 in olive oil
Re: Is this a bug in the language switcher?
« Reply #14 on: December 15, 2018, 16:19:12 pm »
Bingo it works!  8)

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