From 7708bc9f9952aa6c49d6cbdb2016a499a354c110 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 26 Feb 2014 15:48:23 +1100 Subject: [PATCH] Patching up our shipping selection so there's always a default --- app/views/shop/checkout/_form.html.haml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/shop/checkout/_form.html.haml b/app/views/shop/checkout/_form.html.haml index 44374f49aa..68f4cf0a90 100644 --- a/app/views/shop/checkout/_form.html.haml +++ b/app/views/shop/checkout/_form.html.haml @@ -38,17 +38,17 @@ = ba.text_field :zipcode %fieldset#shipping - %legend Shipping - - - for ship_method in current_distributor.shipping_methods.uniq + %legend Shipping + - checked_id = @order.shipping_method_id || current_distributor.shipping_methods.first.id + - for ship_method, i in current_distributor.shipping_methods.uniq .row .large-12.columns - %label - = f.radio_button :shipping_method_id, ship_method.id, - text: ship_method.name, - "ng-model" => "shipping_method", - "ng-change" => "shippingMethodChanged()", - "data-require-ship-address" => ship_method.require_ship_address + = f.radio_button :shipping_method_id, ship_method.id, + text: ship_method.name, + "ng-init" => "shipping_method = #{checked_id}", + "ng-model" => "shipping_method", + "ng-change" => "shippingMethodChanged()", + "data-require-ship-address" => ship_method.require_ship_address = fields_for current_order.ship_address do |sa| #ship_address{"ng-show" => "require_ship_address"}