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

Miscellaneous tasks on ECE #3551

Merged
merged 9 commits into from
Nov 10, 2024
Merged

Miscellaneous tasks on ECE #3551

merged 9 commits into from
Nov 10, 2024

Conversation

Mayisha
Copy link
Contributor

@Mayisha Mayisha commented Oct 28, 2024

Handled some miscellaneous tasks in this PR.

Changes and testing instructions

  • Passed locale to ECE when initializing (c2e3a6f)
  • Replaced instances of source with payment method on the edit subscription page (c6f730b)
    • Go to the subscription edit page and click the pencil icon in the billing address section.
    • Before the payment method field used to be Stripe Sources ID. Now it is changed to Stripe Payment Method ID
Screenshot 2024-10-30 at 3 29 00 PM
  • Not calling the ECE specific paymentFailed function for order creation failures (071cd30)
    • Fixed the abortPayment function. When abortPayment is called due to order related failure (not payment failure with ECE), the paymentFailed( { reason: 'fail' } ) call throws an error.
Screenshot 2024-10-28 at 4 14 57 PM
  • Fixed issue in purchasing subscriptions when the store has no shipping options (148b75b)

    • Remove all the shipping methods from your store.
    • Create a simple subscription product.
    • As a shopper, go the the simple subscription product page.
    • Try to pay with Google Pay.
    • In develop, you should see the above error, but in this branch payment should work fine.
Screenshot 2024-10-28 at 11 37 12 AM

@Mayisha Mayisha changed the title Task/miscellaneous Miscellaneous tasks on ECE Oct 28, 2024
@Mayisha Mayisha marked this pull request as draft October 28, 2024 07:23
@Mayisha Mayisha marked this pull request as ready for review October 30, 2024 10:00
@Mayisha Mayisha requested review from a team and wjrosa and removed request for a team October 30, 2024 10:00
Comment on lines +440 to +446
public function filter_cart_needs_shipping_address( $needs_shipping_address ) {
if ( $this->express_checkout_helper->has_subscription_product() && wc_get_shipping_method_count( true, true ) === 0 ) {
return false;
}

return $needs_shipping_address;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

@Mayisha What behavior do we want from ECE when there are no defined shipping zones, but the cart is shippable? Should we let the order push through with just the billing address? Do you know if there any implications when a shippable order does not have a shipping address?

Asking also because I think I introduced a bug in #3560 for block cart and block checkout, when using ECE and there are no defined shipping zones. It should be an easy fix but I wanted to make sure it's the behavior we want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is, if we are offering Stripe card payment method on the cart/checkout page and the displayed/charged amount on the Google/Apple Pay modal is correct, then we should offer Google/Apple Pay as well.
What are your thoughts on this @annemirasol ? 👀

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this makes sense. If we are letting it happen via other payment methods, we should let it happen via express checkout 👍

Copy link
Contributor

@annemirasol annemirasol left a comment

Choose a reason for hiding this comment

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

LGTM! 🚢🚢

  • Verified express checkout buttons are localized.
Screenshot 2024-11-08 at 10 09 07 AM
  • Verified no more express payment-side error, when I forced WC checkout validation to fail.
  • Verified I can purchase subscriptions on the product/shortcode cart/shortcode checkout even without store shipping zones set up. I will fix the bug I introduced in Fix ECE crash when address has no defined shipping rates #3560 to make block cart and block checkout behave the same 😔

Comment on lines +440 to +446
public function filter_cart_needs_shipping_address( $needs_shipping_address ) {
if ( $this->express_checkout_helper->has_subscription_product() && wc_get_shipping_method_count( true, true ) === 0 ) {
return false;
}

return $needs_shipping_address;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this makes sense. If we are letting it happen via other payment methods, we should let it happen via express checkout 👍

@Mayisha Mayisha merged commit d77461f into develop Nov 10, 2024
34 of 35 checks passed
@Mayisha Mayisha deleted the task/miscellaneous branch November 10, 2024 12:55
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.

2 participants