feat: implement CartService to manage cart lifecycle and guest identity resolution
This commit is contained in:
parent
4aedf7ca86
commit
a7dba4dc10
|
|
@ -14,13 +14,13 @@ class CartService
|
||||||
{
|
{
|
||||||
public function show(Tenant $tenant, Request $request): Cart
|
public function show(Tenant $tenant, Request $request): Cart
|
||||||
{
|
{
|
||||||
$identity = $this->resolveIdentity($request);
|
$resolvedIdentity = $this->resolveIdentity($request);
|
||||||
|
|
||||||
if ($identity === null) {
|
if ($resolvedIdentity === null) {
|
||||||
return $this->makeEmptyCart($tenant);
|
return $this->makeEmptyCart($tenant);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cart = $this->findCart($tenant, $identity);
|
$cart = $this->findCart($tenant, $resolvedIdentity['identity']);
|
||||||
|
|
||||||
if ($cart === null) {
|
if ($cart === null) {
|
||||||
return $this->makeEmptyCart($tenant);
|
return $this->makeEmptyCart($tenant);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue