diff --git a/app/assets/stylesheets/store/openfoodweb.css.scss b/app/assets/stylesheets/store/openfoodweb.css.scss index 79084afae7..12fc37d089 100644 --- a/app/assets/stylesheets/store/openfoodweb.css.scss +++ b/app/assets/stylesheets/store/openfoodweb.css.scss @@ -278,6 +278,14 @@ div#eft-payment-alert { border: 2px solid red; } +/* Large 'Save and Continue/Process My Order' button under Order Summary on the checkout pages */ +#add_new_save_checkout_button { + display: none; + margin-top: 30px; + padding-top: 10px; + border-top: 1px solid #d9d9db; +} + /* Cleared div for clearing previous floating elements */ div.cleared { clear: both; diff --git a/app/overrides/replace_checkout_payment_button.rb b/app/overrides/replace_checkout_payment_button.rb index cbc8e9c875..06a3c95e9f 100644 --- a/app/overrides/replace_checkout_payment_button.rb +++ b/app/overrides/replace_checkout_payment_button.rb @@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/checkout/_payment", :replace => "code[erb-loud]:contains('submit_tag t(:save_and_continue)')", :text => "<%= submit_tag 'Process My Order', :class => 'continue button primary' %>", :name => "replace_checkout_payment_button", - :original => 'ce2043a01931b3bc16b045302ebb0e0bb9150b67') \ No newline at end of file + :original => 'ce2043a01931b3bc16b045302ebb0e0bb9150b67') diff --git a/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface b/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface new file mode 100644 index 0000000000..cf4aed5de1 --- /dev/null +++ b/app/overrides/spree/checkout/edit/add_new_save_checkout_button.html.erb.deface @@ -0,0 +1,16 @@ + + +<% # Add a new 'Save and Continue/Process My Order' button under Order Summary on the checkout pages %> + +
\ No newline at end of file diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index 9fdcc48770..27d95b867a 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -192,14 +192,15 @@ feature %q{ # Disabled until this form takes order cycles into account # page.should have_selector "select#order_distributor_id option[value='#{@distributor_alternative.id}']" - click_button 'Save and Continue' + #click_button 'Save and Continue' + click_continue_button # -- Checkout: Delivery page.should have_selector 'label', :text => "Delivery $3.00" - click_button 'Save and Continue' + click_continue_button # -- Checkout: Payment - click_button 'Process My Order' + click_continue_button # -- Checkout: Order complete page.should have_content('Your order has been processed successfully') @@ -211,4 +212,11 @@ feature %q{ # page.should have_content('12 Bungee Rd, Carion') end + + private + + def click_continue_button + page.find('#add_new_save_checkout_button input[type=submit]').click + end + end