Home Forums WoodMart support forum Mini cart widget not showing after adding an action after successful add-to-cart

Mini cart widget not showing after adding an action after successful add-to-cart

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #205547

    kangjh0722
    Participant

    Hi, I’m now trying to insert conversion code for add-to-cart function.

    To do that I’m using the code below.

    //Add to cart
    add_action('woocommerce_add_to_cart','naver_add_to_cart_conversion');
    
    function naver_add_to_cart_conversion( $product_data ){
    
    $price_added_to_cart = $prodcut_data -> get_price() ;
    ?>
    <script type="text/javascript" src="https://wcs.naver.net/wcslog.js"></script>
    <script type="text/javascript">
    var _nasa={};
    _nasa["cnv"] = wcs.cnv("3","<?php echo $price_added_to_cart ?>");
    </script>
    }
    <?php

    This code is used for “NAVER Analytics” to track down the conversion on add-to-cart, register, and purchase.

    However, the problem is that the widget that used to appear after a product was successfully added to cart does not appear. Instead the loading icon on add-to-cart button keeps running and does not stop.

    If I refresh the page, it is possible to check that the item was added successfully due to the click on add-to-cart button.

    I think the javascript code is causing this problem, but not sure..

    Please help me settling this issue.

    *Currently I deleted all the customized code so that the site works smoothly.

    #205570

    Artem Temos
    Keymaster

    Hello,

    Try to disable our theme’s “AJAX add to cart” option in Theme Settings -> Product page and check how it works without it.

    Kind Regards

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)