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

Translation Error Fix #90

Open
wants to merge 3 commits into
base: spree-2-1-wip
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions app/controllers/spree/orders_controller_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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?'
selected_by_default: 'Selected by default?'