I am adding virtual products to cart by my custom ajax function and now virtual products can only be added one in the cart.if i had second one in the cart it is generating error report as Nominal items can only be purchased as standlone.
I want to show this message on the alert box on the add to cart button page which should i get in the ajax response data.
MY code
$j.ajax({
url: "<?php echo Mage::getUrl('customblocks/ajax/virtualpick2addtocart'); ?>",
type: "POST",
data: {pro_id:sel_pro_id,sel_pro_price:sel_pro_price},
success: function(data){
//$j("#spinner1").hide();
location.href = checkout_url;
},
error: function(){
}
});
and my ajax add to cart code
$cart = Mage::getModel('checkout/cart');
$cart->init();
$cart->addProduct($_product,$params);
$cart->save();
Thanks In Advance