K
K
kentos2021-03-30 18:49:51
opencart
kentos, 2021-03-30 18:49:51

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();
    });
}

Well, in cart.add I call the function

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zeus2021, 2021-04-01
@Zeus2021

as an option, just use ready-made solutions
for example https://opencartforum.com/files/file/5343-korzina/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question