Developer forum

Forum » Development » Problems with price provider extension

Problems with price provider extension


Reply

Im developing a custom price provider for en ecom solution but has ran into a problem.

 

I override the FindPrice method and in it i need to access the products custom fields and their values. The product that is recieved as a parameter has a property named "CustomFieldsXml"  that returns a string, but its empty (But i HAS a custom field with a value).

 

Do i need to do something special to get the data into the property or is it a bug?


Replies

 
Reply

Hi Kevin
 

 

You need to access the products "ProductFieldValues" property.

This will return a ProductFieldValueCollection to you which will contain the values you are looking for.

 

Example:

 

VB:

Dim v As Object = product.ProductFieldValues.GetProductFieldValue("NameOfYourCustomField").Value

 

C#:

Object v = product.Pro.....

 

Note that the field value is returned to you as an Object. You will need to type cast it before using it. Also note that the name of the field you want to retrieve must be the systemname for that field.

 

Happy coding!

 

Regards

Suurland

 

You must be logged in to post in the forum