Developer forum

Forum » Dynamicweb 10 » PIM - Field value unit conversions not saved in database

PIM - Field value unit conversions not saved in database

Barend Mosch
Reply

Hi,

I've noticed that they way field value conversion are done in DW10 is significantly changed in relation to DW9. The concept is clear,

1. Create the Field value conversion
2. Assign the conversion to a product field or category field
3. Unit is visible in the product editor

In DW, the value + chosen unit is saved in the database. (5,00 ml) for example. I'm not seeing this behaviour in DW10. Is it saved somewhere else? A relation table for instance?

Example: (decimal custom product field)
Field value conversion with 2 symbols:

- Factor stays the same since its only visual. The client can choose to import the value in Liters of Mililiters.

Conversion selected on the productfield:


2.00 saved a L selected:

Database just saves '2' instead of '2,00 L' or '2 L' like DW9.


The client would like to import the value + unit since we have a lot of unit conversions. Also, if this field is used as specification for the Ecommerce. How will the unit be visibible if the chosen unit is not saved in the database?

Cheers in advance! please correct me, if Im looking at the wrong place.
Kind regards,

Barend 

Tested on DW 10.15.3 and 10.19.14


Replies

 
Michael Knudsen
Reply

Hello Barend,

- Field value conversions (Settings > Areas > Products > Attributes > Field value conversion > Field value conversion groups) are saved in the following tables: EcomFieldValueConversionGroup + EcomFieldValueConversion. Verified in DW10.20.8.

I know there have been some issues with the fields in earlier versions of DW10, so you might have to upgrade to latest version before it works as expected.

Br. Michael Knudsen

 
Barend Mosch
Reply

Hi Michael,

Thansk for your response.

Indeed EcomFieldValueConversionGroup and EcomFieldValueConversion contains the definition of the unit measures and conversions.
But is there a table that saves the relation between the product, their product field data and its corresponding measure?
In the above example: I know that ml -> L conversion in saved in the above stated tables, but the 'L' part of the '2 L' value is not.

I'm looking for the '2 L' fully.

Cheers!

 
Michael Knudsen
Reply

Hello Barend,

- I think the value "2 L" are calculated each time you ask for the value in the field, so nothing are required to re-calculate if the conversions changes.

I found some new fields on EcomProductField:
ProductFieldValueConversionPreset + ProductFieldValueConversionDecimals + ProductFieldValueConversionDisplayRule

Br. Michael Knudsen

 
Barend Mosch
Reply

Yes, those fields correspond with these: 

For example. When importing decimal data, such as weight, it's not possible to specifically import into a unit that is not selected as default. 
Say we have 'weight', with gram -> kg as unit options. Default = gram, but this product has its data stated in kg, we have to make the conversion in the source file since we cannot state the unit in the import since it's not stored in the database.

When I compare it to DW9, the unit conversion is created as custom product field types, meaning that a value of 'weight' is stored as '9,5 kg'. Meaning you can import '10 gram' in weight, and it automatically selects 'gram' in the unit list. I'm not seeing a similar idea in DW10 so far.

 
Barend Mosch
Reply

Hi there,

I think I'm not understanding this fully.

Say I have a unit conversion of ml -> L:


The unit conversion is used on a product category field called 'Inhoud'.
On a test product the value 13,54 is filled with mililiters as the unit:


In the database only the numerical value is saved. How do we know this is specifically the value for ml?

Converting this to liters by selecting L is the list will not save the corresponding converted value in the database:

- Keeps 15.54 in the database

Is this the intended way for working with unit conversions?

I have a feeling it might have something to do with the presentation unit. Apparently, products will always bounce back to the unit selected here. On Product Fields we can set this back to nothing, this will also remove the selected conversion definition when save and close the product field. Also, this option is not available on product category fields.


Looking forward to hearing more.

Tested on DW versions 10.20.12 and 10.19.14.

 
Barend Mosch
Reply

Hi there,

Is there an update on this?

 

You must be logged in to post in the forum