-
Notifications
You must be signed in to change notification settings - Fork 69
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: itemized totals & pending amount on tokenized cart #8916
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +33 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
label: __( 'Tax', 'woocommerce-payments' ), | ||
pending: true, |
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.
Removed pending
to allow for the itemized amounts to be displayed - I checked the previous implementation, and they also weren't using it
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.
Out of curiosity: do we happen to know what the business value of the pending
property is? Which state does it represent?
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.
It seems to be used by browsers to display things in different ways.
Stripe says:
If you might change this amount later (for example, after you have calcluated shipping costs), set this to true
In our case, it seems that pending: true
will never be needed because there's always going to be an address selected on the Google Pay/Apple Pay modal. And if an address is selected, we'll also have the shipping options available from the Store API.
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.
The changes are clear and test well. Thanks @frosso 🚀
The itemized amount should be displayed (click the info icon next to the price to see it on GPay - the info icon wasn't visible before)
Just to make sure I haven't misunderstood anything: the info icon next to the price appears for me on develop
as well with variable products, but it doesn't have the itemized amount displayed.
Header 1 | Header 2 |
---|---|
![]() |
![]() |
@frosso, I do have the shipping listed when selected 👍
I was just wondering whether the info icon was indeed not there on ![]() |
Per our quick chat, there was no info icon on |
Fixes part of #8841
Changes proposed in this Pull Request
The itemized totals sometimes weren't displayed.
It turns out that the issue is with a combination of "pending" amount and wrong
parseInt
.I was doing things like
if ( attribute ) {...parseInt(attribute, 10)}
.The problem is that
if( '0' )
(if
on string with0
) returnstrue
. Which makes sense.So I moved the
parseInt
outside of theif(...)
check.Now the
if
check is checking for the parsed value. In case of0
, it returns `false).Testing instructions
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge