Sunnysideup\Ecommerce\Api\ShoppingCart::prepareOrderItem
Checks and prepares variables for a quantity change (add, edit, remove) for an Order Item.
Signature
public function prepareOrderItem(BuyableModel
$buyable,
[array
$parameters = ,
[boolean
$mustBeExistingItem = true]] )
Parameters
$buyable
—
Sunnysideup\Ecommerce\Interfaces\BuyableModel
- - the buyable (generally a product) being added to the cart
$parameters
—
array
- - array of parameters to target a specific order item. eg: group=1, length=5
$mustBeExistingItem
—
boolean
- - if false, the Order Item gets created if it does not exist - if TRUE the order item is searched for and an error shows if there is no Order item
Returns
- DataObject