app/decorators/models/solidus_product_assembly/spree/shipment_decorator.rb
# There might be scenarios where we don't want to display every single
# variant on the shipment. e.g. when ordering a product bundle that includes
# 5 other parts. Frontend users should only see the product bundle as a
# single item to ship
There might be scenarios where we don't want to display every single
variant on the shipment.
There might be scenarios where we don ' t want to display every single variant on the shipment .
def line_item_manifest
        inventory_units.includes(:line_item, :variant).group_by(&:line_item).map do |line_item, units|
          states = {}
          units.group_by(&:state).each { |state, iu| states[state] = iu.count }
          OpenStruct.new(line_item: line_item, variant: line_item.variant, quantity: units.length, states: states)
        end
      end
def line_item_manifest inventory_units . includes ( :line_item , :variant ) . group_by ( & :line_item ) . map do | line_item , units | states = { } units . group_by ( & :state ) . each { | state , iu | states [ state ] = iu . count } OpenStruct . new ( line_item : line_item , variant : line_item . variant , quantity : units . length , states : states ) end end
There might be scenarios where we don't want to display every single
variant on the shipment.
There might be scenarios where we don ' t want to display every single variant on the shipment .