Firstly, you can find the full order if you want to indicate the order number: R001023223 Then
order = Spree::Order.complete.find_by_number('R001023223')
then find a position like this.
For position position of line item
line_item = order.line_items.first
stock_locations = line_item.variant.stock_locations
For all position placements:
stock_locations = order.variants.map(&:stock_locations).flatten
what he...!!!
source
share