From f280b3cabd855ed3daf87e5b2c39fe44b5fa9511 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Thu, 1 Oct 2015 13:05:05 -0300 Subject: [PATCH] shopping_cart: fix regression on orders repetition --- plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb b/plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb index a84803b..ffb2eeb 100644 --- a/plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb +++ b/plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb @@ -121,7 +121,8 @@ class ShoppingCartPluginController < OrdersPluginController @profile = cart_profile @order = profile.sales.build consumer: user - @order.supplier_delivery = profile.delivery_methods.where(id: session[:cart][:last_delivery_option_id]).first + last_delivery_option_id = session[:cart][:last_delivery_option_id] if session[:cart] + @order.supplier_delivery = profile.delivery_methods.where(id: last_delivery_option_id).first if last_delivery_option_id if repeat_order_id = self.cart[:repeat_order_id] repeat_order = cart_profile.orders.where(id: repeat_order_id).first @order.consumer_delivery_data = repeat_order.consumer_delivery_data if repeat_order -- libgit2 0.21.2