shoppingflux / shoppingfluxexport

7 stars 7 forks source link

Additional fields to export do not take in consideration languages and type #400

Closed ghost closed 5 years ago

ghost commented 5 years ago

Expected behaviour

It's currently possible to check in the module's configuration additional fields to export. These fields are listed thanks to getOverrideFields function. These fields should then be correctly exported in the generated feed.

Actual behaviour

These fields are not correctly exported in the generated feed when they have languages option enabled.

For example, this field will be correctly exported: 'a_new_field' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),

However, this field will not be exported: 'a_new_field' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'IsGenericName', 'size' => 255),

This is due to the lang parameter that will generate an array instead of a plain value (string, int...).

Secondly, there is no verification on the field type that is currently done. It will list and try to export TYPE_INT, TYPE_STRING, TYPE_FLOAT, TYPE_BOOL, TYPE_DATE ... There should be a support for the different types, or when a type is not supported, then it should not be listed in the module configuration.

Steps to reproduce the behaviour

Create a custom field for a product (in ProductOverride with the lang parameters enabled. Then export the feed for this product and notice that this field will not be exported.