Post by enbi » Fri Apr 08, 2016 10:31 pm

Hi all! I am a new member of the forum but I am quite successifully using OC for some time. I wonder if there is any way to give a small contribution to the seo_url module.

When using OC multilingual mode, having the URLs in the same language of content is a feature that I would have seen implemented into core. I managed to add (still to be tested extensively) a set of patches to allow insertion of a keyword per language. Changes are minimal (but they involve model, view and controllers, now limited to products and categories, later they should be added to other pages), and they map a single URL per language. URL must be unique, but if empty the next in ID order is taken from database.

While it is working on my test system (2.2), I still need to figure out the limits of my approach and improve it (if possible and if I have time once my goals are reached).
I never liked VQMOD/OCMOD when many files are changed. They tend to break on new revisions. I would be pleased to see some kind of interest (or doubts about my proposal) from OC devs. I could release a patch to be checked or work on a fork of the development branch and submit changes. If no such insterest will be raised, I can release a VQMOD extension to look at (without warranty/updates, I am not a commercial extension developer!).

This is how the modification work:
1. Add language_id to oc_url_alias table
2. Get list of url_aliases by a separated function instead of merging them with product/category data
3. seo_url gets the URL for specified language first, and it is used by url_rewrite
This approach does not break the current table (default language_id should be set to the default language)

Still to be done:
1. Language code in URL
2. Check sitemaps
3. Add manufacturers and other locations where keywords are used.

I wait your comments before posting a patch or a xml mod file.

Newbie

Posts

Joined
Fri Apr 08, 2016 10:12 pm

Post by enbi » Tue Apr 19, 2016 9:18 pm

Well, I got little no interest in this post.
I won't prepare a VQMOD file unless there is a specific request but if there's anyone interested in what I am done, it's here:

https://github.com/ennebi/opencart
And the two patches are these:

https://github.com/ennebi/opencart/comm ... da5777dc3c
https://github.com/ennebi/opencart/comm ... f1462bc0b7

This is the working method:
  • Manually add language_id field in oc_url_alias. Set the existing fields with value of language_id set to your main language.
  • Manually create oc_url_root table with pkey url_root_id, language_id INT, and url_root VARCHAR. This table allows a different url per language. Set a specific URL in the form lang.hostname.com or hostname.com/lang (first form should work but I had no time to test it yet). Do not include any ending slash.
  • In case of the second form (URI component with language) modify htaccess file so that URL rewrite does not include the additional URI component in _route_ parameter.
  • Edit seo url field in categories and products, if needed.
Limitations:
  • No prettifier for other URLs. Still to be added if needed (most of them are not relevant for indexing)
  • Same URL can be reached by more than one location. The same happens with the default SEO URL script
  • May not work if language root addresses are not configured of if they are set to the same value.
  • When a wrong language ID is entered or the link is not containing the required root, the page redirects to the home with the identified session language.
  • Untested under many circumnstances. Use at your own risk!

Feel free to add your comments and critics, keep in mind I can reply if I have time and I give no warrany at all on anything.

Newbie

Posts

Joined
Fri Apr 08, 2016 10:12 pm

Post by Mambabut36 » Sat May 21, 2016 12:25 pm

But you missed one ie web master tools which is main purpose of insert urls.

Newbie

Posts

Joined
Tue May 17, 2016 12:48 pm
Location - Россия
Who is online

Users browsing this forum: No registered users and 2 guests