SyliusImportExportPlugin icon indicating copy to clipboard operation
SyliusImportExportPlugin copied to clipboard

How can I customize the importer / exporter?

Open andychan94 opened this issue 4 years ago • 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!

andychan94 avatar Aug 29 '20 15:08 andychan94

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 avatar Sep 04 '20 14:09 oallain

@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?

cdarken avatar Oct 15 '21 12:10 cdarken

Any suggestions here? Should I open a new issue?

cdarken avatar Nov 14 '21 15:11 cdarken

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 ?

t-n-y avatar Mar 16 '23 14:03 t-n-y

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 avatar Dec 14 '23 10:12 lorenzo-shots

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

t-n-y avatar Dec 14 '23 11:12 t-n-y