Api add to cart error message issue fixed

This commit is contained in:
jitendra 2019-05-09 12:04:41 +05:30
parent 16220c656f
commit a9a069f366
1 changed files with 3 additions and 2 deletions

View File

@ -91,9 +91,10 @@ class CartController extends Controller
$result = Cart::add($id, request()->except('_token'));
if (! $result) {
$message = session()->get('warning') ?? session()->get('error');
return response()->json([
'error' => 'Something went wrong, please again later.'
], 401);
'error' => session()->get('warning')
], 400);
}
Event::fire('checkout.cart.item.add.after', $result);