Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to export custom fields of type price as CSV #3325

Closed
rmobis opened this issue Sep 25, 2023 · 2 comments
Closed

unable to export custom fields of type price as CSV #3325

rmobis opened this issue Sep 25, 2023 · 2 comments
Labels

Comments

@rmobis
Copy link

rmobis commented Sep 25, 2023

PHP Version

8.1.13

Shopware Version

6.4.20.2

Expected behaviour

Through the admin dashboard, it should be possible to include custom fields of type price in exports.

Actual behaviour

An empty value is exported for that field.

How to reproduce

  1. Create a new custom field set for product entities (Settings > System > Custom Fields)
    1. Create one field of type Price
  2. Set a value for this newly created field in any product
  3. Create a new import/export profile for product entities
    1. Add the field you just created to the export
      1. First select translations.DEFAULT.customFields
      2. Then translations.DEFAULT.customFields.<field-name>
  4. Try to export using your newly created profile
    1. Notice the values for your field are all empty

Step 3.i.b is probably the first sign something is wrong. As can be seen in the regular price field, there should be "sub fields" for each currency and for net/gross prices (price.DEFAULT.net or price.USD.gross), but there is none for this custom field.

Trying to manually type the value in doesn't allow saving. I also tried editing the mappings directly in the database to many different possibilities, none of them worked. The "closest" I got was translations.DEFAULT.customFields.<field-name>.<currencyId> but that just tried to export an object of type Shopware\Core\Framework\DataAbstractionLayer\Pricing\Price which fails serializing.

Doing some debugging and actually looking through the code I figured the issue in the end is probably in Shopware\Core\Content\ImportExport\DataAbstractionLayer\Serializer\Field\CustomFieldsSerializer where it doesn't take the same approach as PriceSerializer for custom fields of type price.

@rmobis rmobis added the Bug label Sep 25, 2023
@rmobis
Copy link
Author

rmobis commented Sep 25, 2023

Uh, nevermind, this is indeed a dupe of NEXT-25279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant