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

                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){
                    location.href = checkout_url;
                error: function(){

and my ajax add to cart code

$cart = Mage::getModel('checkout/cart');

Thanks In Advance

  • have you install any module for ajax ?
    – Keyul Shah
    Commented Feb 22, 2014 at 10:30
  • no.my custom code for add to cart. Commented Feb 22, 2014 at 10:43
  • can you please update the error so I can help you
    – Keyul Shah
    Commented Feb 22, 2014 at 10:45
  • i had updated my code.and when i add first product add to cart it adds.but when i ad 2nd one.it thorws error called Nominal items can only be purchased standalone in the error log.i want to send this error to ajax response and need to show on the alert box. Commented Feb 22, 2014 at 10:51
  • you can do one thing in your request method you can do code for your cart and second time you got the same product then retun the error code based on that you can display the error message in alert
    – Keyul Shah
    Commented Feb 22, 2014 at 10:58

1 Answer 1


virtual != nominal

Nominal products are products with recurring profiles, and in Magento 1.x these must be purchased separately. What you are attempting cannot be done without extensive customization (either with effort by yourself or via a third-party module).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.