Sunnysideup\Ecommerce\Model\ProductOrderItem::Product
Overloaded Product accessor method.
Overloaded from the default has_one accessor to retrieve a product by it's version, this is extremely useful because we can set in stone the version of a product at the time when the user adds the item to their cart, so if the CMS admin changes the price, it remains the same for this order.
Signature
public function Product([boolean
$current = false] )
Parameters
$current
— boolean- If set to TRUE, returns the latest published version of the Product,
If set to FALSE, returns the set version number of the Product
(instead of the latest published version)
Returns
- DataObject|Product
- object