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

Set default config currency to subscription #210

Merged
merged 2 commits into from
Mar 12, 2021

Conversation

luca-landa
Copy link
Contributor

@luca-landa luca-landa commented Mar 5, 2021

This fixes #207, setting the currency value to the default Spree::Config one.

It also adds a UI test for subscription creation from admin panel.

@luca-landa luca-landa force-pushed the luca-landa/set-default-currency-to-subscription branch 6 times, most recently from 63ccb1a to 6920473 Compare March 5, 2021 18:14
@luca-landa luca-landa marked this pull request as ready for review March 5, 2021 18:25
@@ -311,6 +312,10 @@ def set_payment_method
end
end

def set_currency
self.currency = ::Spree::Config[:currency] if self[:currency].nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be simplified as self.currency ||= ::Spree::Config.currency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏 fixed.

@luca-landa luca-landa force-pushed the luca-landa/set-default-currency-to-subscription branch from 6920473 to 54f91f6 Compare March 12, 2021 08:28
@luca-landa luca-landa force-pushed the luca-landa/set-default-currency-to-subscription branch 2 times, most recently from f98c750 to 7603279 Compare March 12, 2021 14:36
Also add a spec that covers manual subscription creation from admin panel.
@luca-landa luca-landa force-pushed the luca-landa/set-default-currency-to-subscription branch from 7603279 to 03a3f2c Compare March 12, 2021 15:04
@luca-landa luca-landa force-pushed the luca-landa/set-default-currency-to-subscription branch from 75bb043 to 6e7d333 Compare March 12, 2021 15:14
@luca-landa luca-landa merged commit 32d8e59 into master Mar 12, 2021
@luca-landa luca-landa deleted the luca-landa/set-default-currency-to-subscription branch March 12, 2021 16:35
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

Successfully merging this pull request may close these issues.

Set default currency when creating subscription from admin panel
3 participants