saucal / woocommerce-gateway-amazon-pay

Amazon Pay Gateway
0 stars 1 forks source link

Fix/issue 270 estimated order amount multicurrency #213

Open alexiglesias31 opened 12 months ago

alexiglesias31 commented 12 months ago

All Submissions:

Changes proposed in this Pull Request:

Disable the estimated order amount if the currency is not the default currency for the region.

How to test the changes in this Pull Request:

  1. Install a built version of this branch and setup the amazon plugin to Europe region.
  2. Install the plugin FOX - Currency Switcher Professional for WooCommerce.
  3. Estimated order amount should be set when the currency is EUR but should not be set when the currency is USD.
  4. The checkout can be completed without issues.

Other information:

Changelog entry

Fix - Issue with estimated order amount and multi-currency.

alexiglesias31 commented 11 months ago

I didn't know about that, yes, I tested with an empty string and works as well 👍

P.D: 🤔, giving a second thought to this, it doesn't feel correct to me that the estimated order amount is empty when the currency is different. I would find more intuitive to pass the converted amount rather than an empty string.

alexiglesias31 commented 11 months ago

Providing a new approach, instead of set the total as empty, moving back to return an empty string on the estimated_order_amount, but now adding some checks in the JS code so the parameter is not set when is empty.

alexiglesias31 commented 11 months ago

@dpanta94 asking CR again, since the EOA was still being calculated on blocks.

alexiglesias31 commented 11 months ago

I think so 😄, EOA is not used on the JS related to classics