-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 Cart.getShippingTotalByShop and use it in Cart.getSubTotal and in… #3214
Conversation
… 'cart/submitPayment' to pass correct shipping
…eaction into prosf-ShopShippingTotalFix
…into prosf-ShopShippingTotalFix
@zenweasel I think you might be better suited to review this PR as it's dealing directly with your cart/order transforms |
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.
I tested this and it fixes the problem. Just have a couple style-type thing.
billingObject[billingItem.shopId] = billingItem.invoice.shipping; | ||
} | ||
return billingObject; | ||
// The previous implementation can only be used if an invoice object already exists( while Invoice |
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.
If this comment is why you are making the change, it probably should be in the PR comments and not in the code since "the previous implementation" will no longer be visible. I am also not clear what this comment means? Could you elaborate a little more?
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.
Indeed, the right place for this comment is in the pr and not in the code.
Nevertheless what I mean here is that previously, getShippingTotalByShop couldn't be called before the buyer charging (e.g couldn't be used in order-preview of checkout) as it required access to the billing.$.invoice which gets created and is accessible only after the buyer-charging.
// for (const billingItem of this.billing) { | ||
// billingObject[billingItem.shopId] = billingItem.invoice.shipping; | ||
// } | ||
// return billingObject; |
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.
Shouldn't leave commented code. Let's remove?
…into prosf-ShopShippingTotalFix
@zenweasel Style changes done |
…lFix fix Cart.getShippingTotalByShop and use it in Cart.getSubTotal and in…
fix issue #3190