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
Unable to switch or cancel a subscription on the front-end #1650
Comments
I have just tried to replicate this locally and I was able to unsubscribe as expected. The error you are seeing is triggered when trying to save the element. This could suggest there is an issue on saving the element. Is there any custom logic or fields in your project that could be causing an issue? Thanks. |
Hi @nfourtythree, thanks for taking a look. Guess it must be my end but struggling to find it. There was some custom logic to send a tax code to Stripe, and a couple of custom Subscription fields to save country and state, although I’ve disabled all plugins and removed those fields. Still not able to unsubscribe on front-end but control panel works. |
The error is triggered in here: commerce/src/controllers/SubscriptionsController.php Lines 332 to 362 in ef85932
Since you mention it working on the backed, are you possibly trying to switch the subscription of the non-current user on the front end? See lines:
|
Thanks @lukeholder I’m logged in as the user I’m trying to unsubscribe/switch. Doing a dump and die for the subscription I’m trying to manage looks right. I’m also testing with the example templates, and have disabled plugins. If I unsubscribe/switch in the CP, those changes are reflected in the front-end template I’m looking at. |
Found it. The user has to have permissions set to manage subscriptions. (CP > Users > User > Permissions > Craft Commerce > Manage Subscriptions). Can you confirm? Is that expected behaviour? If not, I can’t yet see how it’s part of my setup with disabled plugins and using the example templates. |
Thanks, this is fixed in 3.2.6 |
Description
Unable to switch a Stripe subscription plan or cancel a plan on the front-end. This could be a problem with https://github.com/craftcms/commerce-stripe but starting here as it seems to be a problem since the recent Commerce 3.2 update.
To Reproduce
Unable to modify subscription at this time.
Unable to cancel subscription at this time.
I only get the flash errors on the front-end. I can switch and cancel a membership from the control panel.
Additional info
The text was updated successfully, but these errors were encountered: