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

Make GiftCardType a bundle plugin #1

Open
mglaman opened this issue Sep 22, 2020 · 3 comments
Open

Make GiftCardType a bundle plugin #1

mglaman opened this issue Sep 22, 2020 · 3 comments

Comments

@mglaman
Copy link

mglaman commented Sep 22, 2020

Perhaps we should make GiftCardTypes a bundle plugin. This would help us integrate with third-party gift card providers to manage balances. This would work the same way as PaymentType and PaymentMethodTypes.

This could help @eiriksm. Not 100% sure how, but it makes it more feasible to extend the gift card system. And I'm not sure how many gift card types there would be to warrant making it a config entity

@Berdir
Copy link
Member

Berdir commented Sep 22, 2020

Not against the idea, but I'm also not sure what the benefit exactly would be.

The plugin bundle thing is neat if you actually have plugins that do something. Right now, the only thing that can be controlled through the type is generate code settings (of which there is currently on the length but that can be extended). I suppose that could be moved to the plugin, but you'd still need basic settings then and a place to store them for something as simple as the length of your generated gift card codes?

I know that the client of my client has at least a few different types, although theoretically they could also have their own type/category system using a term field or so. I don't think something like that existed in D7 either.

I would expect that most third party integrations are basically about exporting/importing coupon codes, that's just standard entity API through custom endpoints, json API or whatever. Export can just as well listen on entity crud hooks/events and importing can't go through a plugin, as you need something to create the entity in the first place, needs to come from "the outside".

And not sure how plugins would be involved in the checkout process. One part that still needs to be improved is validation/conditions to control for what giftcards can be used, not sure yet if I can use the commerce condition system on a config entity but a plugin wouldn't really make it easier unless you want to hardcode all the conditions and again, an event would work for that too.

@eiriksm
Copy link
Contributor

eiriksm commented Sep 25, 2020

I feel pretty confident I can achieve what I want from swapping services and classes, and would probably prefer that over bundle plugins. We can have this issue open if someone else wanted that though? 😄

Thanks again for making this available by the way @Berdir , awesome work!

@mglaman
Copy link
Author

mglaman commented Sep 25, 2020

Okay, sounds fine to me. I'm in general against using config entities for bundles lately (just easier, less screens).

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

No branches or pull requests

3 participants