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.

Issue fork recurly-2025995

Command icon 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

JayShoe’s picture

PS - The "signup" page will also need editing to include the option to adjust the quanity desired.

quicksketch’s picture

Could you make a rough mockup of what you're wanting here? I'm not sure what a "Change quantity" link would link to.

JayShoe’s picture

StatusFileSize
new52.1 KB

Hello 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

quicksketch’s picture

Issue summary: View changes

This 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.

aburke626’s picture

Status: Active » Needs work
aburke626’s picture

Priority: Major » Normal
nickonom’s picture

markdorison’s picture

Version: 7.x-1.0 » 8.x-1.x-dev

Any 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.

nickonom’s picture

Ah, 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?

markdorison’s picture

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

nickonom’s picture

Mark, 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.

blakehall’s picture

Version: 8.x-1.x-dev » 7.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new11.9 KB

We'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)

colan’s picture

blakehall’s picture

Status: Needs review » Needs work

I should add that the patch in #12 isn't quite finished, but I wanted to at least move this forward a little bit.

blakehall’s picture

Status: Needs work » Needs review
StatusFileSize
new13.99 KB

Okay, 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.

blakehall’s picture

StatusFileSize
new14.39 KB

And here's a patch for D8...

colan’s picture

Version: 7.x-3.x-dev » 8.x-1.x-dev
Issue tags: -needs forward port to Drupal 8 +Needs backport to D7

Let's get the D8 one in first.

eojthebrave’s picture

StatusFileSize
new14.53 KB
new695 bytes

This 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=3 and 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.js recurly.Pricing() module back into the D8 version.

eojthebrave’s picture

Version: 8.x-1.x-dev » 4.x-dev

eojthebrave’s picture

This 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.

blakehall’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me, and I really like this approach.

  • eojthebrave committed 2459efbb on 4.x
    Issue #2025995 by eojthebrave, blakehall, JayShoe: Change Quantity...
eojthebrave’s picture

Status: Reviewed & tested by the community » Fixed

Thanks 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.

eojthebrave’s picture

There'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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.