Code
Submenu URL: https://www.domain.com/austria/chocolates
SEO URL: category_id=2, austria
category_id=201, chocolates
Canonical: <link href="https://www.domain.com/chocolates" rel="canonical" />
Correct Canonical: <link href="https://www.domain.com/austria/chocolates" rel="canonical" />
But this states the real URL as part of the forms for Language and Currency switching:
<input type="hidden" name="redirect" value="https://www.domain.com/austria/chocolates" />
Been trying to track down how the 'redirect' is created, but just don't have enough OC internals knowledge yet. Any help to may change the code for 'canonical'?
Thanks.
Code: Select all
if ($page == 1) {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id']), 'canonical');
} else {
$this->document->addLink($this->url->link('product/category', 'path=' . $category_info['category_id'] . '&page='. $page), 'canonical');
}
Code: Select all
if ($page == 1 || $page > 2) {
$this->document->addLink($this->url->link('product/category', 'path='.$this->request->get['path']), 'canonical');
} else {
$this->document->addLink($this->url->link('product/category', 'path='.$this->request->get['path'].'&page='.$page), 'canonical');
}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I do not understand how OC v3 hangs together by virtue of the 'SEO URL' as the SEO aspect and the URL work against each other within OC. If a change is made to the SEO_URL for the sub menu, e.g. "austria/chocolates", then the browser URL becomes "austria/austria/chocolates", something has to give. SEO is so important and needs to nurtured. HREFLANG fro multilingual sites is a prime example. The language shoulde be able to be pre-fixed before any of the categories, but it just creates a nasty mess.
Thanks again.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<modification>
<code>MC-Additions</code>
<name>MC: Code Additions</name>
<version>1.0</version>
<author>MC</author>
<link></link>
<file path="catalog/controller/product/category.php">
<operation>
<search>
<![CDATA[if ($page == 1) {]]></search>
<add position="replace">
<![CDATA[if ($page == 1 || $page > 2) {]]></add>
</operation>
<operation>
<search>
<![CDATA['product/category', 'path=' . $category_info['category_id']), 'canonical']]></search>
<add position="replace">
<![CDATA['product/category', 'path=' . $this->request->get['path']), 'canonical']]></add>
</operation>
<operation>
<search>
<![CDATA['product/category', 'path=' . $category_info['category_id'] . '&page='. $page), 'canonical']]></search>
<add position="replace">
<![CDATA['product/category', 'path=' . $this->request->get['path'] . '&page=' . $page), 'canonical']]></add>
</operation>
</file>
</modification>
OCMOD files exist to make changes, I don't use them but suggest you do.Can I use ocmod install file to make changes?
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Thank you.
Then it takes a copy of the core file.
Then it makes the changes as defined in all enabled ocmod xml files, one by one, to that copy, modifications sequence is sorted on name I think.
After all modifications have been performed on all required copies of the core files, they are written to the modification directory.
So OCMOD does not apply changes to existing modification files, it creates them from scratch using all enabled modifications targeting those files.
So multiple ocmod xml files may make changes to the category.php file, in order, and that works fine as long as those modifications do not clash with eachother.
That is why I do not use it as the correct functioning of ocmod is subject to chance/probability and I do not do "maybe it works and maybe it doesn't".
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
How do users keep track of manual changes of files?
Events are cleaner and easier to manage IMO, unfortunately even with events there are times where you are forced back to OCMOD.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
As far as I can tell it was intended and designed to trigger actions based on events and is now pushed (mis-used) for making changes as well, not good.
Apart from the fact that we now have ocmod, vqmod, theme editor, events, all different methods to make changes and they all don't take eachother into account and collide constantly, brilliant.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.