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.
Il y a 11 ans
how to add Category Name and Product Name in URL
e.g

computers/desktop etc in 2.70 please
Il y a 11 ans
220 view no reply_so far i thought this feature was important
Il y a 11 ans
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.
Il y a 11 ans
they can use web developer express 2012 for freee
Il y a 11 ans
Well it's on download but given there isn't a version for XP there may be some issues with me running Express.
Il y a 11 ans
1463  view anyone :)
Il y a 11 ans
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
Il y a 11 ans
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
Il y a 11 ans
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.
Il y a 11 ans
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.