core/app/models/spree/promotion_code.rb
def usage_count(excluded_orders: [])
    adjustments.
    eligible.
    in_completed_orders(excluded_orders: excluded_orders).
    count(:order_id)
  end
# Number of times the code has been used overall
#
# @param excluded_orders [Array<Spree::Order>] Orders to exclude from usage count
# @return [Integer] usage count
Number of times the code has been used overall
Number of times the code has been used overall
def usage_count(excluded_orders: [])
    adjustments.
    eligible.
    in_completed_orders(excluded_orders: excluded_orders).
    count(:order_id)
  end
def usage_count ( excluded_orders : [ ] ) adjustments . eligible . in_completed_orders ( excluded_orders : excluded_orders ) . count ( :order_id ) end
Number of times the code has been used overall
Number of times the code has been used overall
None
Integer
excluded_orders
Orders to exclude from usage count
Orders to exclude from usage count