Commit f280b3cabd855ed3daf87e5b2c39fe44b5fa9511
1 parent
8cb63032
Exists in
master
and in
29 other branches
shopping_cart: fix regression on orders repetition
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb
... | ... | @@ -121,7 +121,8 @@ class ShoppingCartPluginController < OrdersPluginController |
121 | 121 | @profile = cart_profile |
122 | 122 | @order = profile.sales.build consumer: user |
123 | 123 | |
124 | - @order.supplier_delivery = profile.delivery_methods.where(id: session[:cart][:last_delivery_option_id]).first | |
124 | + last_delivery_option_id = session[:cart][:last_delivery_option_id] if session[:cart] | |
125 | + @order.supplier_delivery = profile.delivery_methods.where(id: last_delivery_option_id).first if last_delivery_option_id | |
125 | 126 | if repeat_order_id = self.cart[:repeat_order_id] |
126 | 127 | repeat_order = cart_profile.orders.where(id: repeat_order_id).first |
127 | 128 | @order.consumer_delivery_data = repeat_order.consumer_delivery_data if repeat_order | ... | ... |