Hi guys,
I am wondering if there is any way I can create a custom product field that is displayed just like the Depth, Length or Height.
I mean, with a unit at the right of the input field.
Thank you,
Adrian
Hi guys,
I am wondering if there is any way I can create a custom product field that is displayed just like the Depth, Length or Height.
I mean, with a unit at the right of the input field.
Thank you,
Adrian
That is not possible right now.
You can however, create a fieldtype provider that will render a append box.
See examples attached.
BR Nicolai
Hi Nicolai,
Thank you. I have imagined it should be custom but I was not sure that it could be done even with custom code.
Thank you for sharing your code.
Adrian
Hi Nicolai,
Does this exist as a TFS item already? I see this request "more and more" with customers. The unit might just be a label that's appended to the field value. Making it a string allows for any string the customers would have needs for.
Best Regards,
Nuno Aguiar
Hi Nicolai,
One of my colleagues tried to create a new FieldType and I got this feedback:
".. I see that in Dynamicweb.Ecommerce.FieldTypeProviders dll is defined a class (LengthFieldTypeProvider) that is created from abstract class ConversionUnitFieldTypeProviderBase; I want to create a similar class like LengthFieldTypeProvider ; I have to create it from my own custom dll; the problem is that I have to overwrite the function InitalizeOptions ( override Dictionary<string, ConversionUnit> InitalizeOptions()); the problem is that in class ConversionUnitFieldTypeProviderBase function InitalizeOptions is declared internal and is not exported in dll to be seen from others dll( internal abstract Dictionary<string, ConversionUnit> InitalizeOptions()).
Can be function InitalizeOptions declared public or protected so it can be seen from derived classes?
..."
What would be the recommended approach?
Thank you,
Adrian
The base class is also in the project I gave you. Rewirte it or better yet, do not inherit that class, but just copy what you need.
Hi Nicolai,
Thank you. We'll do that.
Adrian
You must be logged in to post in the forum