hlxsites / aem-boilerplate-commerce

Use this repository template for new AEM+Commerce projects.
https://main--aem-boilerplate-commerce--hlxsites.aem.live
Apache License 2.0
27 stars 21 forks source link

USF 1629 - Add coupon container in cart #162

Closed cctina516 closed 2 weeks ago

cctina516 commented 4 weeks ago

Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):

Fix Ticket: https://jira.corp.adobe.com/browse/USF-1629

Test URLs:

aem-code-sync[bot] commented 4 weeks ago

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed. In case there are problems, just click a checkbox below to rerun the respective action.

Commits * [d7a7975](https://github.com/hlxsites/aem-boilerplate-commerce/commit/d7a7975b64fc6dcbe170c57c5b868e08b3feb69b) :arrows_counterclockwise: (latest) * [51edb9d](https://github.com/hlxsites/aem-boilerplate-commerce/commit/51edb9d3b12c537191c79673759848e75b7ac064) :white_check_mark: * [d0070b8](https://github.com/hlxsites/aem-boilerplate-commerce/commit/d0070b8c5261cff94ee73d0fc809d20baee0a199) :white_check_mark: * [d08b90f](https://github.com/hlxsites/aem-boilerplate-commerce/commit/d08b90f2994c6bf4d61b06f4bc717cc13eaf0d21) :white_check_mark: * [632b533](https://github.com/hlxsites/aem-boilerplate-commerce/commit/632b533b9291c9b2c2decf09bc26c1e762620839) :white_check_mark: * [7bb2975](https://github.com/hlxsites/aem-boilerplate-commerce/commit/7bb2975007a72e1bf0d007a76840febc3371ce2f) :white_check_mark: * [f475994](https://github.com/hlxsites/aem-boilerplate-commerce/commit/f4759941cb92db9477abf03b74def496875b5199) :white_check_mark: * [920f891](https://github.com/hlxsites/aem-boilerplate-commerce/commit/920f89167c1dc6ac736fefc810a9789e990440f1) :white_check_mark: * [43fdbe2](https://github.com/hlxsites/aem-boilerplate-commerce/commit/43fdbe2dac3102dd90d89b84239f34ab431b25ba) :white_check_mark: * [e240cf3](https://github.com/hlxsites/aem-boilerplate-commerce/commit/e240cf3062106b846188d70407832f76cb4929ec) :white_check_mark:
aem-code-sync[bot] commented 4 weeks ago
Page Scores Audits Google
:iphone: / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
:desktop_computer: / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
ericeoeur commented 2 weeks ago

@cctina516 please review the checkout coupons experience: as the removal of coupons are not being applied to the order summary totals.

ericeoeur commented 2 weeks ago

@cctina516 some additional findings after merging with the latest from develop for demo:

  1. When entering the discount codes, the "estimated tax and shipping" slot are being activated when the Coupon's "Apply" Button is clicked.

image In the above image, a coupon code is entered but not "applied" yet. The Estimated Shipping still states TBD. The zipcode field is empty.

image Upon clicking "apply" within the coupon slot, the estimated shipping now says to "US" with no zip code applied. This is an unintended effect from the coupon code container causing the estimated shipping/taxes slot to be activated.

  1. Coupon Invalidation: When a coupon that invalidates another coupon is added, it is expected that the valid coupon would replace the invalid coupon due to a higher priority level set. While this does occur, the UI does not reflect the change and only shows up after refresh of the page. The example of WATCHMESAVE and dropin321 showcases this:

image WATCHMESAVE has been entered giving a 90% discount to the watch.

image dropin321 is applied to the cart, which invalidates WATCHMESAVE. The WATCHMESAVE coupon is not removed.

image Upon a reset of the cart page, we can see that DROPIN321 was applied and WATCHMESAVE was removed. Additionally, when moving from cart to checkout, checkout reflects DROPIN321 and not WATCHMESAVE:

image

If this is out of scope with the Coupon Slot, then we would need to make a seperate ticket/bug.

cctina516 commented 2 weeks ago

@ericeoeur

  1. Checkout coupon experience. As we discussed with @jcalcaben , it looks like an issue with the EstimateShopping container that checkout dropin uses, which doesn't emit an estimate/shipping event when the coupon is applied to the cart. Bug ticket created: https://jira.corp.adobe.com/browse/USF-1720
  2. The "estimated tax and shipping" slot. It doesn't seem to do with the coupon container, but with Estimated shipping and tax being updated with any re-render.

Initial state with no coupon applied: Screen Shot 2024-11-13 at 10 47 02 AM

Increase the quantity to 2, still no coupon applied: Screen Shot 2024-11-13 at 10 47 09 AM

We can see the Estimated shipping and tax being activated regardless of any coupon actions. Therefore the issue is not with the coupon container. Bug ticket created: https://jira.corp.adobe.com/browse/USF-1722

  1. This is due to the current behavior of GraphQL. Ticket for GraphQL created: https://jira.corp.adobe.com/browse/LYNX-638
ericeoeur commented 2 weeks ago

Thanks @cctina516 QA approved. Will merge.