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

Override in checkout_flow results session clearing #2966

Closed
abdul-shajin opened this issue May 2, 2013 · 8 comments
Closed

Override in checkout_flow results session clearing #2966

abdul-shajin opened this issue May 2, 2013 · 8 comments

Comments

@abdul-shajin
Copy link
Contributor

I've overrided checkout_flow method and tried the checkout process

checkout_flow do
go_to_state :address
#go_to_state :delivery commented
go_to_state :payment, :if => lambda { |order| 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?
}
remove_transition from: :delivery, to: :confirm
end

It successfully removes the shipment(delivery process) and when clicks 'Continue' button, redirects to 'No items page' (Empty Cart)

Any kind of bug??

@huoxito
Copy link
Member

huoxito commented May 4, 2013

I can confirm this. The line items are being removed on the CheckoutController#before_payment filter. I'm not sure why.

def before_payment
  packages = @order.shipments.map { |s| s.to_package }
  @differentiator = Spree::Stock::Differentiator.new(@order, packages)
  @differentiator.missing.each do |variant, quantity|
    @order.contents.remove(variant, quantity)
  end
end

Thanks for the report @CodeSavvy

@GeekOnCoffee
Copy link
Contributor

@CodeSavvy is this still an issue after the Pull Request?

@abdul-shajin
Copy link
Contributor Author

@GeekOnCoffee Infact, I didn't check.since I don't need shipping, I override before_payment method with a blank method (def before_payment;end)

@huoxito
Copy link
Member

huoxito commented May 13, 2013

@GeekOnCoffee I think it is. which PR were you referring to?

@GeekOnCoffee
Copy link
Contributor

@huoxito #2959 is referenced above

@huoxito
Copy link
Member

huoxito commented May 13, 2013

Ah ok, but that one is for a different issue. Guess this one remains then

@radar
Copy link
Contributor

radar commented Jul 30, 2013

@huoxito Does this fix #3142 and #3284?

@huoxito
Copy link
Member

huoxito commented Jul 30, 2013

for sure @radar yes

@radar radar closed this as completed Jul 31, 2013
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

4 participants