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

feat(checkout): CHECKOUT-7176 Displaying the Hidden Cart Source Input Field on PDP page #2392

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

bc-mackxu
Copy link
Contributor

@bc-mackxu bc-mackxu commented Sep 4, 2023

What?

Displaying the Hidden Cart Source Input Field on PDP page

Requirements

  • CHANGELOG.md entry added (required for code changes only)

Tickets / Documentation CHECKOUT-7176

The "Add to Cart" button on the PDP page initiates a call to the remote/v1/add endpoint for adding items to the cart. To facilitate the creation of a cart with the order source set to 'buyButton,' it will display the hidden cart source input field, enabling the posting of the cart source value to the endpoint.

Here are all the scenarios related to determining whether the order source needs to be set as "buy_button." This PR is specifically focused on addressing scenario 5.

  Scenario Redirect To Is set order source buy button?
1 Not cart in the session Checkout Yes
2 A cart in the session Checkout No
3 Not cart in the session Cart No (to change Yes in another PR)
4 A cart in the session Cart No
5 Not cart in the session PDP page → click add product No (this PR will display cart_source and able to send to remote/add endpoint)
6 A cart in the session PDP page → click add product No
7 Secondary cart PDP page → click wallet button No

Screenshots

Add item to cart on PDP when there is no cart in the session - order source will set as buy button
Screen.Recording.2023-09-05.at.5.30.08.pm.mov
Add item to cart on PDP when there is a cart in the session - order source will not set as buy button
Screen.Recording.2023-09-05.at.5.37.10.pm.mov

@bigcommerce/team-checkout

@bc-mackxu bc-mackxu marked this pull request as ready for review September 4, 2023 23:44
@BC-krasnoshapka
Copy link
Contributor

@bc-mackxu have you considered if cart_order_source attribute should be added to dev docs?

@bc-mackxu
Copy link
Contributor Author

@BC-krasnoshapka Thank you for reviewing. Yes, I think we should also add it to dev docs

@bc-mackxu
Copy link
Contributor Author

Thank you for review and approval @bc-vlad-dlogush and @BC-krasnoshapka. Could you help to merge it when you have time please? I don't have permission to merge on this repo. Thank you again.

@BC-krasnoshapka BC-krasnoshapka merged commit 93c65a3 into bigcommerce:master Sep 6, 2023
1 check passed
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