Has anyone created the ability to use VARIBLES to add Product information to the URL?
/apple-blossom-and-blueberry-wall-stencil-p7883_sku_1694.aspx (Example URL)
Example of Variable to create url above:
Custom Url: &_SKU_<%Sku%>%
Custom URL Varible for Sku#
Re: Custom URL Varible for Sku#
I believe this is only possible with full source code. The Product CustomUrl field does not support macro substitution.
With full source code, you would make your changes in the /Catalog/UrlGenerator.cs class. Look for the GetBrowseUrl() method.
You can make any property of the product class a part of the url, but I wouldn't recommend it. Anything other than the ProductId value can be changed and that change will then alter the product url. Now you've broken every search engine link that points to your product page until your site gets indexed again.
This is why Able uses the ProductId (or CategoryId) - that value cannot be changed and thus ensures someone doesn't accidentally break site url links.
With full source code, you would make your changes in the /Catalog/UrlGenerator.cs class. Look for the GetBrowseUrl() method.
You can make any property of the product class a part of the url, but I wouldn't recommend it. Anything other than the ProductId value can be changed and that change will then alter the product url. Now you've broken every search engine link that points to your product page until your site gets indexed again.
This is why Able uses the ProductId (or CategoryId) - that value cannot be changed and thus ensures someone doesn't accidentally break site url links.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: Custom URL Varible for Sku#
The problem is we had added this in the Custom source code on version 7 and need to re adapt as all of the current links are bad. We wanted the SKU to be dominated in a Google search when looking for the product by SKU number. I will look in the source code on Gold and make the adjustments. Thank you!
Re: Custom URL Varible for Sku#
The lesser of two evils at this point
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: Custom URL Varible for Sku#
You are correct, I may just let it reindex...
Re: Custom URL Varible for Sku#
update for those who may find it useful:
I changed first line of code in the Commercebuilder.Catalog.DefaultUrlReWriter
I changed first line of code in the Commercebuilder.Catalog.DefaultUrlReWriter
Code: Select all
private static Regex _defaultRewriteRegex = new Regex(@"^((?:.*/)*).*?-(C|P|W|L)(\d+)(?:[C](\d+))?(_sku_(\d+))?\.aspx$", RegexOptions.IgnoreCase);