• Support
  • tawk to popout from buttonizer

I want TAWK chat to POPOUT from buttonizer, but facing this error.

Can anyone help me fix this ?

Hi @qouiou,

What you are using is a javascript editor. The language you have typed is HTML.
What you should enter in the editor is just the following:

Tawk_API.toggle();

Please let me know if this worked for you.

  • Ange replied to this.

    this worked brilliantly!!

    can you also tell me how I can add a cart action button to a group? i cant seem to find an option to add as a cart.

    thanks a lot for correcting my code.

    thanks for your response again Castor. Page you suggested me is for PRODUCT ADD TO CART.

    What I want is buttonizer URL action button to open my default woocommerce cart upon clicking. Example www.meccabooks.com is a shopify website, but their similar buttonizer button opens up the cart upon click, that's what I want actually.

      Hi qouiou ,

      Thanks for the clarification. If you go to your cart in your browser and look at the browser URL, you should be able to use that URL and fill that in Buttonizer to link to the cart.

      I did that, but cart doesn't open up upon clicking. Leaves a dead action I guess.

      I added cart icon www.ibsbookstore.com , can you please check error I am doing in the URL ?

        qouiou

        Ah, I see what's going on. The shopping cart is a popup which shows when the element with id="cart" has a class "open". Something like the following should be able to toggle it (enter in javascript action)

        const el = document.querySelector("#cart");
        if(el.classList.contains("open")) el.classList.remove("open"); else el.classList.add("open");

        Or, if you just want it to open and not toggle, simply do something like this:

        const el = document.querySelector("#cart")
        el.classList.add("open")

        somehow both the action is not working.....with or without toggle. Attached screenshot.

        I want with toggle and
        open up

          qouiou
          Remove the word 'javascript' and it should work.


          Actually i attached wrong pic...without javascript also its not working

            Hi qouiou ,

            I've checked the code of my collegue and your website and found out the cart automatically closes if you click outside that element.

            If you click the Buttonizer button, it indeed opens the cart, but the cart closes as it registers a click outside the cart container.

            What you could do is adding an setTimeout.

            Can you try using the following code:

            const el = document.querySelector("#cart");
            setTimeout(function() {
              if(el.classList.contains("open")) el.classList.remove("open"); else el.classList.add("open");
            }, 500);

            Let me know if it helps 🙂

            5 months later

            Castor I am trying this but I feel like I am missing some details
            Can you help me plz

              9 days later

              Hi Ange , this code could be different per theme. What is your website?