VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Development & Testing => Topic started by: Georgios Kolomvos on June 14, 2026, 11:26:47 AM

Title: VM 4.6.8: Product Details menu items append product slug in multilingual URLs
Post by: Georgios Kolomvos on June 14, 2026, 11:26:47 AM
Environment
- Joomla 5.4.6
- VirtueMart 4.6.8 build 11258
- Multilingual site (EL, EN, FR, ES)
- Product Details Layout menu items associated across languages

Problem
When a Product Details menu item exists and is associated with corresponding menu items in other languages, VirtueMart appends the product slug to the generated multilingual URL although the menu item already uniquely identifies the product.

Example
Expected URL:  /en/product-menu-item
Generated URL: /en/product-menu-item/product-slug
The appended product slug is unnecessary and causes incorrect hreflang and language-switch URLs.

Investigation
After debugging router.php, I found that Product Details menu items are correctly detected using the $ismenue flag. However, the product slug is appended unconditionally:

if($virtuemart_product_id)
    $segments[] = self::getProductName($virtuemart_product_id);
This code executes even when a matching Product Details menu item has already been found.

Suggested fix
Replace:
if($virtuemart_product_id)
    $segments[] = self::getProductName($virtuemart_product_id);
with:
if(!$ismenue && $virtuemart_product_id)
    $segments[] = self::getProductName($virtuemart_product_id);

After applying the patch:
- hreflang URLs are correct
- language-switch URLs are correct
- no unnecessary product slug is appended
- products without Product Details menu items continue to work normally
Title: Re: VM 4.6.8: Product Details menu items append product slug in multilingual URLs
Post by: Milbo on June 16, 2026, 15:48:56 PM
Great, I directly added it to the core. Looks just like a smart fix.