' + data.message + '
'); $('#ne-modal0 .modal-body').slideDown(400); }); } else { $('#ne-modal0 .modal-body').prepend(' '); } $("#ne-modal0 .ne-error").slideDown(200); $("#ne-modal0 .ne-error").delay(3000).slideUp(200, function(){ $(this).remove(); }); } else { $('#ne-modal0 .modal-body').prepend(' '); } }, "json"); return false; }); }); // $(function() { $.each($("[onclick^='cart.add']"), function() { var product_id = $(this).attr('onclick').match(/[0-9]+/); $(this).attr('onclick', 'get_ocmodpcart(\'' + $(this).attr('onclick').match(/[0-9]+/) + '\',\'' + 'catalog' + '\');'); }); var main_product_id = $('input[name=\'product_id\']').val(); $('#button-cart').unbind('click').attr('onclick', 'get_ocmodpcart(\'' + main_product_id + '\',\'' + 'product' + '\');'); $('#cart > button').removeAttr('data-toggle').attr('onclick', 'get_ocmodpcart(false,\'' + 'show_cart' + '\');'); }); function get_ocmodpcart(product_id, action, quantity) { quantity = typeof(quantity) != 'undefined' ? quantity : 1; if (action == "catalog") { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id + '&quantity=' + quantity, dataType: 'json', success: function(json) { if (typeof $.fn.magnificPopup == "undefined") { $('body').append('