+1-888-365-2779
Try Now
More in this section

Forums / Ecommerce / Change the url of product detail

Change the url of product detail

4 posts, 1 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    26 Aug 2011
    Link to this post
    I came across this post:
    http://www.sitefinity.com/devnet/forums/sitefinity-4-x/general-discussions/how-to-use-a-custom-url-in-the-products-module---solution.aspx

    How can I change the format of the URL's for products inside the ECommerce module?

    Regards,
    Daniel
  2. Venkata Koppaka
    Venkata Koppaka avatar
    67 posts
    Registered:
    24 Sep 2012
    31 Aug 2011
    Link to this post
    Hi Daniel,

    Thank you for contacting support.
    You can change the Url of product detail in two ways -
    1)If you want to remove the published date from the url of the product you can go to Administration->Settings->Advanced->Catalog->Providers->OpenAccessProvider->Parameters and add a new parameter the key of the new parameter will be "urlFormat" and the value will be "/[UrlName]".
    Please note that already existing products will not get the route by default. You will have to publish the exisisting products again.

    2)You can add a class to your project and make the class inherit from "OpenAccessCatalogDataProvider". You can override the below methods to get custom routing.
    Please note that you will need to change ProviderType of catalog (can be changed at Administration->Settings->Advanced->Catalog->Providers->OpenAccessProvider) to have your custom class name.
    public override string GetUrlFormat(Telerik.Sitefinity.GenericContent.Model.ILocatable item)
            {
                return "/[CustomRouteKey]/[UrlName]";
            }
     
            protected override string GetUrlPart<T>(string key, string format, T item)
            {
                if (key == "CustomRouteKey")
                {
                    //Use any mechanism to get the route key
                }
                return base.GetUrlPart<T>(key, format, item);
            }


    Greetings,
    Venkata Koppaka
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

    Answered
  3. denny
    denny avatar
    13 posts
    Registered:
    16 Oct 2007
    10 Dec 2012 in reply to Venkata Koppaka
    Link to this post
    Venkata, when trying to follow example 2 (1 didn't work at all...) I receive the following:

    The type 'T' cannot be used as type parameter 'T' in the generic type or method 'Telerik.Sitefinity.Modules.GenericContent.UrlDataProviderBase.GetUrlPart<T>(string, string, T)'. There is no boxing conversion or type parameter conversion from 'T' to 'Telerik.Sitefinity.GenericContent.Model.ILocatable'
  4. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    13 Dec 2012
    Link to this post
    Hi Denny,

     I have answered your support ticket on this issue. If you have any questions please contact us there!

    Thanks in advance!

    All the best,
    Patrick Dunn
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
4 posts, 1 answered