Adding Category Name and Product Name in URL in 2.70

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
how to add Category Name and Product Name in URL
e.g

computers/desktop etc in 2.70 please
11 years ago
220 view no reply_so far i thought this feature was important
11 years ago
Given you need VS2012 to run the source code it seems likely that not many people have the ability to help you out at this stage.
11 years ago
they can use web developer express 2012 for freee
11 years ago
Well it's on download but given there isn't a version for XP there may be some issues with me running Express.
11 years ago
1463  view anyone :)
11 years ago
I need this function too.

I'm customizing but...


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


I still don't know how this route works when there is no Product ID and the action still require the ID.

I've tried to modified the route like this:


routes.MapLocalizedRoute("Product",
                                     "jeans-for-men/{SeName}",
                                     new {controller = "Catalog", action = "Product"},
                                     new[] {"Nop.Web.Controllers"});


But...error
11 years ago
its not that simple. I have looked into it in more detail. However it needs time because even if you add another mapping in the route you need to change each action inside cateloguecontroller to return category SeName for products.

I guess i might do it but perhaps may be during christmass
11 years ago
salluu wrote:
its not that simple. I have looked into it in more detail. However it needs time because even if you add another mapping in the route you need to change each action inside cateloguecontroller to return category SeName for products.

I guess i might do it but perhaps may be during christmass


Yes, that's right. I have to modify the route for each action.
11 years ago
Just for information:

routes.MapLocalizedRoute("ProductSEO",
                            "quan-cafe/{CategorySeName}/{SeName}-{productId}.html",
                            new { controller = "Catalog", action = "Product", CategorySeName = "quan-ca-phe-dep", SeName = UrlParameter.Optional },
                            new { productId = @"\d+" },
                            new[] { "Nop.Web.Controllers" });


Add CategorySeName to some models and:

<a href="@Url.RouteUrl("ProductSEO", new { SeName = Model.SeName, productId = Model.Id, CategorySeName = Model.CategorySeName })">@Model.Name</a>
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.