This topic contains 3 replies, has 2 voices, and was last updated by Alex Alex 3 years ago.

How to change the "website" field to hold the whatsapp number?

  • Hallo all,
    since I don’t use the “website” field in mega store locator, is there a way to use it as a whatsapp number? i:e: When the user clicks it on the smartphone, whatsapp should be triggered.
    I know I can use the https://wa.me/MyWaNumber syntax.
    So, I would like to display the label “Whatsapp” and using the (website) field value (that contais only the whatsapp number) to trigger whatsapp.
    Can you point me to the right direction to get this done? which file need I to edit?
    TIA
    tony

    Alex
    StaffUser Level

    Hi Tony,

    Thanks for reaching out, you can rename the website string caption from /language folder, you can edit mega-superstorefinder.js

    Search for the following code:

    '<div class="infobox__row   store-website" style="display:none;"><a target="new" ',((_store.website.substring(0, 4)!="http") ? 'href="http://'+_store.website : 'href="'+_store.website),'">',
                                    _store.website,

    Change it to:

    '<div class="infobox__row   store-website" style="display:none;"><a target="new" ',((_store.website.substring(0, 4)!="http") ? 'href="https://wa.me/'+_store.website : 'href="'+_store.website),'">',
                                    _store.website,

    You can enter the data with just phone number i.e 6903234234

    For customization of code in the future, you may need to contact our devs team here to perform customization.

    Based on Codecanyon support policy here, the off-the-shelf product features come as it is as per item description and live preview page, customization is not part of the support scope, however can be requested to our devs team via the contact form here if needed.

    Cheers,
    Alex

    Thanks for the reply.
    I edited the code and it “almost” work; the problem is that the whatsapp field is shown even when the field in the database is epmty.
    Tony

    Alex
    StaffUser Level

    Hi Tony,

    The code is just for reference, you can tweak and customize it if needed.

    We’ve tested the code at our staging at it works, the Whatsapp field does not show when the data is not available for a particular store. It could be other issues.

    To get the perfect code as well as troubleshooting and support, best to request our devs team for customization via the contact form here by providing your full requirements so they can analyze the timeline/cost.

    As mentioned, based on Codecanyon support policy here, the off-the-shelf product features come as it is as per item description and live preview page, customization is not part of the support scope, however can be requested to our devs team via the contact form here if needed.

    Cheers,
    Alex

The topic ‘How to change the "website" field to hold the whatsapp number?’ is closed to new replies.