Skip to content

Conversation

@cctina516
Copy link

@cctina516 cctina516 commented Apr 24, 2025

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 # https://jira.corp.adobe.com/browse/USF-2008

Use packages:
Cart: 1.3.0-beta2

  • PDP: 1.2.1-alpha1 - will release and use a beta version after the related PDP PR is merged.

PDP: 1.2.0-beta3

PDP supports updating cart item configuration

  • URL-Driven State:
    • Reads an itemUid parameter from the URL to identify if a specific item variant from the cart is being viewed.
    • The component now reads an optional quantity query parameter from the page URL upon loading.
      • If a valid, positive integer value is provided for the quantity parameter, it is used as the initial value for the quantity input field on the PDP.
      • If the parameter is missing, invalid, or zero/negative, the quantity defaults to 1 as before.
  • Conditional Button Text:
    • Displays Update in Cart (uses placeholder Custom.UpdateInCart.label) if the itemUid from the URL matches an item currently in the cart.
    • Otherwise, displays Add to Cart (uses placeholder PDP.Product.AddToCart.label).
  • Conditional Action on Click:
    • If the button shows "Add to Cart", clicking it calls the addProductsToCart API with the currently selected product configuration.
    • If the button shows "Update in Cart", clicking it calls the updateProductsFromCart API, passing the itemUid (from the URL) and the currently selected product configuration (quantity, SKU, options) to update that specific line item in the cart.
  • Dynamic In-Progress Text: Updates button text temporarily to "Adding to Cart..." or "Updating in Cart..." (using placeholders Custom.AddingToCart.label / Custom.UpdatingInCart.label) during the respective asynchronous cart operations.
  • Redirected users to the cart page immediately after successfully updating an item from the Product Details Page.
  • Appended the updated item's SKU as a URL parameter (updatedSku) to the cart page redirect, allowing the cart page to recognize the specific item that was just modified

Can use this configurable product for testing: https://usf-2008--aem-boilerplate-commerce--hlxsites.aem.live/products/cypress-configurable-product-latest/CYPRESS456

TODO:

  • Add placeholder labels in DA, then update related code in this PR

Test URLs:

@aem-code-sync
Copy link

aem-code-sync bot commented Apr 24, 2025

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.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync
Copy link

aem-code-sync bot commented Apr 24, 2025

Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /cart PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /cart PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
📱 /products/cypress-configurable-product-latest/CYPRESS456 PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /products/cypress-configurable-product-latest/CYPRESS456 PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@cctina516 cctina516 marked this pull request as ready for review April 25, 2025 21:23
jcalcaben
jcalcaben previously approved these changes May 14, 2025
@jcalcaben jcalcaben merged commit 303bfa9 into integration May 20, 2025
4 checks passed
@jcalcaben jcalcaben deleted the USF-2008 branch May 20, 2025 16:01
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.

4 participants