-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix/intl renewal #17
Fix/intl renewal #17
Conversation
…he shipping rates are being calculated for US addresses by default, if the currency is not set in the order. Setting the currency for new orders generated ensures the right shipping methods are pulled to match the customer's address
…e creation of the order
…n's last completed order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @mickeyren, I noted maybe one small improvement if you want to give that a go.
app/models/spree/subscription.rb
Outdated
) | ||
# use the subscription's email if present. | ||
# we are doing it here because the order's callback associate_user! will | ||
# override the order's email even if we set it during creation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about instead of a comment you extract this part into a well named method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! i agree with hugo's comment, and in my PR for adding items to subscriptions i do something similar if you want to take a look #18
@hugobast @sherryson updated - moved it into a callback instead, but i still left a comment. :) |
@hugobast @sherryson
this is ready for CR. the problem earlier is renewal isn't working for Canadian subscriptions because the order's currency is being set to USD.
The changes here will set the subsequent orders to follow the last completed order's currency and store id.
I also surfaced the currency in the admin subscription listing page, similar to our admin orders listing.