URL structure

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 năm cách đây
Hello,

I am new in nopcommerce, so dont judge me(a lot) :)

How can I change the url structure of my nopcommerce store from www.myshop.com/fruit-tea/ to www.myshop.com/shop/fruit-tea/.

"shop" always must be in url link when i am browsing in categories or products.

Thank you in advance!
7 năm cách đây
[email protected] wrote:
Hello,

I am new in nopcommerce, so dont judge me(a lot) :)

How can I change the url structure of my nopcommerce store from www.myshop.com/fruit-tea/ to www.myshop.com/shop/fruit-tea/.

"shop" always must be in url link when i am browsing in categories or products.

Thank you in advance!


I think you will need to  customize  the GenericUrlRouteProvider.cs file
namespace Nop.Web.Infrastructure

Like bellow==>

  routes.MapLocalizedRoute("Product",
                                     "shop/{SeName}",
                                     new { controller = "Product", action = "ProductDetails" },
                                     new[] {"Nop.Web.Controllers"});



If face problem can knock me.
7 năm cách đây
You may drive inspiration from this article I've written, if you are technical enough Hierarchical Product Url (With Category Breadcrum In The URL) In NopCommerce

Otherwise no, there is no out-of-the-box way to achieve this. :)
7 năm cách đây
sohel wrote:
Hello,

I am new in nopcommerce, so dont judge me(a lot) :)

How can I change the url structure of my nopcommerce store from www.myshop.com/fruit-tea/ to www.myshop.com/shop/fruit-tea/.

"shop" always must be in url link when i am browsing in categories or products.

Thank you in advance!

I think you will need to  customize  the GenericUrlRouteProvider.cs file
namespace Nop.Web.Infrastructure

Like bellow==>

  routes.MapLocalizedRoute("Product",
                                     "shop/{SeName}",
                                     new { controller = "Product", action = "ProductDetails" },
                                     new[] {"Nop.Web.Controllers"});



If face problem can knock me.



This didnt work:
The parameters dictionary contains a null entry for parameter 'categoryId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Category(Int32, Nop.Web.Models.Catalog.CatalogPagingFilteringModel)' in 'Nop.Web.Controllers.CatalogController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
7 năm cách đây
wooncherk wrote:
You may drive inspiration from this article I've written, if you are technical enough Hierarchical Product Url (With Category Breadcrum In The URL) In NopCommerce

Otherwise no, there is no out-of-the-box way to achieve this. :)


Thank you for shearing great article.
7 năm cách đây
[email protected] wrote:
Hello,

I am new in nopcommerce, so dont judge me(a lot) :)

How can I change the url structure of my nopcommerce store from www.myshop.com/fruit-tea/ to www.myshop.com/shop/fruit-tea/.

"shop" always must be in url link when i am browsing in categories or products.

Thank you in advance!

I think you will need to  customize  the GenericUrlRouteProvider.cs file
namespace Nop.Web.Infrastructure

Like bellow==>

  routes.MapLocalizedRoute("Product",
                                     "shop/{SeName}",
                                     new { controller = "Product", action = "ProductDetails" },
                                     new[] {"Nop.Web.Controllers"});



If face problem can knock me.


This didnt work:
The parameters dictionary contains a null entry for parameter 'categoryId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Category(Int32, Nop.Web.Models.Catalog.CatalogPagingFilteringModel)' in 'Nop.Web.Controllers.CatalogController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters


Take a look above answer that replied by wooncherk (Thanks Woon, my boss) and you may go through ==> GenericPathRoute.cs  namespace Nop.Web.Framework.Seo
6 năm cách đây
wooncherk wrote:
You may drive inspiration from this article I've written, if you are technical enough Hierarchical Product Url (With Category Breadcrum In The URL) In NopCommerce

Otherwise no, there is no out-of-the-box way to achieve this. :)


Hi,

Will this work with nopcommerce version 4.0?

-Thanks,
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.