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

Customize the checkout flow is emptying the cart #3284

Closed
ighor opened this issue Jun 28, 2013 · 3 comments
Closed

Customize the checkout flow is emptying the cart #3284

ighor opened this issue Jun 28, 2013 · 3 comments
Milestone

Comments

@ighor
Copy link

ighor commented Jun 28, 2013

I want to remove the addreess and delivery steps but if I do using the checkout_flow helper like this:

Spree::Order.class_eval do
  checkout_flow do
    go_to_state :payment, if: ->(order) {
      order.update_totals
      order.payment_required?
    }
    go_to_state :confirm, if: ->(order) { order.confirmation_required? }
    go_to_state :complete, if: ->(order) {
      (order.payment_required? && order.has_unprocessed_payments?) || !order.payment_required?
    }
  end
end

Or like this:

Spree::Order.class_eval do
  remove_checkout_step :address
  remove_checkout_step :delivery
end

When I checkout a non empty cart, inside the CheckoutController#edit, the line_item is being deleted and I can't figure out why. Then it redirects to the cart instead of payment step and shows a empty cart.

Started GET "/checkout/payment" for 127.0.0.1 at 2013-06-28 14:58:29 -0300
Processing by Spree::CheckoutController#edit as HTML
  Parameters: {"state"=>"payment"}
...
Redirected to http://localhost:3000/cart
Filter chain halted as :ensure_checkout_allowed rendered or redirected
Completed 302 Found in 162ms (ActiveRecord: 101.7ms)
@ighor
Copy link
Author

ighor commented Jun 28, 2013

Just saw that this is related to issues #2966 and #3142

The method before_payment in CheckoutController is the responsible to delete the line_items.

@huoxito
Copy link
Member

huoxito commented Jun 28, 2013

another reminder something needs to be done about #3193

@radar
Copy link
Contributor

radar commented Jul 30, 2013

Given that #3193 is fixed now, I'm going to assume that this issue is fixed too.

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

No branches or pull requests

3 participants