/** * Prepare Cart * * @return CoreShopCart|static */ public static function prepareCart() { $cartSession = self::getSession(); if ($cartSession->cartId) { $cart = CoreShopCart::getById($cartSession->cartId); if ($cart instanceof CoreShopCart) { return $cart; } } $cart = CoreShopCart::prepare(); $cartSession->cartId = $cart->getId(); return $cart; }