I developed a new extension to the ‘local’ addon that will provide compatibility for older (or foreign) SEO names.
The problem I had to solve is for converting to cs-cart from another cart provider (such as Yahoo, Monster, etc.) where they use “flat” SEO names. By “flat” I mean that there is no distinction between categories, pages or products.
Because cs-cart likes to use categories and parent pages as the path to a product, category or page, someone converting from one of these “flat” sites would loose all their SEO rankings. This is unacceptable and I’m really surprised that the “cs-cart architects” don’t understand that site conversion and retention of SEO ranking is extremely important.
For instance, a Yahoo store has a product that is refernced as “junk.html”. In cs-cart, this product is actually referenced by “category1/category2/junk.html”. Hence a “site.com/junk.html” will yield a 404 Page Not Found error. Yahoo might have a category as ‘cat3.html’ but in cs-cart it might be in ‘cat1/cat2/cat3’. A Yahoo ‘page’ (though they don’t really have the page/category concept) of ‘p2.html’ but in cs-cart it is ‘p1/p2.html’. This extension attempts to resolve all these issues.
I had made my request to cs-cart and they informed me that they were planning to do this in 2.0.11. Unfortunately, they did not and as is the norm, there is no committment to do so.
The solution: I utilize a hook named ‘validate_sef_object’ contained in addons/seo/func.php in the function fn_validate_object(). It behaves like this:
- if the standard resolution of the object fails, it looks up the ‘type’ and the ‘name’.
- it resolves the ‘id_path’ to the respective SEO names for each path component.
- it then issues a 301 redirect to the fully-qualified name as it would appear in cs-cart. This preserves SEO ranking and the search engines fully honor an 301 redirect and the site is not penalized for using it.
- if the standard resolution succeeds, the extension does nothing
- There is a compatibility issue for cart versions earlier than 2.0.11. I have verified a small hack on 2.0.10 but cannot verify on any releases earlier than that. So if you’re using a cart prior to 2.0.10, please back up your existing site before enabling this extension.
So how to get/use this feature…
If installing the ‘local’ addon for the first time, nothing special is required. Just grab the archive listed below and un-archive it in the root of your cs-cart installation.
If you have previously installed the ‘local’ addon, you must backup your skins/
/customer/addons/local directory to preserve your changes. This is only necessary if you have made modifications to files that were distributed in a prior ‘Local Configuration’ release. But it’s always best to backup. Then “uninstall” the ‘Local Configuration’ addon and then ‘install’ it.
This version has two sections (tabs) in the addon options. There is a tab for css_settings (earlier releases) and a new section called ‘SEO’. There are 2 checkboxes in the SEO section. The first is ‘Redirect flat SEO names’. The default for this option is “unchecked” (do not use this extension). Checking this checkbox will enable the addon to automatically redirect flat SEO names to their cs-cart counterparts. The second option is ‘Ignore .html Suffix For Categories’. The default for this is “checked” (specifying a category name as category.html will ignore the suffix “.html”). Products/pages can always be referenced as simply ‘product’ (or ‘page’), however this would be very unusual in an HTML environment.
- A product in the cart as ‘category1/category2/product.html’ can now be referenced as ‘product.html’ or simply ‘product’.
- The category2 category can be referenced as simply ‘category2’ or ‘category2.html’ (if the “Ignore Suffix” checkbox is checked).
- A bad name (one unknown to the SEO engine) will still result in a 404 Page Not Found error page.
- This translation ONLY DEALS WITH FLAT SEO NAMES. I.e. if you have a product in the cart as ‘cat1/cat2/cat3/product.html’, it will only resolve if given ‘product.html’. Any of the ‘cat’ path components are assumed to be valid path components.
How to get it:
Go to [url]http://www.ez-ms.com/products/local-addon.html[/url]
If you’re feeling generous and would like to contribute to the cause, enter a purchase amount. But you are not required to do so.
Complete the checkout process. I require you go provide me contact information so I can keep track of how many are using this free service and also so I can update you if bugs are found/fixed. Once checkout is complete, you should receive an email with a link to the download.