• need to open whatsapp on click of a button of my choice and hide your float button,
    here the button is elementor icon in the header(option to add class or id in the elementor setting)

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author walterpinem

    (@walterpinem)

    Hi.

    Thanks for using the plugin.
    I don’t quite understand the problem you are facing.
    Can you please elaborate more?
    Also if possible, please attach a screenshot of the problem.
    I will assist you.

    Thank you.

    Thread Starter anand99

    (@anand99)

    on the header there is a elementor icon
    my requirement is when this icon is clicked the same thing should happen when the floating button is clicked. i have tried to add the class id of the float button to the elementor icon but didnt work,
    if this is achieved i will hide floating button

    Plugin Author walterpinem

    (@walterpinem)

    Hi.

    Is this icon https://prnt.sc/vklgzc do you mean the header icon?
    Perhaps you just want to copy the URL of the floating button and then link it into the icon?
    So make the header icon clickable using the URL of the floating button?
    It’s the fastest way to do.

    Please try it and let me know the result whether it satisfies your needs.

    Thank you.

    Thread Starter anand99

    (@anand99)

    Yes It is the icon shown in the image, but iam afraid just by coping the URL to the icon won’t solve the issue because url is different for different pages

    Plugin Author walterpinem

    (@walterpinem)

    If you’re using Floating Button feature of OneClick Chat to Order, there is indeed a feature to include “From URL” with current page’s link into the message.
    But unfortunately, you cannot move the function into another element just by using ID/class. That’s not how it works.

    If you want to create the same function to attach the URL into the icon as per your needs, then you’ll need to create your own function using some kind of javascript or PHP, depending on your needs.

    Or if you just want the icon to be clickable and link to WhatsApp with pre-filled chat text and phone number, then you might want to create a URL like the following and embed it into your icon:

    https://api.whatsapp.com/send?phone=[phone number with country code]&text=[URL encoded message]

    Notice that I use api.whatsapp.com as the base URL since it works fine with both mobile and desktop.

    • This reply was modified 4 years, 3 months ago by walterpinem.
    Thread Starter anand99

    (@anand99)

    https://api.whatsapp.com/send?phone=%5Bphone number with country code]&text=[URL encoded message]

    here the [URL encoded message] should be automatic depending on the current location of the page

    Plugin Author walterpinem

    (@walterpinem)

    Hi @anand99

    The built-in plugin feature has the automatic [URL encoded message] already.
    But since you want to create your own function that’s out of the plugin scope, you’ll have to create and implement your own function.
    You can find how I do it on the plugin file (oneclick-whatsapp-order plugin folder =>includes => buttons => wa-order-floating-button.php file on line #34 – #35), then you can create your own function to do so based on the plugin’s code.

    Or, you can also create a javascript function. This is a good example of how to get the current URL automatically: https://www.tutorialrepublic.com/faq/how-to-get-the-current-url-with-javascript.php

    Hope that helps.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘help needed’ is closed to new replies.