FriendsOfSylius/SyliusImportExportPlugin

How can I customize the importer / exporter?

Opened this issue · 6 comments

Hello.
I want to add some fields to the importer and exporter, but I cannot figure out a way to extend & customize the plugin.
Are there any docs written about this anywhere? Or is there a PR I can refer to?
Thank you in advance!

Hello @andychan94

Have you find your answer ?
In the Readme we have some informations about exporter, you can find it here https://github.com/FriendsOfSylius/SyliusImportExportPlugin#a-real-example
In example, exported fields are in third position of arguments.

Regards

@oallain bumped into this requirement too. the instructions are clear enough, but I wanted to add support for Brand import, with loevgaard/sylius-brand-plugin.
If I understand correctly, I need to make my own product processor, right? But how do I add just a Brand retrieval and association like setBrand without rewriting your ProductProcessor class, as I cannot extend it, given that it's a final class?
I'm new at Symfony, but I found the parent service feature, should I use that?

Any suggestions here? Should I open a new issue?

t-n-y commented

Hey,

Any update on that issue? I want to add field to the product export, but i can't extend ProductResourcePlugin as it's a final class. Any other simple solution ?

Yes @t-n-y , if it's final you can't extend ProductResourcePlugin, but you could override it copying it in your src/ dir, modify the code parts to your needs and redefining the vendor one in the services.yaml with your overridden ProductResourcePlugin.

@lorenzo-shots I know, my question was to avoid doing an override to every files i need to modify