In Opencart, Button add to cart doesn’t add in the same page but when I make refresh I found the product added.


Please explain why do you think this question should be reported?

Report Cancel

If I add items to the shopping cart, it is not showing in the cart. However, if I refresh the page it is showing up added items in the cart. How to do it without refresh, as I have to refresh each time manually.
I’m running v2.0.3.1 with default theme.

Thread Reply

  1. deepakk883
    Got 1 Votes
    September 19, 2019 at 4:00 pm

    Please briefly explain why you feel this answer should be reported .

    Report Cancel

    Please go to page – template/product/product.tpl

    In this Page find this JS Snippet:

    $('#button-cart').on('click', function () {
    complete: function () {
    //add this line of code
    success: function (json) {
    //Code.... Something went wrong here..

    If still you’re facing the same, please send me screenshot of console. (or can give me the url of your website.)

    I’ll definitely help you!. 🙂🙂

Leave an answer


You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>