Announcement

Collapse
No announcement yet.

Javascript conflict(s) from old ReadyTheme

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

    Javascript conflict(s) from old ReadyTheme

    During the process of converting an Iron & Wool ReadyTheme to the latest version of Shadows there seems to be a conflict with some javascript that might be unique to Iron & Wool that was used to create a page that outputs an add to cart form for each variant assigned to the product. The javascript that accompanies it is to add all the forms to the basket when the add to cart button is submitted using AJAX (this will also update the global header mini-basket fields).

    There are two obvious indications that something is wrong. The tabs on the product page do not work and the add to basket does not work. When I took a peek at the console errors this one stands out:

    Uncaught SyntaxError: redeclaration of const addToCart
    I can link to the live site so you can see the page in action (in the Iron & Wool ReadyTheme) but this error is behind the gates.

    This coding was/is to replace the Toolkit Attribute Quantity for radio buttons.

    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

    #2
    Hi Leslie,

    Try changing the declaration of addToCart from const to let.
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      Originally posted by Matt Zimmermann View Post
      Hi Leslie,

      Try changing the declaration of addToCart from const to let.
      If I knew where to, I would. I'll see what I can figure out though. Thanks!
      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


        #4
        Hi Leslie,

        When you see the error, the console should mention what line and file are affected. It is probably in the extensions.js file.
        Matt Zimmermann

        Miva Web Developer
        Alchemy Web Development
        https://www.alchemywebdev.com
        Site Development - Maintenance - Consultation

        Miva Certified Developer
        Miva Professional Developer

        https://www.dev4web.net | Twitter

        Comment


          #5
          Originally posted by Matt Zimmermann View Post
          Hi Leslie,

          When you see the error, the console should mention what line and file are affected. It is probably in the extensions.js file.
          Yeah, I was just digging through that - it is pointing to the JavaScriptCombinedResource_Code=scripts (in the footer_js group)
          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


            #6
            Originally posted by Matt Zimmermann View Post
            Hi Leslie,

            When you see the error, the console should mention what line and file are affected. It is probably in the extensions.js file.
            All changing the declaration of addToCart from const to let did was this:
            Uncaught SyntaxError: redeclaration of let addToCart
            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


              #7
              Hi Leslie,

              Since it's behind security and a functional conversion, I would recommend contacting support.
              Matt Zimmermann

              Miva Web Developer
              Alchemy Web Development
              https://www.alchemywebdev.com
              Site Development - Maintenance - Consultation

              Miva Certified Developer
              Miva Professional Developer

              https://www.dev4web.net | Twitter

              Comment


                #8
                Originally posted by Matt Zimmermann View Post
                Hi Leslie,

                Since it's behind security and a functional conversion, I would recommend contacting support.
                Thanks, I sent an email to Nick Developer Support (he had helped me replace the Toolkit coding with native coding), I have an appointment Monday with Mike but I was really hoping to get this going a lot sooner. Mike mentioned that there is some duplicated javascript. I'll keep emailing him my findings and hopefully he can email me a reply. Thanks!
                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

                Working...
                X