VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Sillero on January 04, 2023, 18:20:06 PM

Title: Wrong url in multi variants
Post by: Sillero on January 04, 2023, 18:20:06 PM
Hello, I have been working with Virtuemart for a long time and this is my first message, I want to thank you for all the time and effort for the development of this great component.

I have a store and for a long time I have always observed an error and I have never been able to determine why it happened. I have done a clean install with J3 and VM 3.8.9 and the same thing is still happening.
When there are products with multiple variants, when entering one, for example:
testsite.com/category1/variant-main-product1
and then I click on a variant, the url changes after ajax load to:
testsite.com/category1/subproduct1
But if later I enter another article with multi variants as well:
testsite.com/category2/variant-main-product2
When clicking on one of the variants of this article, the url changes to the following:
testsite.com/category1/variant-main-product2
When in reality the category to which it belongs is 2. If I click again on any variant or on the main product, the url is correctly updated to 1.
There are two problems with this, the user sometimes gets confused or when sharing the url the category structure does not correspond to the article and on the other hand google is crawling and indexing many wrong urls or establishes a different canonical version from the correct one.
I would really appreciate it if you know where the problem might be.
Title: Re: Wrong url in multi variants
Post by: hazael on January 09, 2023, 19:17:02 PM
it is possible that you have this product in several different categories, but only one category is the default for the URL in this product
Title: Re: Wrong url in multi variants
Post by: Sillero on January 09, 2023, 21:43:26 PM
Hi, thanks for answer. No, only one category for each parent product. I think this is something related to some JavaScript cache or so... it is happend when you go to any product and then you enter in another multi variant product and select a child product, after AJAX refresh the URL get the previous category route. You can try in a fresh installation
Title: Re: Wrong url in multi variants
Post by: Sillero on January 27, 2023, 11:13:12 AM
Hi, I've made a simple video to illustrate the behavior, maybe it's easier to understand.

https://www.veed.io/view/fdce7b30-7db6-4ce6-b613-9efc6f31683c?panel=share

If we are in any article and then we enter another one that has multivariants, when selecting an option the url changes to the route of the previous article seen.
This is a fresh install of Joomla 3.9.24 and virtuemart 3.8.9 10473.

I have also checked to remove the "Use ajax for product content" setting option and the result is the same.

Maybe someone can point me in the right direction to investigate.


Title: Re: Wrong url in multi variants
Post by: GJC Web Design on January 27, 2023, 11:20:11 AM
Can confirm this bug ...

You can see the same thing happening on the site https://www.escape-watersports.co.uk .. say drill down to a shoe and display a certain size ( these are variants )

https://www.escape-watersports.co.uk/clothing/shoes/casual-footwear/astral-hemp-donner-grey-black-uk-7-5-detail

then change to accessories->lights  - select a light and a colour -- url is correct

https://www.escape-watersports.co.uk/accessories/lights/clip-on-lights/adventure-lights-guardian-expedition-light-white-detail

then change colour and u get the shoe url

https://www.escape-watersports.co.uk/clothing/shoes/casual-footwear/adventure-lights-guardian-expedition-light-blue-detail

This is VM3.8.8

Title: Re: Wrong url in multi variants
Post by: Milbo on January 27, 2023, 21:21:44 PM
I only work on bugs on vm4.0.12, please.
Title: Re: Wrong url in multi variants
Post by: Sillero on January 29, 2023, 21:14:48 PM
Thank you both very much for answering.

I have done the test in the latest version (4.0.12 10777) with a fresh installation and I can confirm that the behavior is the same.

Here I leave a video:
https://www.veed.io/view/b10c1acc-273e-440d-9a6a-e4ccb9a0c78d?panel=share
Title: Re: Wrong url in multi variants
Post by: Sillero on April 04, 2023, 21:53:42 PM
Solved. See https://forum.virtuemart.net/index.php?topic=149739.0