In my home page there is product listing. Each product contains a button called "Add to Cart". On clicking it is adding into the cart and a pop up is showing telling "your product has been added to the cart". I want to show the respective product name in the pop up .
Following is the ajax code while clicking on the button..
jQuery('#buy_<?php echo $_product->getId(); ?>').click(function() {
jQuery.ajax({
url: '/ajax/index/add',
dataType: 'json',
type : 'post',
data: { isAjax: 1, qty: 1, product: jQuery(this).data('product-id') },
success: function(data){
jQuery('#add-product-container').jqmShow();
}
});
return false;
});
<div id="add-product-container" class="jqmWindow">
<ul class="messages clearfix" id="add-product">
<li class="success-msg">
<span class="spnPrdname"><?php echo "PRODUCT NAME"; ?></span>
<span>has been added to <a href="<?php echo $this->getUrl('checkout/cart'); ?>" class="text-link">your basket</a>.</span>
</li>
</ul>
</div>