On the same page I have 2 sections. First section is generated dynamically (when I enter a text in an autocomplete field) and the second section is loaded on pageload.
There is an ajax all I need to make from both sections (basically add a product button is present in both sections).
jq.ajax({
url: '<?php echo Mage::getBaseUrl(); ?>marketplace/product/addcart/',
dataType: 'JSON',
data: {"productid":product_id,"qty":product_qty,"customOption":customOption},
success: function(result) {
jq('.ajax_loader').hide();
var cartdiv = result.cartsidebar;
jq(".shoping-cart").html(cartdiv);
jq.growl.notice({ message: result.message });
}
});
This call succeeds from the second section and works like a charm but when I make the same call from the first section (that was dynamically generated) then it fails and xrs.status is 0
I have checked in firebug and the url is resolving exactly the same in both sections:
GET http://localhost/magentonew/marketplace/product/addcart/?productid=5666&qty=1
What am I doing wrong?