Skip to content

Commit

Permalink
Marketplace: Begin moving Checkout to it's own page
Browse files Browse the repository at this point in the history
- #1672
- #1325
- #1763

This starts to split out the Checkout flow to it's own page; so we can
do things like:

- Collect the Delivery Address and Phone Number
- Let the Shopper pick a Delivery Time
- Confirm prices
- ???
  • Loading branch information
zspencer committed Aug 17, 2023
1 parent 62c23e7 commit fabddef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/components/button_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
data: data,
class: classes do %>
<%- if @icon.present? %>
<%= render SvgComponent.new(icon: @icon, classes: "w-6 h-6 inline-block") %>
<%= render SvgComponent.new(icon: @icon, classes: "w-6 h-6 inline-block", scheme: :primary) %>
<% end -%>
<%= @label %>
<% end %>
Expand Down
7 changes: 2 additions & 5 deletions app/furniture/marketplace/carts/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
<tr>
<td class="px-3 py-3.5 text-right" colspan="8">
<%= render "marketplace/carts/total", cart: cart %>
<%- if cart.ready_for_checkout? %>
<%= button_to("Checkout", cart.location(child: :checkout), data: { turbo: false }) %>
<%- end %>
</td>
</tr>
<tr>
<td class="px-3 pb-3.5 text-right" colspan="8">
<%= render cart.delivery %>
<td class="text-right py-3.5" colspan="8">
<%= render ButtonComponent.new(label: "Checkout", href: cart.location(child: :checkout), scheme: :primary) %>
</td>
</tr>
</tfoot>
3 changes: 3 additions & 0 deletions app/furniture/marketplace/checkouts/show.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<h1>FUCK THIS</h1>
</div>
5 changes: 5 additions & 0 deletions app/furniture/marketplace/checkouts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ def create
end
end

def show
authorize(checkout)

end

helper_method def checkout
@checkout ||= Checkout.new(cart: cart)
end
Expand Down

0 comments on commit fabddef

Please sign in to comment.