feat(catalog): implement maximum addable quantity logic and user quota sharing across variants
This commit is contained in:
@@ -243,7 +243,7 @@ class StartCheckoutService
|
||||
|
||||
$this->loadCartItems($cartItems);
|
||||
$this->verifyTenantItems($tenant, $cartItems);
|
||||
$this->assertCartPurchaseLimits($tenant, $userId, $cartItems);
|
||||
$this->assertCartPurchaseLimits($tenant, $userId, $cartItems, $cart->getKey());
|
||||
$cart->setRelation('items', $cartItems);
|
||||
|
||||
$purchase = $this->createPurchase(
|
||||
@@ -312,6 +312,7 @@ class StartCheckoutService
|
||||
Tenant $tenant,
|
||||
int $userId,
|
||||
Collection $cartItems,
|
||||
int $cartId,
|
||||
): void {
|
||||
$quantities = $cartItems
|
||||
->groupBy('catalog_item_id')
|
||||
@@ -333,6 +334,7 @@ class StartCheckoutService
|
||||
$catalogItem,
|
||||
$userId,
|
||||
$quantity,
|
||||
excludedCartId: $cartId,
|
||||
field: 'cart_id',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user