Checkout: Display error when shipping or payment method is not selected

This commit is contained in:
Rohan Mitchell
2014-11-06 16:09:18 +11:00
parent ca9da15ba4
commit 4389389d44
2 changed files with 8 additions and 0 deletions

View File

@@ -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 }

View File

@@ -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?