Class: Sprangular::ShippingRatesController
- Inherits:
-
BaseController
- Object
- Spree::BaseController
- BaseController
- Sprangular::ShippingRatesController
- Defined in:
- app/controllers/sprangular/shipping_rates_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
#invalid_resource!, #not_found, #unauthorized
Instance Method Details
#index ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/sprangular/shipping_rates_controller.rb', line 2 def index if params[:zipcode] country_id, state_id = lookup_location(params[:zipcode]) zipcode = params[:zipcode] else country_id = params[:country_id] || Spree::Config.default_country_id state_id = params[:state_id] zipcode = '' end @order = current_order @order.use_billing = params[:use_billing] if @order.use_billing update_address(@order.bill_address ||= Spree::Address.new, country_id, state_id, zipcode) else update_address(@order.ship_address ||= Spree::Address.new, country_id, state_id, zipcode) end render 'spree/api/orders/show' end |