Skip to content

Commit

Permalink
remove cart check exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidas Klimas committed Oct 22, 2024
1 parent b9a8ccb commit a435461
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions packages/core/src/Models/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,6 @@ public function clear(): Cart
*/
public function associate(LunarUser $user, string $policy = 'merge', bool $refresh = true): Cart
{
if ($this->customer()->exists()) {
if (! $user->query()
->whereHas('customers', fn ($query) => $query->where('customer_id', $this->customer->id))
->exists()) {
throw new Exception('Invalid user');
}
}

return app(
config('lunar.cart.actions.associate_user', AssociateUser::class)
)->execute($this, $user, $policy)
Expand Down

0 comments on commit a435461

Please sign in to comment.