Search
Other Add to Menu questions
Forum

Use VirtueMart product name as menu item title

Toni56's Avatar Toni56
When I add an article to menu, the plugin uses the title of the article as the title of the menu item, but not with VirtueMart. Could you please extend the functionality to use the product name/alias as menu item title/alias?
Peter van Westen's Avatar Peter van Westen ADMIN
This should already work. What version of Joomla and VM are you running?
Please post a rating at the Joomla! Extensions Directory
Toni56's Avatar Toni56
Peter van Westen wrote:
This should already work. What version of Joomla and VM are you running?

Joomla 3.8.5 + VirtueMart 3.2.4
Joomla 3.8.5 + VirtueMart 3.2.12

Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, this only works with the English database.
This is because of the stupid way VM has structured it's databases, making it near impossible to make this work as a dynamic solution.

There are no plans to change this.
Please post a rating at the Joomla! Extensions Directory
Toni56's Avatar Toni56
Peter van Westen wrote:
Yes, this only works with the English database.
This is because of the stupid way VM has structured it's databases, making it near impossible to make this work as a dynamic solution.

There are no plans to change this.

You're right. It's hard because it's in the XML but in PHP you can get the current VM language easily.
Maybe a simple change of the language suffix would do the trick
if (isset($template->dbselect->table))
		{
			if($template->urlparams->option=='com_virtuemart')
			{
				if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR .'/components/com_virtuemart/helpers/config.php');
				$vmconfig = VmConfig::loadConfig();
				$vmlang = $vmconfig::$vmlang;
				if($vmlang != 'en_gb') $template->dbselect->table = preg_replace('/en_gb$/', $vmlang, $template->dbselect->table);
			}

I don't want push it too hard, it's just a notice for non-english users 🙂
Have a nice day
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, I know how to get the current language table. But that requires messing around in php.
Add to Menu is set up in a way that support for components (and there views) is controlled via the xml files.
Want support for an extra extension? Just create a new xml file for it.

For the multi-language support for VM, I'd have to make specific exceptions only for VM, and dirty up the whole process.
That might be something I would be tempted to do for extensions that are stable, good and honour the Joomla approach of doing things.
But not for an extension like VM (read: not a fan).
Please post a rating at the Joomla! Extensions Directory
Toni56's Avatar Toni56
Peter van Westen wrote:
Yes, I know how to get the current language table. But that requires messing around in php.
Add to Menu is set up in a way that support for components (and there views) is controlled via the xml files.
Want support for an extra extension? Just create a new xml file for it.

For the multi-language support for VM, I'd have to make specific exceptions only for VM, and dirty up the whole process.
That might be something I would be tempted to do for extensions that are stable, good and honour the Joomla approach of doing things.
But not for an extension like VM (read: not a fan).

🙂 understood
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription