News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Canonical Tag VM3 - not work

Started by rafa2100, December 26, 2014, 13:13:22 PM

Previous topic - Next topic

rafa2100

sorry for my bad English.
I am researching for a long time, but found nothing.

Use the VM3 and J3, is not generating canonical tag.

Can anyone explain how the VM3 generates these tags and how do I activate them?

tks.

jjk

If you mean the 'canonical URL' for products, that one should be generated automatically by VirtueMart. You should find it if you look at the source code of a product view in your browser.  However, at present I see two canonical URLs when using J3.x and VM3.x (doesn't happen with J2.5.x and VM 3.x), but that seems to be a bug in Joomla 3.x.

Note that there will probably be a lot of router (the code which builds the SEF urls) fixes in Joomla 3.4.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

rafa2100

Quote from: jjk on December 28, 2014, 22:18:16 PM
If you mean the 'canonical URL' for products, that one should be generated automatically by VirtueMart. You should find it if you look at the source code of a product view in your browser.  However, at present I see two canonical URLs when using J3.x and VM3.x (doesn't happen with J2.5.x and VM 3.x), but that seems to be a bug in Joomla 3.x.

Note that there will probably be a lot of router (the code which builds the SEF urls) fixes in Joomla 3.4.

Yes, i mean the canonical url, but the vm does not generating. Not as child. Look, this is test domain:
http://www.medidaperfeita.com.br/creme-hidratante-victoria-s-secret/creme-hidratante-love-spell.htm
http://www.medidaperfeita.com.br/loja-de-perfumes-importados/creme-hidratante-love-spell.htm

jjk

Does it work if you switch your site to a standard Joomla template (for example Beez3) instead of your HikaShop template?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

rafa2100

Quote from: jjk on December 30, 2014, 01:24:17 AM
Does it work if you switch your site to a standard Joomla template (for example Beez3) instead of your HikaShop template?


I tried this but still not solved.
I'll try some repairs in joomla files and Vm.
Are there any entries in the database for the canonical url?
I migrated to the vm1 VM3, I think this should have interfered in something.

rafa2100

I was able , made ​​a total renovation and it worked . But I have a doubt, the vm creates a canonical url for each category.

He should not point to just one url ?

It creates that way , so is useless :
category1 / product1
category2 / product1

There is how to fix this?

jjk

Quote from: rafa2100 on December 30, 2014, 12:19:36 PM
I was able , made ​​a total renovation and it worked . But I have a doubt, the vm creates a canonical url for each category.

He should not point to just one url ?

It creates that way , so is useless :
category1 / product1
category2 / product1

There is how to fix this?

If you assign a product to two categories, it should produce only one canonical URL for the first category, like: category1/product1
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

sandstorm

Quote from: jjk on December 28, 2014, 22:18:16 PM
Note that there will probably be a lot of router (the code which builds the SEF urls) fixes in Joomla 3.4.

I am testing Joomla3.4RC with VM3.0.6 and this still shows duplicate canonical links - see screenshot
One is the full dynamic link, which I think comes from Virtuemart and another one that shows the SEF URL.

When disabling the System-SEF plugin, this removes the 2nd (SEF URL Canonical) and just shows the Virtuemart one (dynamic URL).

So in Virtuemart how can we switch of canonical, as for me I thin the system-SEF plugin will handle what I need.

But also, is there no way to stop this from showing duplicate canonical URL's in the future for other users? I am not a developer so unsure where the problem lies, but It seem to only happen with virtuemart pages.
I just checked some of my other sites using RS Form, Zoo, K2 & other components and on all these just one canonical shows.
J3.6.4 / PHP7.0.12
VM3.0.16

jjk

On my test site with Joomla 3.4 latest staging snapshot with latest VM 3.0.6, I've commented out the piece of code in ...\plugins\system\sef\sef.php (line 49 in my version), which produces the wrong Joomla canonical url:

  // $doc->addHeadLink(htmlspecialchars($link), 'canonical');

This eliminates the wrong Joomla canonical url, but also the correct canonical urls in Joomla articles.

But looking at your screenshot I wonder why you seem to have an absolute url for your Joomla canonical url, while mine is a relative url (without http://). I have:
  <link href="/domain/en/vm-category-name/productname-detail?limitstart=0&amp;limit=int" rel="canonical" /> (Joomla canonical url)
  <link href="/domain/en/vm-category-name/productname-detail" rel="canonical" /> (VirtueMart canonical url)

( The ?limitstart=0&amp;limit=int is wrong in the Joomla canonical url. Looks to me like a leftover from the Joomla pagination bug in versions 3.3.4 and 3.3.6)



Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

sandstorm

#9
Quote from: jjkI've commented out the piece of code in ...\plugins\system\sef\sef.php (line 49 in my version)
I have also now commented out this code, both in my live site and my test J3.4RC / VM3.0.6 site and although a dirty fix, does the job for now.

I commented in this thread as earlier on you mentioned that you thought this may be rectified with Joomla 3.4

Quote from: jjkBut looking at your screenshot I wonder why you seem to have an absolute url for your Joomla canonical url, while mine is a relative url (without http://).
I have this for both my live site with J3.3.6 & the test site using J3.4rc.
Also have another J3.3.6 site with VM3.0.2 (not updated yet) & this has the same absolute URL - http://mynewsite.me.uk/doodle/shop/1/2015-calendar-dt

J3.6.4 / PHP7.0.12
VM3.0.16

jjk

Quote from: sandstorm on February 24, 2015, 22:35:16 PM
Also have another J3.3.6 site with VM3.0.2 (not updated yet) & this has the same absolute URL - http://mynewsite.me.uk/doodle/shop/1/2015-calendar-dt
I think that's not normal. Just checked a  few Joomla websites including for example http://extensions.joomla.org/. They all show relative canonical urls (without the http://).
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

Quote from: jjk on February 24, 2015, 21:44:50 PM
  // $doc->addHeadLink(htmlspecialchars($link), 'canonical');

This eliminates the wrong Joomla canonical url, but also the correct canonical urls in Joomla articles.


use an if before if($option!='com_virtuemart'){
you could get the option in vm using vRequest::getCmd('option'), but in j3 it is now something like
$jinput = JFactory::getApplication()->input;
$option = $jinput->get->get('option', 'null', 'STRING');
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

Quote from: jjk on February 25, 2015, 10:17:30 AM
I think that's not normal. Just checked a  few Joomla websites including for example http://extensions.joomla.org/. They all show relative canonical urls (without the http://).

looool => is not really canonical then. It can easily appear than on different domains (subdomain, subfolder, and so on)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/