VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: pkubik on November 05, 2017, 18:59:20 PM

Title: Hov remove VIRTUEMART from URL?
Post by: pkubik on November 05, 2017, 18:59:20 PM
Good day
I have a problem, I can not delete the virtuemart from URL. My website url is still: domain.com/virtuemart/category/product I tried everything possible and nothing helps. I also attach screens to my settings. What am I wrong with?

Joomla! 3.8.1 and VirtueMart 3.2.4, htaccess ir original from joomla
Title: Re: Hov remove VIRTUEMART from URL
Post by: pkubik on November 05, 2017, 19:00:54 PM
continuation
Title: Re: Hov remove VIRTUEMART from URL?
Post by: Studio 42 on November 06, 2017, 02:29:47 AM
Add a virtuemart category link menu to root category(no category selected and no manufacturer) or to the virtuemart view(Obselete)
Title: Re: Hov remove VIRTUEMART from URL?
Post by: pkubik on November 06, 2017, 07:14:36 AM
Screen 1.png - moved virtuemart to main menu - without change, still the same URL: domain.com/virtuemart/category/product

Screen 2.png - moved virtuemart to main menu and add as submenu - HOME, URL is: domain.com/home/virtuemart/category/product
Title: Re: Hov remove VIRTUEMART from URL?
Post by: Jörgen on November 06, 2017, 09:55:44 AM
Change the headline of the menu item to something else than Virtuemart perhaps ?

regards

Jörgen @ Kreativ Fotografi
Title: Re: Hov remove VIRTUEMART from URL?
Post by: Studio 42 on November 06, 2017, 10:30:55 AM
YOu have to set virtuemart as default menu and not use an article or if you want change virtuemart in the link, then change the alias.
Joomla use always yoursite/menu-alias/...
Another solution is to add item menus for all main categories in a hidden menu(no joomla module set) so alias begin from root
Title: Re: Hov remove VIRTUEMART from URL?
Post by: pkubik on November 06, 2017, 13:06:09 PM
I managed to remove the VIRTUEMART from the URL. Now is the menu address i need: domain.com/category/product

I created a hidden menu in it VirtueMart » Category Layout and link to link to each menu in virtuemart. Is that right? Do I need to create a new hidden menu in the joomla menu for each menu from the virtuemart? It seems complicated to me.
Title: Re: Hov remove VIRTUEMART from URL?
Post by: Studio 42 on November 06, 2017, 14:29:52 PM
No only the 1st level category, all inherited links use same menu item.
If you have a subcategory then menu is yoursite.com/category/subcategory and product in this yoursite.com/category/subcategory/product
But this is better if you use the breadcrumb, if you add menu items for all categories in root then you loose the breadcrumb levels but you can then have yoursite.com/subcategory/product
This is needed because in Joomla the menu settings get inherited.
If you want simplify your product URL, it's possible in latests VM release, see the config SEO part.
Title: Re: Hov remove VIRTUEMART from URL?
Post by: pkubik on November 08, 2017, 07:34:23 AM
OK, i create in the main menu, screen 1:
Home (Alias: home)
Articles » Featured Articles


then i create hidden menu and create for all major categories from VM, screen 2:
Sady na nehty (Alias: sady-na-nehty)
VirtueMart » Category Layout


links are now created in the form: domain.com/category/subcategory/product

Is this the only solution? It is very complicated to create two menus, one in VM and again in joomla!

New problem, if is product displayed on the homepage with the module:
VM - Featured products is URL: domain.com/category/product but if I find it through the menu is URL:  domain.com/category/subcategory/product this creates duplicate links.

how to create links only in shape: domain.com/category/product
Title: Re: Hov remove VIRTUEMART from URL?
Post by: pkubik on November 09, 2017, 09:01:01 AM
I found the solution. But adds a subcategory to all products. I need to remove the subcategory, how to do it?

in the administrator\components\com_virtuemart\models\product.php
on line 426: if(VmConfig::get('show_subcat_products',false)){
change to: if(VmConfig::get('show_subcat_products',true)){

links are now created in the form: domain.com/category/subcategory/product.html
But i need all links in the form: domain.com/category/product.html how to do it?
Title: Re: Hov remove VIRTUEMART from URL?
Post by: Studio 42 on November 09, 2017, 12:15:19 PM
Vm always use Joomla logic
If you have a menu vmcategory then this is the root and subcategory is vmcategory/subcategory.
TO change this behavior, you need to hack Joomla+Vm
The problem is that sef link to the main menu (vmcategory) is the way Joomla know how to display the modules for eg. so changing this need to modify more in Joomla.
If you need simplified links, you need then sh404 or any rewriting plugins that can modify links.
This links are then used by the SEF tool to revert original link before Joomla router.
Eg setting in your sef tool subcategory = vmcategory/subcategory, he can intercept the link subcategory and send back to Joomla the right link, so Joomla can work and set right parameters.
This is only a basic explain, it not really work this way
Title: Re: Hov remove VIRTUEMART from URL?
Post by: pkubik on November 09, 2017, 21:21:50 PM
You're right. It is best to use the SEF tool. Which component is better for SEO: sh404SEF or JoomSEF ?
Title: Re: Hov remove VIRTUEMART from URL?
Post by: jjk on November 10, 2017, 22:17:21 PM
Quote from: pkubik on November 09, 2017, 21:21:50 PM
You're right. It is best to use the SEF tool. Which component is better for SEO: sh404SEF or JoomSEF ?

Using those third party SEF tools usually create other problems. Which menu structure do you actually want to achieve? Do you want to display a page showing your VM categories as the default home page or do you want a non-VM homepage with for example a 'Shop' link.