Jump to content
Afriluka

Whatsapp Live Chat + Share Buttons without module

Recommended Posts

Posted (edited)

Hello to everybody

To create a Whatsapp Live Chat Link:

you just need to copy the code below into your footer or anywhere else to set up a clickable link for a whatsapp chat. You just need to add your own number including the international country code without the plus. For example for a German number like +49 177 0000000 you just remove the plus and the spaces and add it to the url like shown below. Once your customer click on the link for android or iphone user whatsapp will start or for computer user web.whatsapp will start in his browser.

<p><i class="fab fa-whatsapp fa-lg"></i><a href="https://wa.me/491730000000" target="_blank"> anrufen per Whatsapp</a></p>

 

To add a Whatsapp Share Button

to the module Social Media Buttons (v2.1.0)

You just need to open the file /prestashop/modules/ps_sharebuttons/ps_sharebuttons.php

find

protected static $networks = ['Facebook', 'Twitter', 'Pinterest'

replace with

protected static $networks = ['Facebook', 'Twitter', 'Pinterest', 'Whatsapp'

find

&& Configuration::updateValue('PS_SC_PINTEREST', 1)

add the following line after it

&& Configuration::updateValue('PS_SC_WHATSAPP', 1)

find

        if (Configuration::get('PS_SC_PINTEREST')) {
            $social_share_links['pinterest'] = [
                'label' => $this->trans('Pinterest', [], 'Modules.Sharebuttons.Shop'),
                'class' => 'pinterest',
                'url' => 'https://www.pinterest.com/pin/create/button/?media='.$sharing_img.'&url='.$sharing_url,
            ];
        }

and add the following code after it

        if (Configuration::get('PS_SC_WHATSAPP')) {
            $social_share_links['whatsapp'] = [
                'label' => $this->trans('Whatsapp', [], 'Modules.Sharebuttons.Shop'),
                'class' => 'whatsapp',
                'url' => 'https://web.whatsapp.com/send?l=en&text='.$sharing_url,

            ];
        }

 

Or you just download the following file for the whatsapp share button:

ps_sharebuttons.php

Edited by Afriluka
Forgot to add tags and the file (see edit history)

Share this post


Link to post
Share on other sites
Posted (edited)

I forgot to mention how to change the share button icon:

Well that depends on your theme and is the harder part. In the classic theme for example you have to modify the following file:

/prestashop/themes/classic/assets/css/theme.css

There, for example you can find the css rules for the pinterest icon:

.pinterest {
 background-image:url(../css/afb2ed6d67613a724a420a39b4fe5b0d.svg);
}
.pinterest:before {
 content:"";
 background-image:url(../css/b1db819132e64a3e01911a1413c33acf.svg);
}
.pinterest.icon-gray {
 background-image:url(../css/99db8adec61e4fcf5586e1afa549b432.svg);
}
.pinterest.icon-gray:hover {
 background-image:url(../css/b1db819132e64a3e01911a1413c33acf.svg);
}

You just need to copy them and adjust them for your new whatsapp icon.

Edited by Afriluka (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More