core/app/models/spree/order.rb
# Assigns a default bill_address and ship_address to the order based on the
# associated user's bill_address and ship_address.
# @note This doesn't persist the change bill_address or ship_address
Assigns a default bill_address and ship_address to the order based on the
associated user's bill_address and ship_address.
Assigns a default bill_address and ship_address to the order based on the associated user ' s bill_address and ship_address .
def assign_default_user_addresses
      if user
        bill_address = user.bill_address
        ship_address = user.ship_address
        self.bill_address ||= bill_address if bill_address.try!(:valid?)
        self.ship_address ||= ship_address if ship_address.try!(:valid?) && checkout_steps.include?("delivery")
      end
    end
def assign_default_user_addresses if user bill_address = user . bill_address ship_address = user . ship_address self . bill_address ||= bill_address if bill_address . try! ( :valid? ) self . ship_address ||= ship_address if ship_address . try! ( :valid? ) && checkout_steps . include? ( "delivery" ) end end
Assigns a default bill_address and ship_address to the order based on the
associated user's bill_address and ship_address.
Assigns a default bill_address and ship_address to the order based on the associated user ' s bill_address and ship_address .
# this is one of 2 places still using User#bill_address # Skip setting ship address if order doesn't have a delivery checkout step # to avoid triggering validations on shipping address
note
This doesn't persist the change bill_address or ship_address
This doesn ' t persist the change bill_address or ship_address