From c9e543b25a9125b17d2a18c2b1cd38d2fb4109ad Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 19 Sep 2013 13:39:53 +1000 Subject: [PATCH] Update delivery page of checkout, change shipping to delivery --- app/assets/javascripts/store/checkout_adjustments.js.coffee | 4 ++-- app/models/spree/shipping_method_decorator.rb | 4 ++++ ...ng_instructions_to_delivery_instructions.html.haml.deface | 5 +++++ .../shipping_method_to_delivery_method.html.haml.deface | 2 ++ spec/features/consumer/checkout_spec.rb | 4 ++-- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface create mode 100644 app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface diff --git a/app/assets/javascripts/store/checkout_adjustments.js.coffee b/app/assets/javascripts/store/checkout_adjustments.js.coffee index 6c18dd4535..c443f7dd5d 100644 --- a/app/assets/javascripts/store/checkout_adjustments.js.coffee +++ b/app/assets/javascripts/store/checkout_adjustments.js.coffee @@ -1,8 +1,8 @@ $(document).ready -> $('#cart_adjustments').hide() - $('th.cart-adjustment-header').html('Order Adjustments...') + $('th.cart-adjustment-header').html('Distribution...') $('th.cart-adjustment-header a').click -> $('#cart_adjustments').toggle() - $('th.cart-adjustment-header a').html('Order Adjustments') + $('th.cart-adjustment-header a').html('Distribution') false \ No newline at end of file diff --git a/app/models/spree/shipping_method_decorator.rb b/app/models/spree/shipping_method_decorator.rb index a8b25795b3..e7419e3330 100644 --- a/app/models/spree/shipping_method_decorator.rb +++ b/app/models/spree/shipping_method_decorator.rb @@ -10,4 +10,8 @@ Spree::ShippingMethod.class_eval do end alias_method_chain :available_to_order?, :distributor_check + def adjustment_label + 'Delivery' + end + end diff --git a/app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface b/app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface new file mode 100644 index 0000000000..9593d2495a --- /dev/null +++ b/app/overrides/spree/checkout/_delivery/shipping_instructions_to_delivery_instructions.html.haml.deface @@ -0,0 +1,5 @@ +/ replace_contents '#shipping_method p#minstrs' + += form.label :special_instructions, 'Delivery Instructions' +%br/ += form.text_area :special_instructions, :cols => 40, :rows => 7 diff --git a/app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface b/app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface new file mode 100644 index 0000000000..7fd82f4388 --- /dev/null +++ b/app/overrides/spree/checkout/_delivery/shipping_method_to_delivery_method.html.haml.deface @@ -0,0 +1,2 @@ +/ replace_contents '#shipping_method legend' +Delivery Method diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index 6cced00d18..d410deca62 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -393,7 +393,7 @@ feature %q{ # -- Checkout: Delivery order_charges = page.all("tbody#summary-order-charges tr").map {|row| row.all('td').map(&:text)}.take(2) - order_charges.should == [["Shipping:", "$0.00"], + order_charges.should == [["Delivery:", "$0.00"], ["Distribution:", "$54.00"]] click_checkout_continue_button @@ -476,7 +476,7 @@ feature %q{ # -- Checkout: Delivery order_charges = page.all("tbody#summary-order-charges tr").map {|row| row.all('td').map(&:text)}.take(2) - order_charges.should == [["Shipping:", "$0.00"], + order_charges.should == [["Delivery:", "$0.00"], ["Distribution:", "$54.00"]] click_checkout_continue_button