Announcement

Collapse
No announcement yet.

AJAX Add 2 Cart problem -- urgent

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • AJAX Add 2 Cart problem -- urgent

    Might not be a Colossus issue. Add 2 Cart was working fine 2 days ago. This RT has minor mods and none to the prod page or basket and mini-basket.

    All the sudden today when testing, adding to the cart, the mini-basket was firing and the prod page wasn't reloading. There was a valid link to get to BASK page which worked. However, the quantity added to the cart doubled. The ADD 2 Basket button has an "?ajax=1" added to it. I removed that from the button definition and the mini-basket breakage doesn't show. ADD2Basket now goes directly to the BASK page, but the quantity is still doubling.

    If these are separate issues I need to solve the doubling of the quantity being added first.

    Hopefully, that makes sense.

    Thanks,

    Scott
    What help do you need today!
    Interactive Design Solutions http://www.southbound.com
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    My T-shirt Collection is mostly MivaCon T-shirts!!
    Competitive Rates, Popular Modules, and Integrations:
    Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

  • Your button
    Code:
     <span class="t-product-layout-purchase__add-to-cart" onclick="document.forms.add.action = 'https:\/\/www.domain.com\/BASK.html'; document.forms.add.elements.Action.value = 'ADPR';"> <input class="c-button c-button--full c-button--huge c-control-group__button u-bg-primary u-color-black u-text-bold u-font-small u-text-uppercase" data-action="https://www.domain.com/BASK.html?" data-hook="add-to-cart" data-value="Add To Cart" type="submit" value="Add To Cart"> </span>
    The demo button
    <span class="t-product-layout-purchase__add-to-cart" onclick="document.forms.add.action = 'https:\/\/colossus.mivareadythemes.com\/basket-contents.html'; document.forms.add.elements.Action.value = 'ADPR';"> <input class="c-button c-button--full c-button--huge c-control-group__button u-bg-primary u-color-black u-text-bold u-font-small u-text-uppercase" data-action="https://colossus.mivareadythemes.com/basket-contents.html?ajax=1" data-hook="add-to-cart" data-value="Add To Cart" type="submit" value="Add To Cart"> </span>
    I have no idea what I'm talking about but if you aren't using the "ajax=1" do you need the "?"
    Last edited by lesliekirk; 03-22-20, 01:17 PM.
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    Comment


    • Of course, that was just a DAG. I noticed something intriguing, the page sort of reloaded slowly, the mini-basket very briefly displayed with the correct quantity and then went to the BASK screen doubling the quantity.

      Oh yeah, Scott, you may want to share the site link so those who really know how to fix this stuff can see this weird stuff too.

      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


      • Thanks, Leslie.

        I added the ? to the button. It didn't fix doubled qty unfortunately.

        Scott
        What help do you need today!
        Interactive Design Solutions http://www.southbound.com
        MivaMerchant Business Partner | Certified MivaMerchant Web Developer
        My T-shirt Collection is mostly MivaCon T-shirts!!
        Competitive Rates, Popular Modules, and Integrations:
        Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

        Comment


        • Looks like MM is adding the question mark if there is no URI.

          I notice in Javascript Resources that the "ajax-add-to-cart" is neither active or global. Setting those to ON were no help.

          Scott
          What help do you need today!
          Interactive Design Solutions http://www.southbound.com
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          My T-shirt Collection is mostly MivaCon T-shirts!!
          Competitive Rates, Popular Modules, and Integrations:
          Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

          Comment


          • Are you able to look at a default ReadyTheme - one with no changes? Yeah, that's a lot of stuff going on with Colossus. Might be time to also post there and hope that someone is watching the forums (other than to watch us "talk" to each other).
            Leslie Kirk
            Miva Certified Developer
            Miva Merchant Specialist since 1997
            Previously of Webs Your Way
            (aka Leslie Nord leslienord)

            Email me: [email protected]
            www.lesliekirk.com

            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

            Comment


            • ids - Can you post a link to the site?
              Matt Zimmermann
              Director of UI/UX
              / Miva, Inc.

              Comment


              • Originally posted by Matt Zimmermann View Post
                ids - Can you post a link to the site?
                Matt Zimmermann I'll send it to you in a PM.
                Leslie Kirk
                Miva Certified Developer
                Miva Merchant Specialist since 1997
                Previously of Webs Your Way
                (aka Leslie Nord leslienord)

                Email me: [email protected]
                www.lesliekirk.com

                Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                Comment


                • Has anything changed or been added having to do with click tracking? Some third-party scripts can cause the product to be added twice by piggy-backing or hijacking the original click. This would cause the mini-basket to show briefly and then proceed to the basket page. As for the "?ajax=1" in the URL, that is so the entire basket page does not have to load to populate the mini-basket.
                  Matt Zimmermann
                  Director of UI/UX
                  / Miva, Inc.

                  Comment


                  • I think there are. I wouldn't have guessed that scenario. This was a recent conversion and Colossus was applied. Some of the old scripts that prev devs added were folded back into the site.

                    Scott
                    What help do you need today!
                    Interactive Design Solutions http://www.southbound.com
                    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                    My T-shirt Collection is mostly MivaCon T-shirts!!
                    Competitive Rates, Popular Modules, and Integrations:
                    Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

                    Comment


                    • I think I isolated the cause. It's the Google Enhanced eCommerce tracking code. I'm glad I know what, but we need to be able to track...

                      Ideas?

                      What help do you need today!
                      Interactive Design Solutions http://www.southbound.com
                      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                      My T-shirt Collection is mostly MivaCon T-shirts!!
                      Competitive Rates, Popular Modules, and Integrations:
                      Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

                      Comment


                      • Try relocating where the tracking code fires. I know google say put it at the top, but that's google. Set as the last thing to be called.
                        Bruce Golub
                        Phosphor Media - "Your Success is our Business"

                        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                        phosphormedia.com

                        Comment


                        • Bruce's thought kicked in a memory.

                          My memory is suspect in all this. Others and I were instrumental in rooting out the issue of using Enhanced eCommerce mode.

                          https://www.miva.com/forums/forum/ge...le-tag-manager

                          To summarize, GA item in most cases, and is in the default location in Colossus, in the global footer. If you are using Enhanced eCommerce mode the GA tag needs to be in the HEAD Tag.

                          Scott
                          What help do you need today!
                          Interactive Design Solutions http://www.southbound.com
                          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                          My T-shirt Collection is mostly MivaCon T-shirts!!
                          Competitive Rates, Popular Modules, and Integrations:
                          Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

                          Comment


                          • I may have something. In the Google Analytics Tracking Code template, change:
                            Code:
                            var mvga_tracker = new MVGA_Tracker( '<mvt:item name="ga_jsencode" param="ga_tracking:product_link_prefix" />', '<mvt:item name="ga_jsencode" param="category:name" />', '<mvt:item name="ga_jsencode" param="product:code" />', '<mvt:item name="ga_jsencode" param="product:name" />', mvga_basketitems, mvga_orderitems );
                            to:
                            Code:
                            AddEvent( window, 'load', function() {
                                if ( window.ga && ga.create ) {
                                    var mvga_tracker = new MVGA_Tracker( '<mvt:item name="ga_jsencode" param="ga_tracking:product_link_prefix" />', '<mvt:item name="ga_jsencode" param="category:name" />', '<mvt:item name="ga_jsencode" param="product:code" />', '<mvt:item name="ga_jsencode" param="product:name" />', mvga_basketitems, mvga_orderitems );
                                }
                            });
                            Matt Zimmermann
                            Director of UI/UX
                            / Miva, Inc.

                            Comment


                            • Thanks, Matt. I'll give this a try when I get a chance.

                              Is the GA item a Render Blocking script?
                              Do you think this change will allow me to move the GA item call back to the footer which could solve that issue?

                              Scott

                              What help do you need today!
                              Interactive Design Solutions http://www.southbound.com
                              MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                              My T-shirt Collection is mostly MivaCon T-shirts!!
                              Competitive Rates, Popular Modules, and Integrations:
                              Product Copy | AutoBaskets | Waitlist Integration| Wholesale Integration

                              Comment

                              Working...
                              X

                              This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

                              This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

                              Accept