-
Notifications
You must be signed in to change notification settings - Fork 17
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
Added code to make the reorder functionality work correctly #6
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All done. Add to master
@@ -1,3 +1,3 @@ | |||
Spree::Core::Engine.routes.draw do | |||
match '/orders/:id/reorder' => 'orders#reorder', :via => :get, :as => :reorder_order | |||
match '/orders/:id/reorder' => 'orders#reorder', via: :get, as: :reorder_order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
format.html { redirect_to cart_path } | ||
end | ||
else | ||
flash[:error] = populator.errors.full_messages.join(' '.freeze) | ||
flash[:error] = @current_order.errors.full_messages.join(' '.freeze) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
order = Spree::Order.where( number: params[:id] ).first | ||
|
||
if order.line_items.select {|li| populator.populate(li.variant.id, li.quantity) }.any? | ||
respond_with(@order) do |format| | ||
if order.line_items.select{ |li| @current_order.contents.add(li.variant, li.quantity) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space missing to the left of {.
Line is too long. [91/80]
No description provided.