Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #16963

    I am using Woocommerce and Abundance theme. When I click on an individual item “Add to Cart” it IS adding it to the cart, but the cart total on the navigation bar does not change. If you click on the submenu above it and click Cart it then will add up the items in the cart. As a customer goes through, and clicks “Add to Cart” on a product, the wheel spins, but a customer has no way of knowing it has been added to their cart.

    My website is http://pizzazzgifts.com

    Is there a way to have the “Add to Cart” button work with the Cart on the nav bar?

    Sandy

    #93577

    Hi!

    I think the code after following comment:

    <!-- Begin Attracta Include 2012-09-16 16:49 -->

    causes the error. I’m not sure if this is some custom code or part of a wordpress plugin, etc.

    Best regards,

    Peter

    #93578

    Peter -

    Thank you. Attracta is an SEO tool provided by HostGator. I have moved that code to custom.css and eliminated all other mentions of Attracta that I could find. The cart is still doing the same thing.

    Could you please take another look at it?

    Sandy

    #93579

    Hi,

    Jquery is expecting a json response and instead is receving something else. I suggest you turn off your plugins and see if the matter is resolved and then begin turning them back on one by one till you hit the culprit.

    Attracta code is still there, writing ’3fb9.html’ into the bottom of every page for some reason. Google ’3fb9.html, and you will see mostly your site.

    Thanks,

    Nick

    #93580

    Nick -

    Thank you for the idea of turning off the plugins and turning back on until I find out what is happening. It felt good to be taking action on my own behalf. Here are my observations:

    1. I have contacted HostGator to see if all of Attracta can be deleted from my website. There must be something somewhere that I am not finding. You are absolutely correct, Googling 3fb9.html certainly did bring up my website which was really weird. I wish it would be as easy to get my page to come up on search terms I WANT it to come up for. Hopefully whatever HostGator does will take care of that issue.

    2. In thumbnail view, when clicking “Add to Cart” it does add to the cart, but does not show up on the nav bar. When I click on the cart button in nav bar it then takes me to the cart and the items are there.

    3. In single product view, when clicking on “Add to Cart” it does add to cart because it takes you to the cart immediately and the products are in there. The total in the nav bar also changes.

    4. I have “Redirect to cart after adding product to cart (on single product pages) checked under Catalog options in Woocommerce. The action of the page changing to the cart page makes the total show up in the nav bar.

    5. I have deactivated every plugin and then reactivated each one and see no difference in the way the Cart total shows up on the nav bar.

    Here is my idea. Is there a code I can add to make it redirect to the cart after the “Add to Cart” button is clicked in the thumbnail view? It seems as if the act of going to the cart page triggers the total in the nav bar to add up. I think this might be the answer, but you guys are the experts. What do you think?

    Sandy

    #93581

    Would like some help on this issue please?

    Sandy

    #93582

    The problem in your case is that the ajax request doesn’t work properly. When I click the “Add to cart” button (thumbnail view) it sends a request to WooCommerce which confirms the operation. Afterwards the ajax cart widget at the top will add the product to the cart and there’s no need for a page reload. However in your case I get following js error:

    SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data

    and I think Attracta causes this issue because when I investigate the ajax data (send/get request) – it looks like:

    []<!-- Begin Attracta Include 2012-09-16 16:49 -->

    <script type='text/javascript'>
    function attracta_loadjs(url) {
    (function() {
    var s = document.createElement('script');
    s.type = 'text/javascript';
    s.async = true;
    s.src = url;
    var x = document.getElementsByTagName('script')[0];
    x.parentNode.insertBefore(s, x);
    })();
    }
    function attracta_shouldrun() {
    var v = ["/admin/","/adm/","/wp-admin/","/administrator/"];
    for (x in v) if(window.location.pathname.indexOf(v[x]) == 0) return false;
    return true;
    }
    function attracta_window_width() {
    if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
    if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetWidth ) return document.documentElement.offsetWidth;
    if (window.innerWidth) return window.innerWidth;
    return 0;
    }
    function attracta_window_height() {
    if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
    if (document.compatMode=='CSS1Compat' && document.documentElement && document.documentElement.offsetHeight ) return document.documentElement.offsetHeight;
    if (window.innerHeight) return window.innerHeight;
    return 0;
    }
    </script>

    <script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-32145626-1']);
    _gaq.push(['_trackPageview']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    </script>

    <!-- End Attracta Include 2012-09-16 16:49 -->

    which tells me that Attracta also “hacks” into json strings and destroys the data structure. Of course jquery can’t read/interpret the json data correctly and just outputs an error. Imho if you deactivate Attracta you’ll also solve this issue.

    #93583

    Dude -

    Thank you for this. I wish I knew how to delete all Attracta mentions from my site, it’s almost like it’s a virus or something? I have contacted HostGator and they opened a ticket on this on Thursday. I guess I will give them until tomorrow and if I don’t hear anything back from them, contact them again. It seemed like a good service, and probably is, but maybe doesn’t want to play nicely with Woocommerce. Or maybe I did something wrong, just need it gone!

    Sandy

    #93584

    Hey!

    Please report back if it works without the Attracta service.

    Best regards,

    Peter

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

The topic ‘Add to cart items not going into cart’ is closed to new replies.