From 4875681fcea9849ab0176f5c2e62bf4c286b1f70 Mon Sep 17 00:00:00 2001 From: Russell Kompinski Date: Thu, 12 Dec 2013 13:33:28 -0500 Subject: [PATCH 1/3] Update en.yml Fixes Translation Missing Error for Add --- config/locales/en.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 6bfdbcc..e45b9ca 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -9,6 +9,7 @@ en: option_value_removed: "Option Value Removed" product_customization_type_removed: "Product Customization Type Removed" ad_hoc_variant_exclusion_removed: "Exclusion Removed" + add: "Add" ad_hoc_variant_exclusion: 'Ad Hoc Variant Exclusion' ad_hoc_variant_exclusions: 'Ad Hoc Variant Exclusions' ad_hoc_variant_exclusions_unavailable: "You only need to configure exclusions when you have more than one ad hoc option type" @@ -46,4 +47,4 @@ en: customize: 'Customize' reset: 'Reset' position_within_product: 'Display order relative to other Ad Hoc Options (low numbers are displayed first)' - selected_by_default: 'Selected by default?' \ No newline at end of file + selected_by_default: 'Selected by default?' From f5144d3b2748dc38a6cd46b9e0f697c01fdef218 Mon Sep 17 00:00:00 2001 From: Russell Kompinski Date: Thu, 12 Dec 2013 13:51:27 -0500 Subject: [PATCH 2/3] Update en.yml Fixes Translation Missing error on ad_hoc select_tag From f9788c74a01d4e97894a5fe96f5772aca600a449 Mon Sep 17 00:00:00 2001 From: Russell Kompinski Date: Wed, 15 Jan 2014 17:46:09 -0500 Subject: [PATCH 3/3] Fire_event Error Fix Seems to fix fire_event error. You can define the fire_event, and try and populate the way the promotions works. But this seems to work. I don't know if it's right. I'm just running the order.update! method --- .../spree/orders_controller_decorator.rb | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/spree/orders_controller_decorator.rb b/app/controllers/spree/orders_controller_decorator.rb index ee053a8..092d026 100644 --- a/app/controllers/spree/orders_controller_decorator.rb +++ b/app/controllers/spree/orders_controller_decorator.rb @@ -10,21 +10,20 @@ module Spree # needs to occur in the cart partial for this to be done 'right' # # Adds a new item to the order (creating a new order if none already exists) - def populate + + def populate + @order = current_order(true) populator = Spree::OrderPopulator.new(current_order(true), current_currency) flexi_hash = {ad_hoc_option_value_ids: ad_hoc_option_value_ids, product_customizations: product_customizations} if populator.populate(params.slice(:products, :variants, :quantity).merge(flexi_hash)) - current_order.ensure_updated_shipments - - fire_event('spree.cart.add') - fire_event('spree.order.contents_changed') - respond_with(@order) do |format| - format.html { redirect_to cart_path } - end - else - flash[:error] = populator.errors.full_messages.join(" ") - redirect_to :back + current_order.update! + + respond_with(@order) do |format| + format.html { redirect_to cart_path } + format.json { render json: current_order } + + end end end end