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

POC: Receive button properties from the Checkout Block #2354

Conversation

Dinamiko
Copy link
Contributor

This is some exploratory work to explore how we can synchronise the express payment button styles better to create more cohesiveness in the Express Checkout block. This PR is a part of POC: Pass properties to Express Checkout buttons. It updates the express payment method to receive buttonAttributes property from the checkout block, and override the height property if available.

Testing instructions

  • Run woocommerce locally and check out the try/poc-express-checkout-button-styles branch
  • Make sure the environment is right for one of the express checkout buttons to be visible (either Apple or Google Pay)
  • Add some items to the cart and visit the cart page (with the cart block)
  • Ensure the express payment method is visible there
  • Click "Proceed to checkout"
  • Ensure the express payment method is visible there too
  • In a new tab, open the checkout page in the editor.
  • Click on the express checkout area and change the button size to "Small"
  • Refresh the checkout page in the front-end
  • You should notice the button change size to a height of 40px

Please note that is not possible to set "Large" size as PayPal only allows values between 25px and 55px:

Error: Expected style.height to be between 25px and 55px - got 56px

@Dinamiko Dinamiko marked this pull request as draft June 18, 2024 10:47
@Dinamiko
Copy link
Contributor Author

Dinamiko commented Jun 18, 2024

Hi @alexflorisca, just to let you know that we have created this PR for working on #47899 POC integration, for now it only checks if buttonAttributes exist and if so it gets the button height value from there.

I noticed that is not currently possible to set "Large" size because there is a button size limitation on PayPal.

cc. @InpsydeNiklas

danieldudzic and others added 21 commits June 19, 2024 14:19
…hen-adding-to-cart-1-product-if-pcp-is-activated

2.8.1-alpha1 - Server 500 error when adding to cart >1 product if PCP is activated (3300)
…heckout-fields-layout-in-ryan-flow

AXO: Fix the layout with the Twenty Twenty-Four theme (3249)
…r-guest-user-on-short-checkout-greyed-out-and-payment-not-possible-when-fastlane-enabled

AXO: Disable Fastlane for subscription products (3295)
Make the outline of the payment button visible
“White with outline” correctly displays the outline
…-order-error-in-package-tracking-metabox-breaking-wc-order

Don't render tracking metaBox if can't retrieve PayPal order (3289)
…eak-orders-screen-when-there-is-an-exception-for-package-tracking
danieldudzic and others added 28 commits July 10, 2024 12:47
…ackage-build-leftovers

Run eslint autofix and remove introduced package build leftovers
…dually-option-in-paypal-vaulting

Sold individually automatically disabled after changing from PayPal subscription to PayPal vaulting and adding product more then one time to cart (3362)
Resolve merge conflict due to new JS code format
…with-filter-for-the-bn-code

Create a constant for the BN code (3021)
…astlane-enabled-and-we-add-product-to-cart-and-navigate-to-checkout

AXO: Replace the init hook with wp_loaded to avoid getting 'called too early' errors (3359)
…art-button-preview-on-standard-payments-tab

Wrong string in smart button preview on Standard Payments tab (3360)
…rd-processing-country-eligibility

Extend Advanced Card Processing country eligibility (3348)
…uring-callback-not-updated-correctly

Shipping methods during callback not updated correctly (3305)
…mart Button Stylings may be controlled by the Checkout block configuration
…mmerce-checkout-block' of github.com:woocommerce/woocommerce-paypal-payments into PCP-3202-retrieve-button-styling-properties-from-woo-commerce-checkout-block
@danieldudzic
Copy link
Collaborator

@Dinamiko I messed up this branch it seems 😓 so created a new one here:

#2448

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants