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

Show PRB on cart and product page when there are required custom checkout fields #3036

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

Mayisha
Copy link
Contributor

@Mayisha Mayisha commented Apr 2, 2024

Fixes #2992

In #2886 as part of fixing an issue related to required checkout fields breaking Google Pay or Apple Pay, we had hidden the PRBs from cart and product page when there are custom required checkout fields. This PR reverts the changes made for cart and product pages and will continue to show the PRBs on the pages.

Changes proposed in this Pull Request:

  • Removed the check for required custom checkout fields and not hiding the Google/Apple Pay on cart and product page any more.

Testing instructions

  • Go to develop branch.
  • Go to Appearance -> Customize -> WooCommerce -> Checkout and make the Company field required.
  • Go to WooCommerce -> Settings -> Payments -> Stripe. Customize Google/Apple Pay button locations and select Checkout, Cart, and Product.
  • As a shopper go to a single product page and find that there are no Google/Apple Pay button on the page.
  • Add the product to the cart, go to the cart page and find that there are no Google/Apple Pay button on the page.
  • Go to the checkout page and the Google/Apple pay button should be present.
  • Now check out this branch.
  • Check the single product page, cart page and checkout page again. Google/Apple pay button should be present on all three pages. Confirm that the button exists both on shortcode and block cart and checkout pages.
  • Try to purchase with Google Pay from cart or product page. You should see an error notice on the page.

error notice prb

  • Go to the checkout page, add a value to the Company field. Try to purchase with Google Pay and it should be successful without any errors.
  • Check the order data in your wp-admin and make sure the company name is there.

@Mayisha Mayisha requested review from a team and wjrosa and removed request for a team April 2, 2024 16:33
Copy link
Contributor

@wjrosa wjrosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected!

Possible non-related behavior: the "company" field only shows up for me on the shortcode version of the checkout page.

In develop, the button is displayed only on the checkout page:
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/5fdea788-a26a-41a7-87a1-42f29f57f030

On this branch, it shows up everywhere again:
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/e2b96914-4f4b-49aa-844c-7d6573974cd3
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/f6cef2dc-e46c-424b-ac3e-07c9128e0016
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/8ef2e678-f131-4b47-813d-b6694577f216
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/e1dd9cee-05e1-4bf9-b284-b04c1342add3
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/4a5b6a40-d4aa-4047-b6f5-6a8bf5104b14
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/acebac5d-f8f6-4211-98ec-9f952fddbe19
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/5dc72e76-8e6c-476e-8ba3-3f7d82147d79
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/28985785-1d0e-4da4-9557-77b5537fc853
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/827dcc2b-f10a-4ae2-b6b2-4d2c0762f119

I got an error trying to purchase without the company name as expected:
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/abb855cc-2ee5-468c-a026-aa914a08d496

It worked after inputting it:
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/b89a107e-fb0a-4dc7-85bf-0439a98e719a

Company name is displayed correctly:
https://github.com/woocommerce/woocommerce-gateway-stripe/assets/10187816/0102be70-dccb-4648-bf96-27010f463fa7

@Mayisha Mayisha merged commit 68ad0dd into develop Apr 4, 2024
33 checks passed
@Mayisha Mayisha deleted the fix/2992-prb-on-cart-and-product branch April 4, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request to Reimplement Apple/Google Pay on Variable Products
2 participants