Class: Workarea::Checkout::Steps::Shipping
- Defined in:
- app/models/workarea/checkout/steps/shipping.rb
Defined Under Namespace
Classes: NoAvailableShippingOption
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#complete? ⇒ Boolean
Whether this checkout step is finished.
-
#shipping_options ⇒ Checkout::ShippingOptions
The checkout shipipng options that are available for this order.
-
#update(params = {}) ⇒ Boolean
Update the shipping step of checkout.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Workarea::Checkout::Steps::Base
Instance Method Details
#complete? ⇒ Boolean
Whether this checkout step is finished. Requires order to be valid, since a default shipping service will always be set.
45 46 47 |
# File 'app/models/workarea/checkout/steps/shipping.rb', line 45 def complete? order.valid? && (!order.requires_shipping? || shipping.valid?) end |
#shipping_options ⇒ Checkout::ShippingOptions
The checkout shipipng options that are available for this order.
11 12 13 |
# File 'app/models/workarea/checkout/steps/shipping.rb', line 11 def @shipping_options ||= ShippingOptions.new(order, shipping) end |
#update(params = {}) ⇒ Boolean
Update the shipping step of checkout. This includes:
-
shipping service
A default shipping service will probably be set before getting to this point of the checkout.
28 29 30 31 32 33 34 35 36 37 |
# File 'app/models/workarea/checkout/steps/shipping.rb', line 28 def update(params = {}) unless order.requires_shipping? clean_shipping return true end update_shipping_service(params) add_shipping_instructions(params) persist_update end |