'success', 'message' => 'Item removed from your cart successfully!' ]); } else { // If the item doesn't exist in the cart echo json_encode([ 'status' => 'error', 'message' => 'Item not found in the cart!' ]); } } else { // Invalid request echo json_encode([ 'status' => 'error', 'message' => 'Invalid request!' ]); }