Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
171 stars 69 forks source link

Update Product Add-Ons integration #8911

Closed rbgly closed 1 month ago

rbgly commented 3 months ago

Background Info / Debug

SomewhereWarm adopted Product Add-ons and brought several improvements to the extension. One of them was to Change the way prices are presented in the cart - see pdqkbG-2E8-p2

SomewhereWarm was not aware that Woo Payments integrated with Product Add-ons and didn't inform Woo Payments for these changes.

For this bug to be fixed, the Woo Payments integration includes/multi-currency/Compatibility/WooCommerceProductAddOns.php has to be updated.

See p1717513051447799-slack-C7U3Y3VMY

The issue is not only related to addons with 0 prices, as Product Add-ons has changed how all prices are presented in cart.

This section was added by @PanosSynetos

Describe the bug

Product Add-Ons with no price are showing as 0.00 in the cart when WooPayments is enabled.

To Reproduce

  1. With only WooCommerce, WooPayments and Product Add-Ons active on the site, create a new product with multiple choices. One should have a flat rate of 0.00.
add-on-configuration
  1. On the front-end of the site, select the "free" add-on.
product-page
  1. Add this to the cart.
  2. Next, repeat the steps above but with WooPayments deactivated.

Actual behavior

When WooPayments is active, the product is added to the cart with the add-on details below the main product information. The price is displayed as 0.00 instead of not appearing at all. Repeating the process with WooPayments deactivated causes the price to be hidden as expected.

cart-zero

Expected behavior

The price should not show 0.00 at the cart for "free" product add-ons.

cart-no-price

Desktop (please complete the following information):

Additional context

PanosSynetos commented 3 months ago

Hey team - @nagpai

We (SomewhereWarm) will evaluate whether we can absorb it in an upcoming sprint and let you know later in the day.

Tagging @jimjasson @xristos3490 @peterfabian @dakota for awareness

haszari commented 1 month ago

For this bug to be fixed, the Woo Payments integration includes/multi-currency/Compatibility/WooCommerceProductAddOns.php has to be updated.

Based on the affected code, and discussion in slack, I've switched the focus label to multicurrency. (FYI integration is specifically about external APIs as a product, not compatibility issues within Woo ecosystem.)