-
Notifications
You must be signed in to change notification settings - Fork 50
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
Uniform Smart Button Display for PayPal, Google Pay, and Apple Pay (2177) #1900
Uniform Smart Button Display for PayPal, Google Pay, and Apple Pay (2177) #1900
Conversation
add_action( | ||
'wp_enqueue_scripts', | ||
static function () use ( $c ) { | ||
if ( ! has_block( 'woocommerce/checkout' ) && ! has_block( 'woocommerce/cart' ) ) { |
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.
This may not load in editor (if block not added yet).
If we want to fix that, here is how I check it in the messaging branch 4e34332
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.
} | ||
|
||
jQuery(wrapper).append(appleContainer); | ||
jQuery(wrapper).append(appleContainer); // ToDo: this selector doesnt seem valid. |
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.
Yes, it seems to be doing nothing. <apple-pay-button>
is already added because we set innerHTML
above.
This PR also resolves:
Do not render empty Apple Pay button div in frontend when buyer is not eligible (2411)
PR Description
This PR refactors Google Pay and Apple Pay so that they follow the PayPal button layout, namely button
heights
(responsive and fixed) andmargins
between buttons.PayPal takes advantage of it's buttons being rendered inside an
iframe
to add responsive behaviour via media queries.To emulate this behaviour and add responsiveness to Google Pay and Apple Pay this PR adds
ApmButtons
helper class.The helper calculates button margins and adds
CSS
classes to the button containers to allow for responsiveness.This PR also ensures that Apple Pay is only rendered on eligible devices.
It also adds
apm-button.scss
mixin to share CSS rules between modules (buttons
,blocks
,admin
) and between APM buttons (googlepay
,applepay
).Issue Description
As a website owner,
I want the PayPal, Google Pay, and Apple Pay smart buttons to have a consistent appearance,
So that my website provides a cohesive and visually appealing payment experience to users.
Acceptance Criteria:
1. PayPal Smart Button:
2. Google Pay Smart Button:
3. Apple Pay Smart Button: