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

Forums / Ecommerce / ProductType custom fields on widget template

ProductType custom fields on widget template

7 posts, 0 answered
  1. don
    don avatar
    9 posts
    Registered:
    18 Dec 2008
    25 Aug 2011
    Link to this post
    I have created a product type and added custom fields.
    I added the Catalog widget to a page, and I click the Edit button to see the widget properties dialog.
    I go to the single item settings, and I have created a template there by copy/pasting the "Product Details" template found in the Widget Templates list.

    I would like to explicitly reference my added fields on this template but I cannot get it to work.
    The template does include a reference to "sf:ProductDynamicFields" and this does display my fields.  But I want to have more control than this and explicitly reference my dynamic fields in my template.

    In the List Template I can reference my custom field using "< % Eval" syntax but this does NOT work in my single item template.

    Please help!
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    30 Aug 2011
    Link to this post
    Hello Don,

    The ecommerce module still doesn`t support custom fields from new product type to be displayed dynamically in single item settings. Please excuse us for the inconvenience.

    Greetings,
    Stanislav Velikov
    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 >>

  3. Ben
    Ben avatar
    44 posts
    Registered:
    27 Sep 2012
    16 Jan 2012
    Link to this post
    I was associating documents to products and saving their guids in the back end and ended up finding a way to use my custom fields in the product details template 

    You'll need to map a product details template to an external file so you can run code in the code behind. Do that by following Josh Morale's post here, I used option one: http://www.sitefinity.com/blogs/joshmorales/posts/11-05-10/mapping_external_templates_for_sitefinity_4_widgets.aspx

    Once you are able to get that working, you can query your custom fields using an OpenAccess extension method, this is how I got my document urls:

    using Telerik.OpenAccess;
     
    CatalogManager catalogManager = CatalogManager.GetManager();
    Product _product = catalogManager.GetProducts().Where(p => p.Title == productTitle.Text).FirstOrDefault();
     
    string strGuid = _product.FieldValue<string>("YourCustomFieldName");
     
    string documentLink = "#";
     
    documentLink = App.WorkWith().Document(new Guid(strGuid.Trim())).Get().Url;

    Hope that helps someone.

    -Ben

  4. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    19 Jan 2012
    Link to this post
    Hi Ben,

     Thank you for sharing this solution with the community. We really appreciate when people collaborate, help each other and share resources. I have updated your Telerik points!

    Kind regards,
    Stanislav Velikov
    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
  5. Richard
    Richard avatar
    164 posts
    Registered:
    21 Nov 2009
    14 Jan 2014 in reply to Stanislav Velikov
    Link to this post
    Hi

    Has this moved on in the newer versions of SF, and possible without the customisation?

    Thanks

    Cheers
    Richard
  6. ALeksey
    ALeksey avatar
    2 posts
    Registered:
    16 Oct 2015
    24 Oct in reply to Stanislav Velikov
    Link to this post

    any news on that?

    how to display the custom field in the single product template? Eval does not work for custom field number type

  7. ALeksey
    ALeksey avatar
    2 posts
    Registered:
    16 Oct 2015
    24 Oct in reply to ALeksey
    Link to this post
    oops... sory all work fine :)
7 posts, 0 answered