return new ItemsFacade($this->cart->
getLineItems(),
$this->priceStubs,
$this->helper,
$this->context
);
} /**
* The `product()` method returns all products of the current cart for further manipulation.
* Similar to the `items()` method, but the line-items are filtered, to only contain product line items.
*
* @return ProductsFacade A `ProductsFacade` containing all product line-items in the current cart as a collection.
*/
public function products(): ProductsFacade
{ return new ProductsFacade($this->cart->
getLineItems(),
$this->priceStubs,
$this->helper,
$this->context
);
} /**
* The `calculate()` method recalculates the whole cart.
* Use this to get the correct prices after you made changes to the cart.
* Note that after calling the `calculate()` all collections (e.g. items(), products()) get new references,
* so if you still hold references to things inside the cart, these are outdated after calling `calculate()`.
*
* The `calculate()` method will be called automatically after your cart script executed.
*/
public function calculate(): void
{