From c4fbcb19d066523d934501e82b1fde017fea59cc Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 5 May 2017 15:28:01 +1000 Subject: [PATCH] Only show Admin & Handling fees once on completed order form --- app/helpers/checkout_helper.rb | 2 +- app/views/spree/orders/_form.html.haml | 2 +- config/locales/en.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/checkout_helper.rb b/app/helpers/checkout_helper.rb index eb4cb1fb65..193c4cef4d 100644 --- a/app/helpers/checkout_helper.rb +++ b/app/helpers/checkout_helper.rb @@ -16,7 +16,7 @@ module CheckoutHelper enterprise_fee_adjustments = adjustments.select { |a| a.originator_type == 'EnterpriseFee' && a.source_type != 'Spree::LineItem' } adjustments.reject! { |a| a.originator_type == 'EnterpriseFee' && a.source_type != 'Spree::LineItem' } unless exclude.include? :admin_and_handling - adjustments << Spree::Adjustment.new(label: 'Admin & Handling', amount: enterprise_fee_adjustments.sum(&:amount)) + adjustments << Spree::Adjustment.new(label: I18n.t(:orders_form_admin), amount: enterprise_fee_adjustments.sum(&:amount)) end adjustments diff --git a/app/views/spree/orders/_form.html.haml b/app/views/spree/orders/_form.html.haml index 7cb5c0f9bf..9813ff8642 100644 --- a/app/views/spree/orders/_form.html.haml +++ b/app/views/spree/orders/_form.html.haml @@ -43,7 +43,7 @@ %span.order-total.distribution-total= display_checkout_admin_and_handling_adjustments_total_for(@order) %td - - checkout_adjustments_for(@order, exclude: [:line_item]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment| + - checkout_adjustments_for(@order, exclude: [:line_item, :admin_and_handling]).reject{ |a| a.amount == 0 }.reverse_each do |adjustment| %tr.order-adjustment %td.text-right{:colspan => "3"} = adjustment.label diff --git a/config/locales/en.yml b/config/locales/en.yml index ab882e9527..0863fcef0f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1045,7 +1045,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using orders_edit_checkout: Checkout orders_form_empty_cart: "Empty cart" orders_form_subtotal: Produce subtotal - orders_form_admin: Admin and handling + orders_form_admin: Admin & Handling orders_form_total: Total orders_oc_expired_headline: Orders have closed for this order cycle orders_oc_expired_text: "Sorry, orders for this order cycle closed %{time} ago! Please contact your hub directly to see if they can accept late orders."