URL validation in OpenCart has been on my mind for a while so today I went ahead and finished this vQmod. The goal is to validate urls to make sure they are valid according to the following rule set:
1. product cannot be followed by anything
2. information cannot be followed by anything
3. manufacturer can only be followed by a product and must not exist more than once
4. a category can only be followed by another category or a product
5. a product must belong to adjacent category or manufacturer present in url
6. categories must belong to parents in order of appearance in url
There is one setting you can change in the vQmod itself called "allow_parents". This adds support for product category validation for either all parent categories or only the directly assigned category. For instance, if product "cinema-display" belongs only to category "monitors" which is a subcategory of "desktops":
desktops/monitors/cinema-display will always be valid
If "allow_parents" is set to "true" then
desktops/cinema-display will also be valid.
If set to false then a url path ending in "cinema-display" will only be valid if immediately preceeded by "monitors". so:
monitors/cinema-display will be valid and but
desktops/cinema-display will not.
See thread here for more info and/or discussion:
COMPATIBILITY: This has been tested on 1.5.5 and up. It will probably work on earlier versions but it's a freebie and I'm too lazy to test. Feel free to comment if it's working for you on an earlier version so others will know.
|6/25/2014 • v1.2.1||Fixed bug in initial product alias query.|
|6/23/2014 • v1.0||Initial Release|