From 4389389d4401d2fa899cc5006815a2b3021c8101 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 6 Nov 2014 16:09:18 +1100 Subject: [PATCH] Checkout: Display error when shipping or payment method is not selected --- app/views/checkout/_payment.html.haml | 4 ++++ app/views/checkout/_shipping.html.haml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/views/checkout/_payment.html.haml b/app/views/checkout/_payment.html.haml index 09e56c796e..36775d6d35 100644 --- a/app/views/checkout/_payment.html.haml +++ b/app/views/checkout/_payment.html.haml @@ -23,9 +23,13 @@ %label = radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, false, required: true, + name: "order.payment_method_id", "ng-model" => "order.payment_method_id" = method.name + %small.error.medium.input-text{"ng-show" => "!fieldValid('order.payment_method_id')"} + = "{{ fieldErrors('order.payment_method_id') }}" + .row{"ng-if" => "order.payment_method_id == #{method.id}"} .small-12.columns = render partial: "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method } diff --git a/app/views/checkout/_shipping.html.haml b/app/views/checkout/_shipping.html.haml index 22eee5f533..ffb1e43de4 100644 --- a/app/views/checkout/_shipping.html.haml +++ b/app/views/checkout/_shipping.html.haml @@ -17,10 +17,14 @@ %label{"ng-repeat" => "method in ShippingMethods.shipping_methods"} %input{type: :radio, required: true, + name: "order.shipping_method_id", "ng-value" => "method.id", "ng-model" => "order.shipping_method_id"} {{ method.name }} + %small.error.medium.input-text{"ng-show" => "!fieldValid('order.shipping_method_id')"} + = "{{ fieldErrors('order.shipping_method_id') }}" + %label{"ng-if" => "Checkout.requireShipAddress()"} %input{type: :checkbox, "ng-model" => "Checkout.ship_address_same_as_billing"} Shipping address same as billing address?