fixed cart
This commit is contained in:
parent
34200fe032
commit
423f8e7ede
|
|
@ -56,7 +56,7 @@ class CartController extends Controller
|
||||||
* @param $cartId
|
* @param $cartId
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function destroy(Request $request,$cartId): array
|
public function destroy(Request $request, $cartId): array
|
||||||
{
|
{
|
||||||
$customer = current_customer();
|
$customer = current_customer();
|
||||||
CartService::delete($customer, $cartId);
|
CartService::delete($customer, $cartId);
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,10 @@ class CartService
|
||||||
Cart::query()->where('customer_id', $customer->id)
|
Cart::query()->where('customer_id', $customer->id)
|
||||||
->whereIn('product_sku_id', $productSkuIds)
|
->whereIn('product_sku_id', $productSkuIds)
|
||||||
->update(['selected' => 1]);
|
->update(['selected' => 1]);
|
||||||
|
|
||||||
|
Cart::query()->where('customer_id', $customer->id)
|
||||||
|
->whereNotIn('product_sku_id', $productSkuIds)
|
||||||
|
->update(['selected' => 0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue