mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge branch 'move-save-checkout-button'
Conflicts: spec/features/consumer/checkout_spec.rb
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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')
|
||||
:original => 'ce2043a01931b3bc16b045302ebb0e0bb9150b67')
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<!-- insert_after '[data-hook="checkout_summary_box"]'
|
||||
sequence :before => 'add_change_distributor_form_to_checkout_address' -->
|
||||
|
||||
<% # Add a new 'Save and Continue/Process My Order' button under Order Summary on the checkout pages %>
|
||||
|
||||
<div id="add_new_save_checkout_button" class="columns omega four">
|
||||
<%= submit_tag @order.state == "payment" ? "Process My Order" : t(:save_and_continue),
|
||||
:class => "continue button primary large",
|
||||
:form=> "checkout_form_#{@order.state}" %>
|
||||
<script>
|
||||
//Show additional button only if form attribute is supported
|
||||
if ($("#add_new_save_checkout_button input[type=submit]")[0].form) {
|
||||
$("#add_new_save_checkout_button").show();
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user