class MarketTown::Checkout::CartStep
The place where a checkout process begins. This step represents the finalisation of a cart before the checkout process.
Dependencies:
- order#has_line_items? - address_storage#load_default - promotions#apply_cart_promotions - finish#cart_step
Protected Instance Methods
apply_cart_promotions(state)
click to toggle source
Tries to apply cart promotions
# File lib/market_town/checkout/steps/cart_step.rb, line 39 def apply_cart_promotions(state) end
ensure_line_items(state)
click to toggle source
@raise [NoLineItemsError] when no line items on order
# File lib/market_town/checkout/steps/cart_step.rb, line 23 def ensure_line_items(state) unless deps.order.has_line_items?(state) raise NoLineItemsError.new(state) end end
finish_cart_step(state)
click to toggle source
Finishes cart step
# File lib/market_town/checkout/steps/cart_step.rb, line 44 def finish_cart_step(state) deps.finish.cart_step(state) end
load_default_addresses(state)
click to toggle source
Tries to load default addresses
# File lib/market_town/checkout/steps/cart_step.rb, line 31 def load_default_addresses(state) deps.address_storage.load_default(state) rescue MissingDependency add_dependency_missing_warning(state, :cannot_load_default_addresses) end