Component

Module

Whatsapp Default Message

Set Whatsapp phone number and default message

Directory

File Folder Link
default.css \\SYNAS\Allan\DOCUMENTATION\Component\Whatsapp Default Message\rckuc\wolf\public\themes\rckuc\css
home-page  in backend 'Layouts' tab

 

Step 1

Insert SQL Record into wolf_module_setting:

INSERT INTO `wolf_module_setting` (`id`, `module`, `name`, `value_type`, `value`, `created_on`, `updated_on`, `created_by_id`, `updated_by_id`) VALUES (NULL, 'page', 'Whatsapp Phone Number', 'input', '+60123456789', NOW(), NULL, NULL, NULL), (NULL, 'page', 'Whatsapp Default Message', 'input', 'Hi Rotary', NOW(), NULL, NULL, NULL);
INSERT INTO `wolf_module_setting` (`id`, `module`, `name`, `value_type`, `value`, `created_on`, `updated_on`, `created_by_id`, `updated_by_id`) 
VALUES 
(NULL, 'page', 'Whatsapp Phone Number', 'input', '+60123456789', NOW(), NULL, NULL, NULL),
(NULL, 'page', 'Whatsapp Default Message', 'input', 'Hi Rotary', NOW(), NULL, NULL, NULL);

Step 2

Update: default.css

#whatsapp { position: fixed; right: 100px; bottom: 15px; width: 60px; height: 60px; background-image: url(themes/icon-whatsapp.png); background-repeat: no-repeat; background-size: cover; box-shadow: 2px 2px 10px rgb(0 0 0 / 20%); border-radius: 50px; z-index: 999; text-decoration: none; }
#whatsapp {
    position: fixed;
    right: 100px;
    bottom: 15px;
    width: 60px;
    height: 60px;
    background-image: url(themes/icon-whatsapp.png);
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 2px 2px 10px rgb(0 0 0 / 20%);
    border-radius: 50px;
    z-index: 999;
    text-decoration: none;
}

Step 3

Update: Layouts > home-page

<?php $ws_phone = ModuleSetting::findSetting('page', 'Whatsapp Phone Number') ?: null; $ws_msg = ModuleSetting::findSetting('page', 'Whatsapp Default Message') ?: null; ?> <a id="whatsapp" href="http://api.whatsapp.com/send/?phone=<?php echo $ws_phone;?>&text=<?php echo $ws_msg;?>" target="_blank"></a>
<?php 
    $ws_phone = ModuleSetting::findSetting('page', 'Whatsapp Phone Number') ?: null;
    $ws_msg = ModuleSetting::findSetting('page', 'Whatsapp Default Message') ?: null;
?>

<a id="whatsapp" href="http://api.whatsapp.com/send/?phone=<?php echo $ws_phone;?>&text=<?php echo $ws_msg;?>" target="_blank"></a>
Code Copied To Clipboard!