I would like a “Change quantity” link added to the user/uid/subscription page. This page would allow the user to adjust quantities of a plan up or down.
The module should be aware of the settings configuration>Web Services>Recurly> for “Upgrade plan behavior” and “Downgrade plan behavior”.
I think there might need to be some logic to hide or show both the “change plan” link as well as the “change quantity” link on the list page. When in multiple-plan mode, you don’t really need a “change plan” option, although I suppose it doesn't really hurt. But not everyone will want a “change quantity” option.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | interdiff.txt | 695 bytes | eojthebrave |
| #18 | quantity-changes-2025995-18.patch | 14.53 KB | eojthebrave |
| #16 | quantity-changes-2025995-16.patch | 14.39 KB | blakehall |
| #3 | change-quantity.jpg | 52.1 KB | JayShoe |
Issue fork recurly-2025995
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
JayShoe commentedPS - The "signup" page will also need editing to include the option to adjust the quanity desired.
Comment #2
quicksketchCould you make a rough mockup of what you're wanting here? I'm not sure what a "Change quantity" link would link to.
Comment #3
JayShoe commentedHello Quicksketch,
Again, thanks for the response. Here is an example of where the Change Quantity button would be. This would allow a user to change the quantity from 1 to 2, or from 5 to 3.
Jay
Comment #4
quicksketchThis sounds like a good suggestion. I'd be fine with removing the "Change plan" option while in multi-plan mode and just sticking with quantity. Dealing with changing 10x plans to a different plan or changing just 5 of 10 plans to a different plan is too complicated a workflow for developers and end-users alike.
Comment #5
aburke626Comment #6
aburke626Comment #7
nickonom commentedComing from #2838897: Allow users to subscribe to a single plan multiple times Any updates on this one?
Comment #8
markdorisonAny new work on this should go against 8.x-1.x or 7.x-3.x. Preferably the 8.x branch and then backported to 7.x-3.x.
Comment #9
nickonom commentedAh, it will take forever and we need this feature for Drupal 7 project soon. Could I offer some bounty to developers or should I start searching other developers?
Comment #10
markdorison@nickonom: Whether it goes against 7.x-3.x and is forward ported or 8.x-1.x and back ported is not that important, I was just expressing a preference. If the code is written well, the time to port it should be minimal.
If there is a feature you have urgent need of, you are welcome to submit a patch for it and we would be happy to review it. If you need/want to hire someone to implement this code, that is perfectly fine. We have previously done work that was sponsored by third parties; in fact that is how this module originally came into existence, and how it got ported to the RecurlyJS v4 API. If this is of interest to you, send me a private message and I would be happy to share more details.
Comment #11
nickonom commentedMark, I've just sent you a PM before reading your reply. I am more of troubleshooter, not a coder, so I don't think I'll be able to submit patches, but I'd love to support your contributions to community financially. I will wait for your response.
Comment #12
blakehall commentedWe're in need of adding this functionality on a couple of our sites.
Attached here is a patch that provides the ability to adjust quantity in Drupal 7.
(I'll also be working on a Drupal 8 patch too)
Comment #13
colanComment #14
blakehall commentedI should add that the patch in #12 isn't quite finished, but I wanted to at least move this forward a little bit.
Comment #15
blakehall commentedOkay, here's a D7 patch which will actually allow you to adjust the quantity on an existing subscription as well as specify a value during the initial signup/checkout process.
Comment #16
blakehall commentedAnd here's a patch for D8...
Comment #17
colanLet's get the D8 one in first.
Comment #18
eojthebraveThis is an updated version of #16 with the added ability to specify a quantity parameter in the query string. For example
/group/8/subscription/signup/monthly?quantity=3and have the quantity field pre-populated.As well as the addition of a
data-recurly="plan_quantity"attribute to the form element which the Recurly documentation recommends. It'll be useful in the future if we add support for the recurly.jsrecurly.Pricing()module back into the D8 version.Comment #19
eojthebraveComment #21
eojthebraveThis new MR contains an updated version of the same functionality provided by the previous patch. As well as incorporates ideas from #2838897: Allow users to subscribe to a single plan multiple times. Essentially what we're doing here is letting someone sign up for the same plan multiple times.
I moved most of the functionality into the recurly module instead of recurlyjs because this feature works regardless of if you're using Recurly JS or hosted pages. I also updated the form for changing the quantity of an existing subscription so that it has a confirmation step that informs you about the changes that are going to be made to your account. This uses the subscription preview API to have Recurly calculate the changes, and generate what is essentially a dry run invoice showing the charges and or credits that will be applied to your account as a result of making this change. This seems a lot more reliable than trying to perform this calculation ourselves given all the possible permutations of credits/charges/refunds and how different payment providers handle those.
And the form now requires you to preview the change before you can save the change.
Finally, I added tests for both the addition of the quantity field on the Recurly JS checkout form, and for the form for changing your subscription quantity in the main recurly module.
Comment #22
blakehall commentedThis looks good to me, and I really like this approach.
Comment #24
eojthebraveThanks for the review @blakehall. I merged the code from MR12 and this feature is now available in the 4.x-dev branch and will be in the next release. There may still be some additional edge-cases to sort out, but we can open new issues to deal with anything that comes up.
Comment #25
eojthebraveThere's a patch above that works in Drupal 7 (we're using on Drupalize.Me) but it would need to be refactored a bit to match the features in the Drupal 8+ / 4.x branch of the module. The big change would be in moving the change quantity form and related code into the base recurly module instead of the recurlyjs module.
Given that in the last 6 years Blake (who also works on Drupalize.Me with me) and I are the only ones who seem to be using this patch it doesn't seem like a feature that anyone needs right now. And new projects should probably be built with Drupal 9 and the 4.x version of this module anyway.