Method: Spree::LineItem#product

Defined in:
app/models/spree/line_item.rb

#productSpree::Product?

Note:

This will return the product even if it has been deleted.

Returns the product associated with this line item, if there is one.

Returns:

  • (Spree::Product, nil)

    the product associated with this line item, if there is one



120
121
122
# File 'app/models/spree/line_item.rb', line 120

def product
  variant.product
end