Following is a part of an AJAX functionality to add classes and packs to session cart:-
The jquery part
function addClassToCart(item
You aren't doing anything wrong per se, it's just that when it gets posted, it looks like this:
operation=add_cart&isClass=true&itemId=1234
PHP can't tell what the data type is because it isn't passed, it's always just a string of POST data, so compare it to "true" to do your checks, like this:
if($_POST['isClass'] === "true")
{
//Code to add class to session cart
}
else
{
//Code to add pack to session cart
}