rng icon indicating copy to clipboard operation
rng copied to clipboard

Drupal Commerce integration

Open jonathanjfshaw opened this issue 8 years ago • 26 comments

I'm sure it's been thought about, but there wasn't an issue yet.

Integration with Drupal Commerce when it matures for D8 would seem vital.

jonathanjfshaw avatar Apr 06 '16 15:04 jonathanjfshaw

Commerce is still in alpha and I personally wont be looking at requirements for RNG until at least beta. Depending on how domain-centric the integration is, it may be suitable to implement the integration in a middleman module dependent on both RNG and Commerce.

I remain open to plans or proposals.

dpi avatar Apr 06 '16 23:04 dpi

Has there been any further movement on this issue given that Commerce is now in beta?

chrisrikli avatar Nov 02 '16 14:11 chrisrikli

I dont have plans to address this. Patches, or preferably third party modules, welcome.

dpi avatar Nov 08 '16 01:11 dpi

hi dpi

Where would one add code inside the rng code ecosystem for this sort of connector?

marqpdx avatar May 05 '17 23:05 marqpdx

@marqpdx I ended up doing a pretty extensive integration between Commerce and RNG. I started it with the intent of being able to share it with the community however the integration was far too specific to really be generally applicable.

Note that none of the things I did required adding code to the RNG ecosystem. It can all be done by leveraging the Entity API and the EventSubscriber API w/in D8 as well as the CommerceCheckoutPane plugin ecosystem (which are....not exactly documented).

I can tell you that I had to do the following:

  • Create a mechanism to map Product Variations Types to Registration Types
  • I needed to collect information contingent on the Product Variation Type being purchased (e.g. an Exhibition Booth purchaser needed to select their booth location as well as the names/emails of the two registrants per booth). So I had to create custom CommerceCheckoutPane plugins to detect the need for and then collect this information.
  • Once checkout was completed then I had to create EventSubscriber classes to take the collected data and create the appropriate Registration/Registrant/User|RNGContact.

Not at all a casual integration.

At this level of customization to be 100% candid all I'm really using RNG for is the entities that it provides. I'm not using any of the provided UIs...everything is populated and controlled programmatically.

chrisrikli avatar May 06 '17 17:05 chrisrikli

I'm working on a similar thing now. I think that creation of the registration at purchase of a product variation would be a nice action or rule to be able to fire. And sync in information from the user's profile. But a lot of the details of syncing fields are going to be custom per site. But the sync action seems re-usable.

heddn avatar Jun 08 '17 21:06 heddn

Hi, @chrisrikli - it sounds like you've done exactly what I want to accomplish. Would you be interested in sharing any of your custom code? Thanks! -Steve

steveoliver avatar Jun 19 '17 22:06 steveoliver

I've got registrations happening on event checkout completion now. I've got to say, so far the implementation has been very pleasant--after initial configuration, it works great alongside my product entities and Commerce checkout workflow. I've got more to do (like open one small but blocking issue I found), but a huge kudos to @dpi and others for this awesome module!

steveoliver avatar Jun 21 '17 03:06 steveoliver

Hi Steve,

Congrats! it would be great if you could share your work as an example to others.

On 21 June 2017 at 04:50, Steve Oliver [email protected] wrote:

I've got registrations happening on event checkout completion now. I've got to say, so far the implementation has been very pleasant--after initial configuration, it works great alongside my product entities and Commerce checkout workflow. I've got more to do (like open one small but blocking issue I found), but a huge kudos to @dpi https://github.com/dpi and others for this awesome module!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dpi/rng/issues/84#issuecomment-309955289, or mute the thread https://github.com/notifications/unsubscribe-auth/ADWYQS8y32SQi7TNFw9S5s0-jJilPjfDks5sGJLtgaJpZM4IBLRr .

jonathanjfshaw avatar Jun 21 '17 09:06 jonathanjfshaw

Plus 1 for this @jonathanjfshaw

it would be great if you could share your work as an example to others.

norwegianblue-nz avatar Jul 06 '17 08:07 norwegianblue-nz

Hi @heddn, code looks useful. Can you move this code to a Gist or a new Github repo.

Deleted comment, see gist in next comment

dpi avatar Jul 06 '17 13:07 dpi

https://gist.github.com/heddn/119a439ead6189ddd6c835aa65c7348e

heddn avatar Jul 06 '17 17:07 heddn

Hi @dpi, Do you plan to create a release that connect rng to commerce ? If so, do you have an idea about delay ? Many thanks for your work Christophe Bourgois

citananda avatar Jul 25 '17 10:07 citananda

@chrisrikli, @steveoliver I would also be interested to see an example implementation of RNG with Drupal Commerce.

MegaChriz avatar Aug 22 '17 15:08 MegaChriz

@MegaChriz Very much like @heddn's gist above. If you have any specific questions, feel free to ask in the Drupal Slack channel or on https://drupal.stackexchange.com/questions/tagged/rng and tag it with commerce.

steveoliver avatar Sep 07 '17 00:09 steveoliver

Also, after doing integration on my project--which is quite light (config, access checks and register/deregister)--, I don't think there is going to be any generally useful module, since the integrations will probably vary wildly based on things like product, order, checkout flow and customer types plus other project-specific business logic.

steveoliver avatar Sep 07 '17 00:09 steveoliver

Is there any documentation in how to set this up?

ghost avatar Dec 13 '17 16:12 ghost

@heddn Could you attach a few words to what assumptions the above code snippet makes of the configuration of the commerce shop? what is the data relations between the order, the product etc.? and how have these been linked to an event?

lslinnet avatar Jan 24 '18 07:01 lslinnet

I think I assume that the rng entity is called 'registration'. And users would be the ones registering.

heddn avatar Jan 25 '18 15:01 heddn

@heddn - I am new to Drupal 8 and am looking for a payment mechanism to pay for RNG registrations in Commerce. Is your code supposed to be a standalone custom module? I just need to be able to sell tickets to events, pretty straightforward. I would be interested in understanding further how to implement your code, or possibly pay to have you put it into a module.

1959mvp avatar Jan 29 '18 21:01 1959mvp

I've done extensive work on RNG / Commerce integration. Anyone interested, feel free to ping me on drupal.slack.com #commerce to discuss your specific use case(s).

steveoliver avatar Jan 29 '18 22:01 steveoliver

@1959mvp feel free to contact me in slack as well. I'd be pleased to help you in any respect.

heddn avatar Jan 29 '18 22:01 heddn

@steveoliver What is your slack name? We are going to work on a possibly similar case.

haringsrob avatar Mar 14 '18 10:03 haringsrob

I've done extensive work on RNG / Commerce integration. Anyone interested, feel free to ping me on drupal.slack.com #commerce to discuss your specific use case(s).

Hi, I want to integrate RNG with susbscription(free or paid). How can I achieve?

riturajgupta avatar Nov 22 '18 05:11 riturajgupta

@riturajgupta I have worked on a module for integrating RNG with Commerce: https://www.drupal.org/sandbox/megachriz/2940732

Part of the module is based on code shared by @chrisrikli.

I did not manage yet to make the module generic enough. Therefore it does make a few assumptions on your setup. There are also a few pieces missing, like making sure that the checkout panes get updated when adding, editing or removing registrants via AJAX. For my client, that part got too much tangled with business logic (read: site specific dependencies) so I had to leave that out for Commerce RNG.

But maybe it could help you as a starting point?

MegaChriz avatar Nov 23 '18 09:11 MegaChriz

There is a published contributed product for this now currently in development: https://www.drupal.org/project/commerce_rng

ChristopherMatthews avatar Dec 27 '19 02:12 ChristopherMatthews