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

Marketplace: Sprout Checkout #994

Merged
merged 5 commits into from
Dec 18, 2022
Merged

Marketplace: Sprout Checkout #994

merged 5 commits into from
Dec 18, 2022

Conversation

KellyAH
Copy link
Contributor

@KellyAH KellyAH commented Dec 15, 2022

Continuing building out checkout flow in #831

TODO

  • add request specs
  • add checkout form to checkout page
    • - save inputted shopper address
    • 🌱 - display carts items and quantities & total
  • save checkout when checkout form submits

KellyAH and others added 2 commits December 14, 2022 18:01
Co-authored-by: Zee Spencer <[email protected]>
Co-authored-by: Ana <[email protected]>
Co-authored-by: Zee Spencer <[email protected]>
Co-authored-by: Ana <[email protected]>
@KellyAH KellyAH requested review from zspencer and anaulin December 16, 2022 05:39
@KellyAH KellyAH self-assigned this Dec 16, 2022
@KellyAH
Copy link
Contributor Author

KellyAH commented Dec 16, 2022

Oops I forgot to assign ya'll as reviewers after opening this PR on Wednesday. I think we wanted to get it merged ASAP right? Or are we waiting to continue it on Sunday?

@zspencer
Copy link
Member

Well, we could merge it as is; since it seems like the tests are passing, but I would prefer to wait to merge until we showed the Cart, it's Products and Total on the CheckoutsController#new page; rather than a blank page.

I don't think we need to get the actual "Create a Checkout" bit working pre-merge, but some tidying of the flow may be nice on Sunday!

@zspencer zspencer changed the title Marketplace: create new Checkout page Marketplace: Sprout Checkout Dec 18, 2022
Co-authored-by: Zee Spencer <[email protected]>
Co-authored-by: Naomi Quinones <[email protected]>
Co-authored-by: CJ Joulain <[email protected]>
Copy link
Member

@zspencer zspencer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is good enough to merge! WOOO!!!!

@@ -24,6 +24,7 @@ def create
turbo_stream.replace("cart-product-#{cart_product.product_id}", cart_product),
turbo_stream.replace("cart-footer-#{cart.id}",
partial: "marketplace/carts/footer", locals: {cart: cart}),
turbo_stream.replace("cart-total-#{cart.id}", partial: "marketplace/carts/total", locals: {cart: cart})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice we make this particular change 3 different times in this controller; what if we gathered these three replace calls into a method so they aren't duplicated everywhere? What arguments would the method need to take to work appropriately across it's different calls?

<tfoot id="cart-footer-<%= cart.id%>" class="bg-gray-50">
<tr>
<td></td>
<th> <%= link_to("checkout", new_space_room_marketplace_checkout_path(space, room, marketplace), html_options = {}) %> </th>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may be able to use [:new, space, room, marketplace, :checkout] in place of new_space_room_marketplace_checkout_path(space, room, marketplace)

@zspencer zspencer merged commit 1b9ebf7 into main Dec 18, 2022
@zspencer zspencer deleted the create-crud-for-checkout branch December 18, 2022 20:17
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.

2 participants