webgriffe/SyliusAkeneoPlugin

Channels resolver per product

Closed this issue · 5 comments

aleho commented

If, for whatever reason, an import from a single Akeneo channel should be split for different Sylius channels (e.g. via attribute channel) there's currently no way to have different products land in different channels.

What's your opinion on this?
Shouldn't the ChannelsResolverInterface rather be a single ChannelResolverInterface operating per product instead of on all?

I might be able to draft a PR next week, if you agree.

(This is probably related to #2.)

Hi @aleho,
I don't understand, what do you mean?

The ChannelResolverInterface is called for every product and you can implement a custom one that resolve to different Sylius channels based on this channel attribute.

What do you think?

aleho commented

Yes, sorry, that was a bit fuzzy.

I meant: Would you accept a ChannelResolver (singuular) operating on each individual product, or would you recommend using a custom ValueHandler, effectively cancelling the behaviour of the ChannelsResolver (plural)?

No sorry I still don't understand. The channel resolver already operates on each individual product.

aleho commented

Hmm, am I a bit stupid I guess.

There's the ChannelsResolverInterface which gets an array of product.

I'm actually so used to seeing DTOs that my mind automatically parsed this as "array of product objects" not a product represented by an array.

Sorry for the noise!

No problem @aleho!