Skip to content

Commit

Permalink
fix support is_buy_now on batch add to cart
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Feb 24, 2025
1 parent a96b529 commit 84ae6d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Http/Controllers/Api/V1/Shop/Customer/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ public function index(): JsonResponse
public function batchStore($productId, Request $request): JsonResponse
{

// $products = $request->input('products');
if (request()->get('is_buy_now')) {
Cart::deActivateCart();
}

$products = $request->input('items');
$cart = Cart::getCart();
// var_dump($cart);exit;
foreach ($products as $product_info) {
$product = $this->productRepository->with('parent')->find($productId);

Expand Down Expand Up @@ -129,9 +131,7 @@ public function store($productId): JsonResponse
if (request()->get('is_buy_now')) {
Cart::deActivateCart();
}
// var_dump(request()->all());exit;
$cart = Cart::addProduct($product->id, request()->all());
// var_dump($cart);exit;
if (
is_array($cart)
&& isset($cart['warning'])
Expand Down

0 comments on commit 84ae6d2

Please sign in to comment.