Answer the question
In order to leave comments, you need to log in
How to display information about the product in the popup when the product is successfully added?
Hello, I want to display information, after the successful addition of the product, image, price and quantity, how to do this?
Now I'm outputting
js like this
function addCartModal(json) {
var html = '<div id="addCartModal" class="modal" role="dialog">';
html += '<div class="modal-dialog">';
html += '<div class="modal-content">';
html += '<div class="modal-header">';
html += '<button type="button" class="close" data-dismiss="modal">×</button>';
html += '<h4 class="modal-title">Новые товары в корзине</h4>';
html += '</div>';
html += '<div class="modal-body">';
html += json['success'];
html += '</div>';
html += '<div class="modal-footer">';
html += '<div class="row">';
html += '<div class="col-sm-6">';
html += '<button type="button" class="button-cart-box" data-dismiss="modal">К покупкам</button>';
html += '</div>';
html += '<div class="col-sm-6">';
html += '<button type="button" class="button-cart" data-dismiss="modal" onclick="window.location.href=\'/cart/\';">Перейти в корзину</button>';
html += '</div>';
html += '</div>';
html += '</div>';
html += '</div>';
html += '</div>';
html += '</div>';
$('body').append(html);
$('#addCartModal').modal('show');
$('#addCartModal').on('hidden.bs.modal', function (e) {
$(this).remove();
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question