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

Add options to cart screen #135

Merged
merged 5 commits into from
Mar 8, 2021
Merged

Add options to cart screen #135

merged 5 commits into from
Mar 8, 2021

Conversation

huwr
Copy link
Contributor

@huwr huwr commented Mar 4, 2021

Let's add options to configure the CheckoutV2Options on the cart screen:

Summary of Changes

  • The logic controller is the source of truth, and has a CheckoutV2Options value.
  • Add a cell on the CartViewController which contains three swithes: one for each of the options.
  • When you tap one, it calls back to the logic controller (via event handlers) to toggle options on and off.
  • When it launches the checkout, it sends those options along.

Items of Note

This will be handy, not just for testers, but for developers. It will be even handier when we get up to adding the deferred shipping options. We can use this, or a similar technique.

Submission Checklist

This change is only inside the Example app.

@huwr huwr self-assigned this Mar 4, 2021
@huwr huwr requested review from adamjcampbell and Rypac as code owners March 4, 2021 04:46
@huwr huwr force-pushed the huwr/example-app-improvements branch from 7921e4c to f1e9328 Compare March 4, 2021 04:47
huwr added 5 commits March 9, 2021 07:54
This will adjust the logic controller’s vision as to what the options need to be.
It only adjusts the ‘buy now’ option for now. It’s sends the `optionsChanged` event back to the logic controller via the event handler
Previously, we could only edit the “BuyNow” option on the cart screen, before checkout.

Now, we have switches for all three options. The logic controller maintains the source of truth for the options. Event handlers update this source of source of truth via the logic controller’s `toggleOption(:)` function. That function takes a CheckoutV2Options key path, and toggles it.
@huwr huwr force-pushed the huwr/example-app-improvements branch from f1e9328 to ac7b025 Compare March 8, 2021 20:54
@huwr huwr merged commit afcd01d into master Mar 8, 2021
@huwr huwr deleted the huwr/example-app-improvements branch March 8, 2021 21:00
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.

1 participant