ProductType custom fields on widget template
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!
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 >>
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
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,Hi
Has this moved on in the newer versions of SF, and possible without the customisation?
Thanks
Cheers
Richard
any news on that?
how to display the custom field in the single product template? Eval does not work for custom field number type
oops... sory all work fine :)