Yes. A couple of different ways actually.
- Rename your category to include what you want shown in the URL. This is the simplest solution to change the text displayed in the URL.
- Use the PCRE filter to replace "girls toy" with "girls toy party supplies". The PCRE filter essentially uses PHP preg_replace to change the "name" returned. While this does allow lots of flexibility if you have a large number of rules it can slow down your website (I generally use no more than five or six).
- Add a "defined URLs" file. This is not documented anywhere (on purpose) and requires the "global" cache to be enabled. Using this option essentially tells the module "Do not determine the text to be added to the URL, here is what you should use". Be careful when using this method to ensure your URLs are valid (no spaces, no extended character sets etc) or if you absolutely must use non conforming characters run rawurlencode over the URL first.
More Details
- Simply open up the Zen Cart administrative interface and navigate to the category you wish to change. Edit the category title. This module will automatically know you made the change and handle altering the generated URLs, canonical URLs, and redirects if you have them enabled.
- Change the configuration setting for the PCRE filter... Adding something like "^girls toy$=>girls toy party supplies". May need to alter this a little depending upon your server. Again, the module will handle generating the new URLs, canonical URLs, and redirects if you have them enabled.
- Create the file "/includes/languages/english/extra_definitions/url_overrides.php". For categories add "define('CATEGORY_NAME_3_15','girls-toy-party-supplies');" where "3_15" is the full cPath for the category. For products add "define('PRODUCT_NAME_20','party-favors');" where "20" is the product ID. Make sure the "global" cache is enabled. In this mode you will need to manually update the file in the future if you wish to change the URL for a category or product defined in this file (ones not defined here are still automatically generated).
Another Consideration
Keep in mind depending upon your category structure, you may want to have two categories... One "girls toy" category and a sub-directory "party supplies"... If you enabled "url format: parent" and "categories as directories: short" your category URL would become "/girls-toy-party-supplies-c-3_15/party-favors-p-20". Keep in mind these settings will affect all generated URLs.
Bookmarks