My editor is vs2015 community.
Currently default nopCommerce supporting only two character for Unique SEO code
But I need to at least five character. e.g if Vietnam English then url will be /vn-en and if Vietnam Vietnamese then url will be /vn-vi
So I am thinking to add vn-en and vn-vi in Unique SEO code. But its supporting only two character. So i did some change in code.
- LanguageMap.cs HasMaxLength(2) to HasMaxLength(5)
- LanguageValidator.cs Length(2) to Length(5)
- nvarchar(2) to nvarchar(5) in Language table
Then nop is allowing me to add five character in that field.
But when i am changing language from front store then url displaying like /vn-vi/vn-vi. Means displaying seo code two times. And I can see 404 page not found direct html code in output.
When two character in that field then working fine. I have missing some steps?
Anyone can please guide me?
Awaiting for your response
After investigating the issue that you're facing is because ofAddLanguageSeoCodeToRawUrlmethod ofLocalizedUrlExtenstionsadding SEO code two times.I think we can make it fix to check
UniqueSeoCodebefore adding it to the URL.Add if condition in
AddLanguageSeoCodeToRawUrlmethod, and check!Change
_seoCodeLengthfrom 2 to 5 inLocalizedUrlExtenstionsat Nop.Web.Framework > LocalizationHope this helps!