Version Description
- Enchantment: click to chat admin page for WooCommerce
Download this release
Release Info
Developer | bhvreddy |
Plugin | Click to Chat for WhatsApp Chat |
Version | 3.9.6 |
Comparing to | |
See all releases |
Code changes from version 3.9.5 to 3.9.6
- click-to-chat.php +2 -2
- new/admin/admin_assets/css/admin.css +43 -6
- new/admin/admin_assets/js/admin.js +63 -40
- new/admin/admin_assets/js/greetings.js +21 -15
- new/admin/admin_commons/class-ht-ctc-admin-hooks.php +8 -0
- new/admin/class-ht-ctc-admin-customize-styles.php +1 -1
- new/admin/class-ht-ctc-admin-greetings-page.php +1 -1
- new/admin/class-ht-ctc-admin-group-page.php +1 -1
- new/admin/class-ht-ctc-admin-main-page.php +3 -3
- new/admin/class-ht-ctc-admin-other-settings.php +1 -1
- new/admin/class-ht-ctc-admin-scripts.php +6 -4
- new/inc/greetings/class-ht-ctc-chat-greetings.php +10 -8
- new/tools/woo/class-ht-ctc-woo.php +0 -63
- new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php +362 -279
- readme.txt +25 -21
click-to-chat.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Click to Chat
|
4 |
Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
|
5 |
Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
|
6 |
-
Version: 3.9.
|
7 |
Author: HoliThemes
|
8 |
Author URI: https://holithemes.com/plugins/click-to-chat/
|
9 |
License: GPL2
|
@@ -17,7 +17,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
17 |
|
18 |
// ctc - Version - update version at readme 'Stable tag'
|
19 |
if ( ! defined( 'HT_CTC_VERSION' ) ) {
|
20 |
-
define( 'HT_CTC_VERSION', '3.9.
|
21 |
}
|
22 |
|
23 |
// define HT_CTC_PLUGIN_FILE
|
3 |
Plugin Name: Click to Chat
|
4 |
Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
|
5 |
Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
|
6 |
+
Version: 3.9.6
|
7 |
Author: HoliThemes
|
8 |
Author URI: https://holithemes.com/plugins/click-to-chat/
|
9 |
License: GPL2
|
17 |
|
18 |
// ctc - Version - update version at readme 'Stable tag'
|
19 |
if ( ! defined( 'HT_CTC_VERSION' ) ) {
|
20 |
+
define( 'HT_CTC_VERSION', '3.9.6' );
|
21 |
}
|
22 |
|
23 |
// define HT_CTC_PLUGIN_FILE
|
new/admin/admin_assets/css/admin.css
CHANGED
@@ -1,9 +1,3 @@
|
|
1 |
-
/* Admin CSS */
|
2 |
-
|
3 |
-
/**
|
4 |
-
* ctc_init_display_none - hide initially, if need display later based on settings
|
5 |
-
*/
|
6 |
-
|
7 |
/* md related */
|
8 |
.collapsible .dropdown-content li {
|
9 |
background-color: #ffffff;
|
@@ -13,6 +7,15 @@
|
|
13 |
scroll-behavior: smooth;
|
14 |
}
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
.ht_ctc_show_hide_settings :checked ~ .dashicons-visibility,
|
17 |
.ht_ctc_show_hide_settings :checked ~ span .dashicons-visibility,
|
18 |
.ht_ctc_show_hide_settings .show_settings .dashicons-visibility {
|
@@ -76,6 +79,40 @@
|
|
76 |
margin: 5px 0;
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
@media only screen and (min-width: 1201px) {
|
81 |
.sticky-sidebar {
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/* md related */
|
2 |
.collapsible .dropdown-content li {
|
3 |
background-color: #ffffff;
|
7 |
scroll-behavior: smooth;
|
8 |
}
|
9 |
|
10 |
+
/* commons classes styles */
|
11 |
+
.margin_top_30 {
|
12 |
+
margin-top: 30px;
|
13 |
+
}
|
14 |
+
|
15 |
+
.margin_bottom_15 {
|
16 |
+
margin-bottom: 15px;
|
17 |
+
}
|
18 |
+
|
19 |
.ht_ctc_show_hide_settings :checked ~ .dashicons-visibility,
|
20 |
.ht_ctc_show_hide_settings :checked ~ span .dashicons-visibility,
|
21 |
.ht_ctc_show_hide_settings .show_settings .dashicons-visibility {
|
79 |
margin: 5px 0;
|
80 |
}
|
81 |
|
82 |
+
/* tabs */
|
83 |
+
.ctc_md_tab {
|
84 |
+
border-right: 1px solid #ddd;
|
85 |
+
border-bottom: 1px solid #ddd;
|
86 |
+
border-left: 1px solid #ddd;
|
87 |
+
box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 3px 1px -2px rgb(0 0 0 / 12%), 0 1px 5px 0 rgb(0 0 0 / 20%);
|
88 |
+
padding: 25px;
|
89 |
+
}
|
90 |
+
.tab a {
|
91 |
+
color: #000 !important;
|
92 |
+
}
|
93 |
+
.tab a.active {
|
94 |
+
color: #000 !important;
|
95 |
+
}
|
96 |
+
.tabs .indicator {
|
97 |
+
background-color: #4f94d4 !important;
|
98 |
+
}
|
99 |
+
.tabs a:focus {
|
100 |
+
box-shadow: none;
|
101 |
+
}
|
102 |
+
|
103 |
+
.tabs .tab a:focus,
|
104 |
+
.tabs .tab a:focus.active {
|
105 |
+
background-color: #ffffff !important;
|
106 |
+
}
|
107 |
+
|
108 |
+
.tabs.tabs-fixed-width {
|
109 |
+
background-color: #ffffff !important;
|
110 |
+
}
|
111 |
+
|
112 |
+
.md_tab {
|
113 |
+
scroll-margin-top: 100px;
|
114 |
+
}
|
115 |
+
|
116 |
|
117 |
@media only screen and (min-width: 1201px) {
|
118 |
.sticky-sidebar {
|
new/admin/admin_assets/js/admin.js
CHANGED
@@ -1,23 +1,16 @@
|
|
1 |
// Click to Chat
|
2 |
document.addEventListener('DOMContentLoaded', function () {
|
3 |
-
|
4 |
try {
|
5 |
-
// M.AutoInit();
|
6 |
-
|
7 |
var elems = document.querySelectorAll('select');
|
8 |
M.FormSelect.init(elems, {});
|
9 |
-
|
10 |
var elems = document.querySelectorAll('.collapsible');
|
11 |
M.Collapsible.init(elems, {});
|
12 |
-
|
13 |
var elems = document.querySelectorAll('.modal');
|
14 |
M.Modal.init(elems, {});
|
15 |
-
|
16 |
var elems = document.querySelectorAll('.tooltipped');
|
17 |
M.Tooltip.init(elems, {});
|
18 |
} catch (e) { }
|
19 |
-
|
20 |
-
|
21 |
});
|
22 |
|
23 |
(function ($) {
|
@@ -25,6 +18,31 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
25 |
// ready
|
26 |
$(function () {
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
try {
|
29 |
$('select').formSelect();
|
30 |
$('.collapsible').collapsible();
|
@@ -32,6 +50,41 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
32 |
$('.tooltipped').tooltip();
|
33 |
} catch (e) { }
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
var color_picker = {
|
36 |
palettes: [
|
37 |
'#000000',
|
@@ -44,10 +97,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
44 |
'#ECE5DD',
|
45 |
],
|
46 |
}
|
47 |
-
|
48 |
$('.ht-ctc-color').wpColorPicker(color_picker);
|
49 |
|
50 |
-
|
51 |
// functions
|
52 |
show_hide_options();
|
53 |
styles();
|
@@ -64,6 +115,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
64 |
collapsible();
|
65 |
} catch (e) { }
|
66 |
|
|
|
67 |
try {
|
68 |
$(".ctc_sortable").sortable({
|
69 |
cursor: "move"
|
@@ -142,14 +194,11 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
142 |
}
|
143 |
|
144 |
$(".s1_add_icon").on("change", function (e) {
|
145 |
-
console.log('change');
|
146 |
-
|
147 |
if ($('.s1_add_icon').is(':checked')) {
|
148 |
$(".s1_icon_settings").show(200);
|
149 |
} else {
|
150 |
$(".s1_icon_settings").hide(200);
|
151 |
}
|
152 |
-
|
153 |
});
|
154 |
|
155 |
}
|
@@ -474,33 +523,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
474 |
// collapsible..
|
475 |
function collapsible() {
|
476 |
|
477 |
-
|
478 |
-
|
479 |
-
if (localStorage.getItem('ht_ctc_admin')) {
|
480 |
-
ht_ctc_admin = localStorage.getItem('ht_ctc_admin');
|
481 |
-
ht_ctc_admin = JSON.parse(ht_ctc_admin);
|
482 |
-
}
|
483 |
-
// else {
|
484 |
-
// ht_ctc_admin = demo;
|
485 |
-
// demo = JSON.stringify(demo);
|
486 |
-
// localStorage.setItem('ht_ctc_admin', demo);
|
487 |
-
// }
|
488 |
-
|
489 |
-
// get items from ht_ctc_admin
|
490 |
-
function ctc_getItem(item) {
|
491 |
-
if (ht_ctc_admin[item]) {
|
492 |
-
return ht_ctc_admin[item];
|
493 |
-
} else {
|
494 |
-
return false;
|
495 |
-
}
|
496 |
-
}
|
497 |
-
|
498 |
-
// set items to ht_ctc_admin storage
|
499 |
-
function ctc_setItem(name, value) {
|
500 |
-
ht_ctc_admin[name] = value;
|
501 |
-
var newValues = JSON.stringify(ht_ctc_admin);
|
502 |
-
localStorage.setItem('ht_ctc_admin', newValues);
|
503 |
-
}
|
504 |
|
505 |
/**
|
506 |
* ht_ctc_sidebar_contat - not added, as it may cause view distraction..
|
1 |
// Click to Chat
|
2 |
document.addEventListener('DOMContentLoaded', function () {
|
3 |
+
// md
|
4 |
try {
|
|
|
|
|
5 |
var elems = document.querySelectorAll('select');
|
6 |
M.FormSelect.init(elems, {});
|
|
|
7 |
var elems = document.querySelectorAll('.collapsible');
|
8 |
M.Collapsible.init(elems, {});
|
|
|
9 |
var elems = document.querySelectorAll('.modal');
|
10 |
M.Modal.init(elems, {});
|
|
|
11 |
var elems = document.querySelectorAll('.tooltipped');
|
12 |
M.Tooltip.init(elems, {});
|
13 |
} catch (e) { }
|
|
|
|
|
14 |
});
|
15 |
|
16 |
(function ($) {
|
18 |
// ready
|
19 |
$(function () {
|
20 |
|
21 |
+
// local storage
|
22 |
+
var ht_ctc_admin = {};
|
23 |
+
|
24 |
+
if (localStorage.getItem('ht_ctc_admin')) {
|
25 |
+
ht_ctc_admin = localStorage.getItem('ht_ctc_admin');
|
26 |
+
ht_ctc_admin = JSON.parse(ht_ctc_admin);
|
27 |
+
}
|
28 |
+
|
29 |
+
// get items from ht_ctc_admin
|
30 |
+
function ctc_getItem(item) {
|
31 |
+
if (ht_ctc_admin[item]) {
|
32 |
+
return ht_ctc_admin[item];
|
33 |
+
} else {
|
34 |
+
return false;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
// set items to ht_ctc_admin storage
|
39 |
+
function ctc_setItem(name, value) {
|
40 |
+
ht_ctc_admin[name] = value;
|
41 |
+
var newValues = JSON.stringify(ht_ctc_admin);
|
42 |
+
localStorage.setItem('ht_ctc_admin', newValues);
|
43 |
+
}
|
44 |
+
|
45 |
+
// md
|
46 |
try {
|
47 |
$('select').formSelect();
|
48 |
$('.collapsible').collapsible();
|
50 |
$('.tooltipped').tooltip();
|
51 |
} catch (e) { }
|
52 |
|
53 |
+
// md tabs
|
54 |
+
try {
|
55 |
+
|
56 |
+
$(document).on('click', '.open_tab', function () {
|
57 |
+
var tab = $(this).attr('data-tab');
|
58 |
+
$('.tabs').tabs('select', tab);
|
59 |
+
ctc_setItem('woo_tab', '#' + tab);
|
60 |
+
});
|
61 |
+
|
62 |
+
$(document).on('click', '.md_tab_li', function () {
|
63 |
+
var href = $(this).children('a').attr('href');
|
64 |
+
window.location.hash = href;
|
65 |
+
ctc_setItem('woo_tab', href);
|
66 |
+
});
|
67 |
+
|
68 |
+
$(".tabs").tabs();
|
69 |
+
|
70 |
+
// only on woo page..
|
71 |
+
if ( document.querySelector('.ctc-admin-woo-page') && ctc_getItem('woo_tab') ) {
|
72 |
+
|
73 |
+
var woo_tab = ctc_getItem('woo_tab');
|
74 |
+
|
75 |
+
// setTimeout(() => {
|
76 |
+
// $(".tabs").tabs('select', woo_tab);
|
77 |
+
// }, 2500);
|
78 |
+
|
79 |
+
woo_tab = woo_tab.replace('#', '');
|
80 |
+
setTimeout(() => {
|
81 |
+
$("[data-tab=" + woo_tab + "]").trigger('click');
|
82 |
+
}, 1200);
|
83 |
+
}
|
84 |
+
|
85 |
+
} catch (e) { }
|
86 |
+
|
87 |
+
// wpColorPicker
|
88 |
var color_picker = {
|
89 |
palettes: [
|
90 |
'#000000',
|
97 |
'#ECE5DD',
|
98 |
],
|
99 |
}
|
|
|
100 |
$('.ht-ctc-color').wpColorPicker(color_picker);
|
101 |
|
|
|
102 |
// functions
|
103 |
show_hide_options();
|
104 |
styles();
|
115 |
collapsible();
|
116 |
} catch (e) { }
|
117 |
|
118 |
+
// jquery ui
|
119 |
try {
|
120 |
$(".ctc_sortable").sortable({
|
121 |
cursor: "move"
|
194 |
}
|
195 |
|
196 |
$(".s1_add_icon").on("change", function (e) {
|
|
|
|
|
197 |
if ($('.s1_add_icon').is(':checked')) {
|
198 |
$(".s1_icon_settings").show(200);
|
199 |
} else {
|
200 |
$(".s1_icon_settings").hide(200);
|
201 |
}
|
|
|
202 |
});
|
203 |
|
204 |
}
|
523 |
// collapsible..
|
524 |
function collapsible() {
|
525 |
|
526 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
|
528 |
/**
|
529 |
* ht_ctc_sidebar_contat - not added, as it may cause view distraction..
|
new/admin/admin_assets/js/greetings.js
CHANGED
@@ -4,13 +4,20 @@
|
|
4 |
$(function () {
|
5 |
|
6 |
try {
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
} catch (e) { }
|
9 |
|
10 |
/**
|
11 |
-
* Greetings
|
12 |
*/
|
13 |
-
function
|
14 |
|
15 |
|
16 |
var greetings_template = $('.pr_greetings_template select').find(":selected").val();
|
@@ -64,25 +71,25 @@
|
|
64 |
}
|
65 |
});
|
66 |
|
|
|
|
|
67 |
|
|
|
68 |
// tinymce editor - bg color
|
69 |
var check = 1;
|
70 |
var check_interval = 1000;
|
71 |
var check_times = 28; // ( check_times * check_interval = total milliseconds )
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
setTimeout(tiny_bg, check_interval);
|
82 |
-
}
|
83 |
}
|
84 |
}
|
85 |
-
tiny_bg();
|
86 |
|
87 |
function tiny_bg_color() {
|
88 |
// f0f0f1
|
@@ -98,7 +105,6 @@
|
|
98 |
var elmnt = bottom_content_ifr.contentWindow.document.getElementsByTagName("body")[0];
|
99 |
elmnt.style.backgroundColor = "#26a69a";
|
100 |
}
|
101 |
-
|
102 |
}
|
103 |
|
104 |
|
4 |
$(function () {
|
5 |
|
6 |
try {
|
7 |
+
if (document.querySelector('.pr_greetings_template')) {
|
8 |
+
greetings_template();
|
9 |
+
}
|
10 |
+
|
11 |
+
// todo..
|
12 |
+
if (document.querySelector('.pr_greetings_template')) {
|
13 |
+
editor();
|
14 |
+
}
|
15 |
} catch (e) { }
|
16 |
|
17 |
/**
|
18 |
+
* display settings based on Greetings template selection
|
19 |
*/
|
20 |
+
function greetings_template() {
|
21 |
|
22 |
|
23 |
var greetings_template = $('.pr_greetings_template select').find(":selected").val();
|
71 |
}
|
72 |
});
|
73 |
|
74 |
+
}
|
75 |
+
|
76 |
|
77 |
+
function editor() {
|
78 |
// tinymce editor - bg color
|
79 |
var check = 1;
|
80 |
var check_interval = 1000;
|
81 |
var check_times = 28; // ( check_times * check_interval = total milliseconds )
|
82 |
|
83 |
+
if (document.getElementById("header_content_ifr")) {
|
84 |
+
try {
|
85 |
+
tiny_bg_color();
|
86 |
+
} catch (e) { }
|
87 |
+
} else {
|
88 |
+
check++;
|
89 |
+
if (check < check_times) {
|
90 |
+
setTimeout(tiny_bg, check_interval);
|
|
|
|
|
91 |
}
|
92 |
}
|
|
|
93 |
|
94 |
function tiny_bg_color() {
|
95 |
// f0f0f1
|
105 |
var elmnt = bottom_content_ifr.contentWindow.document.getElementsByTagName("body")[0];
|
106 |
elmnt.style.backgroundColor = "#26a69a";
|
107 |
}
|
|
|
108 |
}
|
109 |
|
110 |
|
new/admin/admin_commons/class-ht-ctc-admin-hooks.php
CHANGED
@@ -36,6 +36,7 @@ class HT_CTC_Admin_Others {
|
|
36 |
add_action( 'load-click-to-chat_page_click-to-chat-woocommerce', array( $this, 'ctc_admin_pages') );
|
37 |
|
38 |
add_action( 'ht_ctc_ah_admin_scripts_start', [$this, 'dequeue'] );
|
|
|
39 |
|
40 |
// admin notices
|
41 |
$this->admin_notice();
|
@@ -330,6 +331,13 @@ class HT_CTC_Admin_Others {
|
|
330 |
}
|
331 |
}
|
332 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
// dequeue scripts to avioid conflicts..
|
334 |
function dequeue_scripts() {
|
335 |
|
36 |
add_action( 'load-click-to-chat_page_click-to-chat-woocommerce', array( $this, 'ctc_admin_pages') );
|
37 |
|
38 |
add_action( 'ht_ctc_ah_admin_scripts_start', [$this, 'dequeue'] );
|
39 |
+
add_action( 'ht_ctc_ah_admin_scripts_start_woo_page', [$this, 'woo_dequeue'] );
|
40 |
|
41 |
// admin notices
|
42 |
$this->admin_notice();
|
331 |
}
|
332 |
}
|
333 |
|
334 |
+
/**
|
335 |
+
* runs on click to chat - woo admin page
|
336 |
+
*/
|
337 |
+
function woo_dequeue() {
|
338 |
+
add_action( 'wp_print_scripts', [$this, 'dequeue_scripts'] );
|
339 |
+
}
|
340 |
+
|
341 |
// dequeue scripts to avioid conflicts..
|
342 |
function dequeue_scripts() {
|
343 |
|
new/admin/class-ht-ctc-admin-customize-styles.php
CHANGED
@@ -38,7 +38,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
38 |
|
39 |
?>
|
40 |
|
41 |
-
<div class="wrap">
|
42 |
|
43 |
<?php settings_errors(); ?>
|
44 |
|
38 |
|
39 |
?>
|
40 |
|
41 |
+
<div class="wrap ctc-admin-customize-styles">
|
42 |
|
43 |
<?php settings_errors(); ?>
|
44 |
|
new/admin/class-ht-ctc-admin-greetings-page.php
CHANGED
@@ -350,7 +350,7 @@ class HT_CTC_Admin_Greetings {
|
|
350 |
|
351 |
?>
|
352 |
|
353 |
-
<div class="wrap">
|
354 |
|
355 |
<?php settings_errors(); ?>
|
356 |
|
350 |
|
351 |
?>
|
352 |
|
353 |
+
<div class="wrap ctc-admin-greetings-page">
|
354 |
|
355 |
<?php settings_errors(); ?>
|
356 |
|
new/admin/class-ht-ctc-admin-group-page.php
CHANGED
@@ -35,7 +35,7 @@ class HT_CTC_Admin_Group_Page {
|
|
35 |
|
36 |
?>
|
37 |
|
38 |
-
<div class="wrap">
|
39 |
|
40 |
<?php settings_errors(); ?>
|
41 |
|
35 |
|
36 |
?>
|
37 |
|
38 |
+
<div class="wrap ctc-admin-group-page">
|
39 |
|
40 |
<?php settings_errors(); ?>
|
41 |
|
new/admin/class-ht-ctc-admin-main-page.php
CHANGED
@@ -39,7 +39,7 @@ class HT_CTC_Admin_Main_Page {
|
|
39 |
|
40 |
?>
|
41 |
|
42 |
-
<div class="wrap">
|
43 |
|
44 |
<?php settings_errors(); ?>
|
45 |
|
@@ -185,11 +185,11 @@ class HT_CTC_Admin_Main_Page {
|
|
185 |
$options = get_option('ht_ctc_chat_options');
|
186 |
$value = ( isset( $options['pre_filled']) ) ? esc_attr( $options['pre_filled'] ) : '';
|
187 |
$blogname = HT_CTC_BLOG_NAME;
|
188 |
-
$placeholder = "Hello
|
189 |
?>
|
190 |
<div class="row">
|
191 |
<div class="input-field col s12">
|
192 |
-
<textarea style="min-height:
|
193 |
<label for="pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
194 |
<p class="description"><?php _e( "Text that pre-filled in WhatsApp Chat window. Add variables {site}, {url}, {title} to replace with site name, current webpage URL, Post title", 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pre-filled-message/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
195 |
</div>
|
39 |
|
40 |
?>
|
41 |
|
42 |
+
<div class="wrap ctc-admin-main-page">
|
43 |
|
44 |
<?php settings_errors(); ?>
|
45 |
|
185 |
$options = get_option('ht_ctc_chat_options');
|
186 |
$value = ( isset( $options['pre_filled']) ) ? esc_attr( $options['pre_filled'] ) : '';
|
187 |
$blogname = HT_CTC_BLOG_NAME;
|
188 |
+
$placeholder = "Hello {site} \nLike to know more information about {title}, {url}";
|
189 |
?>
|
190 |
<div class="row">
|
191 |
<div class="input-field col s12">
|
192 |
+
<textarea style="min-height: 64px;" placeholder="<?= $placeholder ?>" name="ht_ctc_chat_options[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?= $value ?></textarea>
|
193 |
<label for="pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
194 |
<p class="description"><?php _e( "Text that pre-filled in WhatsApp Chat window. Add variables {site}, {url}, {title} to replace with site name, current webpage URL, Post title", 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pre-filled-message/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
195 |
</div>
|
new/admin/class-ht-ctc-admin-other-settings.php
CHANGED
@@ -48,7 +48,7 @@ class HT_CTC_Admin_Other_Settings {
|
|
48 |
|
49 |
?>
|
50 |
|
51 |
-
<div class="wrap">
|
52 |
|
53 |
<?php settings_errors(); ?>
|
54 |
|
48 |
|
49 |
?>
|
50 |
|
51 |
+
<div class="wrap ctc-admin-other-settings">
|
52 |
|
53 |
<?php settings_errors(); ?>
|
54 |
|
new/admin/class-ht-ctc-admin-scripts.php
CHANGED
@@ -30,16 +30,18 @@ class HT_CTC_Admin_Scripts {
|
|
30 |
|
31 |
do_action('ht_ctc_ah_admin_scripts_start');
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
wp_enqueue_style( 'wp-color-picker' );
|
34 |
wp_enqueue_style('ctc_admin_md_css', plugins_url( 'new/admin/admin_assets/css/materialize.min.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
35 |
wp_enqueue_style('ctc_admin_css', plugins_url( 'new/admin/admin_assets/css/admin.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
36 |
|
37 |
wp_enqueue_script( 'ctc_admin_md_js', plugins_url( 'new/admin/admin_assets/js/materialize.min.js', HT_CTC_PLUGIN_FILE ), array( 'jquery' ), HT_CTC_VERSION, $load_js_bottom );
|
38 |
wp_enqueue_script( 'ctc_admin_js', plugins_url( "new/admin/admin_assets/js/$admin_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'wp-color-picker', 'ctc_admin_md_js' ), HT_CTC_VERSION, $load_js_bottom );
|
39 |
-
|
40 |
-
if ('click-to-chat_page_click-to-chat-greetings' == $hook) {
|
41 |
-
wp_enqueue_script( 'ctc_admin_greetings_js', plugins_url( "new/admin/admin_assets/js/$greetings_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'ctc_admin_js' ), HT_CTC_VERSION, $load_js_bottom );
|
42 |
-
}
|
43 |
|
44 |
do_action('ht_ctc_ah_admin_scripts_end');
|
45 |
|
30 |
|
31 |
do_action('ht_ctc_ah_admin_scripts_start');
|
32 |
|
33 |
+
// default dequeue in ctc woo admin page
|
34 |
+
if ( 'click-to-chat_page_click-to-chat-woocommerce' == $hook ) {
|
35 |
+
do_action('ht_ctc_ah_admin_scripts_start_woo_page');
|
36 |
+
}
|
37 |
+
|
38 |
wp_enqueue_style( 'wp-color-picker' );
|
39 |
wp_enqueue_style('ctc_admin_md_css', plugins_url( 'new/admin/admin_assets/css/materialize.min.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
40 |
wp_enqueue_style('ctc_admin_css', plugins_url( 'new/admin/admin_assets/css/admin.css', HT_CTC_PLUGIN_FILE ) , '', HT_CTC_VERSION );
|
41 |
|
42 |
wp_enqueue_script( 'ctc_admin_md_js', plugins_url( 'new/admin/admin_assets/js/materialize.min.js', HT_CTC_PLUGIN_FILE ), array( 'jquery' ), HT_CTC_VERSION, $load_js_bottom );
|
43 |
wp_enqueue_script( 'ctc_admin_js', plugins_url( "new/admin/admin_assets/js/$admin_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'wp-color-picker', 'ctc_admin_md_js' ), HT_CTC_VERSION, $load_js_bottom );
|
44 |
+
wp_enqueue_script( 'ctc_admin_greetings_js', plugins_url( "new/admin/admin_assets/js/$greetings_js", HT_CTC_PLUGIN_FILE ), array( 'jquery', 'ctc_admin_js' ), HT_CTC_VERSION, $load_js_bottom );
|
|
|
|
|
|
|
45 |
|
46 |
do_action('ht_ctc_ah_admin_scripts_end');
|
47 |
|
new/inc/greetings/class-ht-ctc-chat-greetings.php
CHANGED
@@ -129,6 +129,16 @@ class HT_CTC_Chat_Greetings {
|
|
129 |
// 'picture-in-picture' => true,
|
130 |
// );
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
if ( '' !== $ht_ctc_greetings['header_content'] ) {
|
133 |
$ht_ctc_greetings['header_content'] = html_entity_decode(wp_kses($ht_ctc_greetings['header_content'], $allowed_html) );
|
134 |
$ht_ctc_greetings['header_content'] = str_replace( array('{url}', '{title}', '{site}' ), array( $page_url, $post_title, HT_CTC_BLOG_NAME ), $ht_ctc_greetings['header_content'] );
|
@@ -142,14 +152,6 @@ class HT_CTC_Chat_Greetings {
|
|
142 |
$ht_ctc_greetings['bottom_content'] = str_replace( array('{url}', '{title}', '{site}' ), array( $page_url, $post_title, HT_CTC_BLOG_NAME ), $ht_ctc_greetings['bottom_content'] );
|
143 |
}
|
144 |
|
145 |
-
// greetings dialog position based on chat icon/button position
|
146 |
-
$g_position_r_l = ( isset( $chat['side_2']) ) ? esc_attr( $chat['side_2'] ) : 'right';
|
147 |
-
|
148 |
-
$ht_ctc_greetings['path'] = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/greetings/' . $ht_ctc_greetings['greetings_template']. '.php';
|
149 |
-
|
150 |
-
// filter hook to update values...
|
151 |
-
$ht_ctc_greetings = apply_filters( 'ht_ctc_fh_greetings', $ht_ctc_greetings );
|
152 |
-
|
153 |
$box_shadow = '1px 1px 3px 1px rgba(0,0,0,.14)';
|
154 |
if ( 'greetings-2' == $ht_ctc_greetings['greetings_template'] ) {
|
155 |
$box_shadow = '0px 0px 5px 1px rgba(0,0,0,.14)';
|
129 |
// 'picture-in-picture' => true,
|
130 |
// );
|
131 |
|
132 |
+
|
133 |
+
|
134 |
+
// greetings dialog position based on chat icon/button position
|
135 |
+
$g_position_r_l = ( isset( $chat['side_2']) ) ? esc_attr( $chat['side_2'] ) : 'right';
|
136 |
+
|
137 |
+
$ht_ctc_greetings['path'] = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/greetings/' . $ht_ctc_greetings['greetings_template']. '.php';
|
138 |
+
|
139 |
+
// filter hook to update values...
|
140 |
+
$ht_ctc_greetings = apply_filters( 'ht_ctc_fh_greetings', $ht_ctc_greetings );
|
141 |
+
|
142 |
if ( '' !== $ht_ctc_greetings['header_content'] ) {
|
143 |
$ht_ctc_greetings['header_content'] = html_entity_decode(wp_kses($ht_ctc_greetings['header_content'], $allowed_html) );
|
144 |
$ht_ctc_greetings['header_content'] = str_replace( array('{url}', '{title}', '{site}' ), array( $page_url, $post_title, HT_CTC_BLOG_NAME ), $ht_ctc_greetings['header_content'] );
|
152 |
$ht_ctc_greetings['bottom_content'] = str_replace( array('{url}', '{title}', '{site}' ), array( $page_url, $post_title, HT_CTC_BLOG_NAME ), $ht_ctc_greetings['bottom_content'] );
|
153 |
}
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
$box_shadow = '1px 1px 3px 1px rgba(0,0,0,.14)';
|
156 |
if ( 'greetings-2' == $ht_ctc_greetings['greetings_template'] ) {
|
157 |
$box_shadow = '0px 0px 5px 1px rgba(0,0,0,.14)';
|
new/tools/woo/class-ht-ctc-woo.php
CHANGED
@@ -23,7 +23,6 @@ class HT_CTC_WOO_Pages {
|
|
23 |
|
24 |
// chat - woo values
|
25 |
add_filter( 'ht_ctc_fh_chat', array($this, 'chat') );
|
26 |
-
add_filter( 'ht_ctc_fh_greetings', array($this, 'greetings') );
|
27 |
|
28 |
// woo places
|
29 |
$woo_position = ( isset( $woo['woo_position']) ) ? esc_attr( $woo['woo_position'] ) : 'select';
|
@@ -353,68 +352,6 @@ class HT_CTC_WOO_Pages {
|
|
353 |
}
|
354 |
|
355 |
|
356 |
-
|
357 |
-
|
358 |
-
function greetings( $ht_ctc_greetings ) {
|
359 |
-
|
360 |
-
$woo_greetings_options = get_option('ht_ctc_woo_greetings_options');
|
361 |
-
|
362 |
-
// if woocommerce single product page
|
363 |
-
if ( function_exists( 'is_product' ) && function_exists( 'wc_get_product' )) {
|
364 |
-
if ( is_product() ) {
|
365 |
-
|
366 |
-
$name = '';
|
367 |
-
$price = '';
|
368 |
-
$regular_price = '';
|
369 |
-
$sku = '';
|
370 |
-
|
371 |
-
$product = wc_get_product();
|
372 |
-
|
373 |
-
if ( is_object($product) && method_exists($product, 'get_name') ) {
|
374 |
-
$name = $product->get_name();
|
375 |
-
// $title = $product->get_title();
|
376 |
-
$price = $product->get_price();
|
377 |
-
$regular_price = $product->get_regular_price();
|
378 |
-
$sku = $product->get_sku();
|
379 |
-
}
|
380 |
-
|
381 |
-
$page_id = get_the_ID();
|
382 |
-
$ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
|
383 |
-
|
384 |
-
|
385 |
-
// header_content
|
386 |
-
if ( isset( $woo_greetings_options['header_content'] ) && '' !== $woo_greetings_options['header_content'] ) {
|
387 |
-
$ht_ctc_greetings['header_content'] = esc_attr( $woo_greetings_options['header_content'] );
|
388 |
-
$ht_ctc_greetings['header_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['header_content'], 'Click to Chat for WhatsApp', 'woo_header_content' );
|
389 |
-
}
|
390 |
-
|
391 |
-
// header_content
|
392 |
-
if ( isset( $woo_greetings_options['main_content'] ) && '' !== $woo_greetings_options['main_content'] ) {
|
393 |
-
$ht_ctc_greetings['main_content'] = esc_attr( $woo_greetings_options['main_content'] );
|
394 |
-
$ht_ctc_greetings['main_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['main_content'], 'Click to Chat for WhatsApp', 'woo_main_content' );
|
395 |
-
}
|
396 |
-
|
397 |
-
// header_content
|
398 |
-
if ( isset( $woo_greetings_options['bottom_content'] ) && '' !== $woo_greetings_options['bottom_content'] ) {
|
399 |
-
$ht_ctc_greetings['bottom_content'] = esc_attr( $woo_greetings_options['bottom_content'] );
|
400 |
-
$ht_ctc_greetings['bottom_content'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_greetings['bottom_content'], 'Click to Chat for WhatsApp', 'woo_bottom_content' );
|
401 |
-
}
|
402 |
-
|
403 |
-
// variables works in default pre_filled also for woo pages.
|
404 |
-
$ht_ctc_greetings['header_content'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_greetings['header_content'] );
|
405 |
-
$ht_ctc_greetings['main_content'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_greetings['main_content'] );
|
406 |
-
$ht_ctc_greetings['bottom_content'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_greetings['bottom_content'] );
|
407 |
-
|
408 |
-
}
|
409 |
-
}
|
410 |
-
|
411 |
-
return $ht_ctc_greetings;
|
412 |
-
}
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
|
419 |
|
420 |
}
|
23 |
|
24 |
// chat - woo values
|
25 |
add_filter( 'ht_ctc_fh_chat', array($this, 'chat') );
|
|
|
26 |
|
27 |
// woo places
|
28 |
$woo_position = ( isset( $woo['woo_position']) ) ? esc_attr( $woo['woo_position'] ) : 'select';
|
352 |
}
|
353 |
|
354 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
|
356 |
|
357 |
}
|
new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php
CHANGED
@@ -24,12 +24,6 @@ class HT_CTC_Admin_Woo_Page {
|
|
24 |
|
25 |
public function menu() {
|
26 |
|
27 |
-
// dashicons-format-chat / dashicons-whatsapp
|
28 |
-
$icon = 'dashicons-whatsapp';
|
29 |
-
if( version_compare( get_bloginfo('version'), '5.6', '<') ) {
|
30 |
-
$icon = 'dashicons-format-chat';
|
31 |
-
}
|
32 |
-
|
33 |
add_submenu_page(
|
34 |
'click-to-chat',
|
35 |
'WooCommerce page',
|
@@ -48,14 +42,14 @@ class HT_CTC_Admin_Woo_Page {
|
|
48 |
|
49 |
?>
|
50 |
|
51 |
-
<div class="wrap">
|
52 |
|
53 |
<?php settings_errors(); ?>
|
54 |
|
55 |
<!-- full row -->
|
56 |
<div class="row">
|
57 |
|
58 |
-
<div class="col s12 m12
|
59 |
<form action="options.php" method="post" class="">
|
60 |
<?php settings_fields( 'ht_ctc_woo_page_settings_fields' ); ?>
|
61 |
<?php do_settings_sections( 'ht_ctc_woo_page_settings_sections_do' ) ?>
|
@@ -96,7 +90,13 @@ class HT_CTC_Admin_Woo_Page {
|
|
96 |
|
97 |
public function chat_settings_section_cb() {
|
98 |
?>
|
99 |
-
<h1 id="woo_settings">
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
<br>
|
101 |
<?php
|
102 |
do_action('ht_ctc_ah_admin' );
|
@@ -163,319 +163,391 @@ class HT_CTC_Admin_Woo_Page {
|
|
163 |
$woo_shop_margin_unit = ( isset( $woo_options['woo_shop_margin_unit']) ) ? esc_attr( $woo_options['woo_shop_margin_unit'] ) : 'px';
|
164 |
|
165 |
?>
|
166 |
-
|
167 |
-
<ul class="collapsible ht_ctc_woo_1">
|
168 |
-
<li class="">
|
169 |
-
<div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'Single Product Pages', 'click-to-chat-for-whatsapp' ); ?></div>
|
170 |
-
<div class="collapsible-body">
|
171 |
-
|
172 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/"><?php _e( 'WooCommerce Single Product pages', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
173 |
-
<br>
|
174 |
-
|
175 |
-
<!-- prefilled message -->
|
176 |
-
<div class="row">
|
177 |
-
<div class="input-field col s12">
|
178 |
-
<textarea name="ht_ctc_woo_options[woo_pre_filled]" id="woo_pre_filled" class="materialize-textarea input-margin" style="min-height: 84px;" placeholder="<?= $pf_placeholder ?>"><?= $woo_pre_filled ?></textarea>
|
179 |
-
<label for="woo_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
180 |
-
</div>
|
181 |
-
</div>
|
182 |
|
183 |
-
|
184 |
-
|
185 |
<div class="row">
|
186 |
-
<div class="
|
187 |
-
<
|
188 |
-
|
|
|
|
|
189 |
</div>
|
190 |
-
</div>
|
191 |
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
-
<br><hr style="max-width: 240px;"><br>
|
198 |
-
<p class="description" style="margin-bottom:15px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/add-whatsapp-in-woocommerce-single-product-pages/"><?php _e( 'Add WhatsApp in WooCommerce Single Product pages', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
-
<!-- Add button/icon -->
|
202 |
-
<div class="row">
|
203 |
-
<div class="col s6" style="padding-top: 14px;">
|
204 |
-
<p><?php _e( 'Add WhatsApp', 'click-to-chat-for-whatsapp' ); ?>:</p>
|
205 |
-
</div>
|
206 |
-
<div class="input-field col s6">
|
207 |
-
<select name="<?php echo $dbrow ?>[woo_position]" class="woo_single_position_select">
|
208 |
<?php
|
209 |
-
|
|
|
|
|
210 |
?>
|
211 |
-
|
|
|
212 |
<?php
|
213 |
-
}
|
214 |
-
?>
|
215 |
-
</select>
|
216 |
-
<?php
|
217 |
-
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
218 |
?>
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
?>
|
223 |
-
|
224 |
-
</div>
|
225 |
-
</div>
|
226 |
-
|
227 |
-
<!-- style -->
|
228 |
-
<div class="row ctc_init_display_none woo_single_position_settings">
|
229 |
-
<div class="col s6" style="padding-top: 14px;">
|
230 |
-
<p><?php _e( 'Select Style', 'click-to-chat-for-whatsapp' ); ?></p>
|
231 |
-
</div>
|
232 |
-
<div class="input-field col s6">
|
233 |
-
<select name="<?= $dbrow; ?>[woo_style]" class="woo_single_style_select">
|
234 |
-
<option value="1" <?= $woo_style == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
|
235 |
-
<option value="2" <?= $woo_style == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
|
236 |
-
<option value="3" <?= $woo_style == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
|
237 |
-
<option value="3_1" <?= $woo_style == '3_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
238 |
-
<option value="4" <?= $woo_style == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
|
239 |
-
<option value="5" <?= $woo_style == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
|
240 |
-
<option value="7" <?= $woo_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
|
241 |
-
<option value="7_1" <?= $woo_style == '7_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
242 |
-
<option value="8" <?= $woo_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
243 |
-
<option value="99" <?= $woo_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Add your own image / GIF (Style-99)', 'click-to-chat-for-whatsapp' ); ?></option>
|
244 |
-
</select>
|
245 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=woo"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a>   |   <span><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize the styles</a></span> </p>
|
246 |
-
<p class="description"><strong>Recommended Styles: 1, 8</strong></p>
|
247 |
</div>
|
248 |
-
</div>
|
249 |
|
250 |
-
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
-
|
254 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
<p
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
<span>Displays like 'Add to Cart' button</span>
|
266 |
-
</label>
|
267 |
-
</div>
|
268 |
</div>
|
269 |
</div>
|
270 |
|
271 |
-
<!-- display - center -->
|
272 |
-
<div class="row woo_single_position_settings" style="display: none;">
|
273 |
-
<div class="col s6" style="padding-top: 14px;">
|
274 |
-
<p><?php _e( 'Display Center', 'click-to-chat-for-whatsapp' ); ?></p>
|
275 |
-
</div>
|
276 |
-
<div class="input-field col s6">
|
277 |
-
<label>
|
278 |
-
<input name="<?= $dbrow; ?>[woo_single_position_center]" type="checkbox" value="1" <?php checked( $woo_single_position_center, 1 ); ?> id="woo_single_position_center" />
|
279 |
-
<span><?php _e( 'Display center within available space', 'click-to-chat-for-whatsapp' ); ?></span>
|
280 |
-
</label>
|
281 |
-
</div>
|
282 |
-
</div>
|
283 |
-
|
284 |
-
<!-- display: block, inline-block .. -->
|
285 |
-
<div class="row ctc_init_display_none woo_single_position_settings">
|
286 |
-
<div class="col s6" style="padding-top: 14px;">
|
287 |
-
<p><?php _e( 'Display Block Type', 'click-to-chat-for-whatsapp' ); ?></p>
|
288 |
-
</div>
|
289 |
-
<div class="input-field col s6">
|
290 |
-
<select name="<?= $dbrow; ?>[woo_single_block_type]" class="">
|
291 |
-
<option value="block" <?= $woo_single_block_type == 'block' ? 'SELECTED' : ''; ?> >block</option>
|
292 |
-
<option value="inline" <?= $woo_single_block_type == 'inline' ? 'SELECTED' : ''; ?> >inline</option>
|
293 |
-
<option value="inline-block" <?= $woo_single_block_type == 'inline-block' ? 'SELECTED' : ''; ?> >inline-block</option>
|
294 |
-
</select>
|
295 |
-
<p class="woo_single_position_center_checked_content" style="display: none;">Recommended type: 'block'</p>
|
296 |
-
</div>
|
297 |
-
</div>
|
298 |
-
|
299 |
-
<!-- margin -->
|
300 |
-
<div class="row ctc_init_display_none woo_single_position_settings">
|
301 |
-
<div class="col s6" style="padding-top: 14px;">
|
302 |
-
<p><?php _e( 'Spacing (Margin)', 'click-to-chat-for-whatsapp' ); ?></p>
|
303 |
-
</div>
|
304 |
-
<div class="input-field col s6" style="display: flex; margin-bottom: 1px;">
|
305 |
-
<input name="ht_ctc_woo_options[woo_single_margin_top]" value="<?= $woo_single_margin_top ?>" id="woo_single_margin_top" type="text" style="display:inline; margin-right:4px;" class="input-margin tooltipped" placeholder="Top" data-position="top" data-tooltip="<?php _e( 'Top', 'click-to-chat-for-whatsapp' ); ?>">
|
306 |
-
<input name="ht_ctc_woo_options[woo_single_margin_bottom]" value="<?= $woo_single_margin_bottom ?>" id="woo_single_margin_bottom" type="text" style="display:inline; margin-right:8px;" class="input-margin tooltipped" placeholder="Bottom" data-position="bottom" data-tooltip="<?php _e( 'Bottom', 'click-to-chat-for-whatsapp' ); ?>">
|
307 |
-
<input name="ht_ctc_woo_options[woo_single_margin_left]" value="<?= $woo_single_margin_left ?>" id="woo_single_margin_left" type="text" style="display:inline; margin-right:4px;" class="input-margin tooltipped" placeholder="Left" data-position="left" data-tooltip="<?php _e( 'Left', 'click-to-chat-for-whatsapp' ); ?>">
|
308 |
-
<input name="ht_ctc_woo_options[woo_single_margin_right]" value="<?= $woo_single_margin_right ?>" id="woo_single_margin_right" type="text" style="display:inline;" class="input-margin tooltipped" placeholder="Right" data-position="right" data-tooltip="<?php _e( 'Right', 'click-to-chat-for-whatsapp' ); ?>">
|
309 |
-
</div>
|
310 |
-
<span class="helper-text" style="float:right;">Top, Bottom, Left, Right <span> E.g. 10px, 50%</span> </span>
|
311 |
-
</div>
|
312 |
|
313 |
-
<br>
|
314 |
-
<p class="description ctc_init_display_none woo_single_position_settings" style="margin-bottom:15px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/add-whatsapp-in-woocommerce-single-product-pages/"><?php _e( 'Add WhatsApp in WooCommerce Single Product pages', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
315 |
-
</details>
|
316 |
|
|
|
317 |
|
318 |
|
319 |
-
|
320 |
-
|
321 |
-
</
|
322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
|
331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
<textarea name="ht_ctc_woo_options[woo_shop_pre_filled]" id="woo_shop_pre_filled" class="materialize-textarea input-margin" style="min-height: 84px;" placeholder="<?= $pf_placeholder ?>"><?= $woo_shop_pre_filled ?></textarea>
|
350 |
-
<label for="woo_shop_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
351 |
-
<p class="description">pre-filled, call-to-action: if blank, get values from page-level settings if not from the main settings</p>
|
352 |
-
</div>
|
353 |
-
</div>
|
354 |
|
|
|
355 |
|
356 |
-
|
357 |
-
|
358 |
-
<div class="input-field col s12">
|
359 |
-
<input name="ht_ctc_woo_options[woo_shop_call_to_action]" value="<?= $woo_shop_call_to_action ?>" id="woo_shop_call_to_action" type="text" class="input-margin" placeholder="<?= $single_ctc_placeholder ?>">
|
360 |
-
<label for="woo_shop_call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
361 |
</div>
|
362 |
-
</div>
|
363 |
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
|
|
|
|
|
|
|
|
386 |
|
387 |
-
<details open class="description ctc_init_display_none woo_shop_add_whatsapp_settings">
|
388 |
-
<summary style="padding: 5px; background-color: #eeeeee; cursor: pointer; width: fit-content;">Adjust settings compatible with the theme design</summary>
|
389 |
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
|
|
395 |
</div>
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
</div>
|
402 |
-
</div>
|
403 |
-
</div>
|
404 |
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
</div>
|
416 |
</div>
|
417 |
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
|
|
|
|
|
|
|
|
|
|
428 |
</div>
|
429 |
-
<span class="helper-text" style="float:right;">Top, Bottom, Left, Right <span> E.g. 10px, 50%</span> </span>
|
430 |
</div>
|
431 |
-
<br>
|
432 |
-
|
433 |
-
<br>
|
434 |
-
<p class="description ctc_init_display_none woo_shop_add_whatsapp_settings"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/"><?php _e( 'WooCommerce Shop page', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
435 |
-
</details>
|
436 |
-
|
437 |
|
438 |
|
439 |
</div>
|
440 |
-
|
441 |
-
</li>
|
442 |
-
</ul>
|
443 |
-
|
444 |
-
<?php do_action('ht_ctc_ah_admin_after_woo_settings'); ?>
|
445 |
|
446 |
|
447 |
-
<!-- Page Level settings - for WooCommerce pages -->
|
448 |
-
<br><br>
|
449 |
-
<p class="description ht_ctc_subtitle">Page Level Settings:</p>
|
450 |
-
<br>
|
451 |
<?php
|
452 |
|
453 |
-
$admin_url = admin_url();
|
454 |
-
|
455 |
-
if (function_exists( 'wc_get_page_id')) {
|
456 |
-
$shop_page_id = wc_get_page_id( 'shop' );
|
457 |
-
$shop_admin_url = "${admin_url}post.php?post=${shop_page_id}&action=edit";
|
458 |
-
|
459 |
-
$cart_page_id = wc_get_page_id( 'cart' );
|
460 |
-
$cart_admin_url = "${admin_url}post.php?post=${cart_page_id}&action=edit";
|
461 |
-
|
462 |
-
$checkout_page_id = wc_get_page_id( 'checkout' );
|
463 |
-
$checkout_admin_url = "${admin_url}post.php?post=${checkout_page_id}&action=edit";
|
464 |
-
|
465 |
-
$myaccount_page_id = wc_get_page_id( 'myaccount' );
|
466 |
-
$myaccount_admin_url = "${admin_url}post.php?post=${myaccount_page_id}&action=edit";
|
467 |
-
|
468 |
-
?>
|
469 |
-
<p class="description"><a target="_blank" href="<?= $shop_admin_url ?>">Edit Shop Page</a> </p>
|
470 |
-
<p class="description"><a target="_blank" href="<?= $cart_admin_url ?>">Edit Cart Page</a> </p>
|
471 |
-
<p class="description"><a target="_blank" href="<?= $checkout_admin_url ?>">Edit Checkout Page</a> </p>
|
472 |
-
<p class="description"><a target="_blank" href="<?= $myaccount_admin_url ?>">Edit My Account Page</a> </p>
|
473 |
-
|
474 |
-
<br>
|
475 |
-
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a> <br> Number, Call to Action, Prefilled Message, <br> <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO</a>: Style, Time Delay, Scroll Delay</p>
|
476 |
-
<?php
|
477 |
-
}
|
478 |
-
|
479 |
}
|
480 |
|
481 |
|
@@ -492,6 +564,12 @@ class HT_CTC_Admin_Woo_Page {
|
|
492 |
wp_die( 'not allowed to modify - please contact admin ' );
|
493 |
}
|
494 |
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
$new_input = array();
|
496 |
|
497 |
foreach ($input as $key => $value) {
|
@@ -499,14 +577,19 @@ class HT_CTC_Admin_Woo_Page {
|
|
499 |
|
500 |
if ( 'woo_pre_filled' == $key || 'woo_shop_pre_filled' == $key ) {
|
501 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
502 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
$input[$key] = str_replace( ' ', '', $input[$key] );
|
504 |
if ( is_numeric($input[$key]) ) {
|
505 |
$input[$key] = $input[$key] . 'px';
|
506 |
}
|
507 |
-
// if ( '' == $input[$key] ) {
|
508 |
-
// $input[$key] = '0px';
|
509 |
-
// }
|
510 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
511 |
} else {
|
512 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
24 |
|
25 |
public function menu() {
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
add_submenu_page(
|
28 |
'click-to-chat',
|
29 |
'WooCommerce page',
|
42 |
|
43 |
?>
|
44 |
|
45 |
+
<div class="wrap ctc-admin-woo-page">
|
46 |
|
47 |
<?php settings_errors(); ?>
|
48 |
|
49 |
<!-- full row -->
|
50 |
<div class="row">
|
51 |
|
52 |
+
<div class="col s12 m12 l12 xl9 options">
|
53 |
<form action="options.php" method="post" class="">
|
54 |
<?php settings_fields( 'ht_ctc_woo_page_settings_fields' ); ?>
|
55 |
<?php do_settings_sections( 'ht_ctc_woo_page_settings_sections_do' ) ?>
|
90 |
|
91 |
public function chat_settings_section_cb() {
|
92 |
?>
|
93 |
+
<h1 id="woo_settings">Click to Chat - WooCommerce</h1>
|
94 |
+
<p class="description">
|
95 |
+
Overwrite:
|
96 |
+
<a class="open_tab" data-tab="overwrite_tab-1" href="#overwrite_tab-1">Single product</a> | <a class="open_tab" data-tab="overwrite_tab-2" href="#overwrite_tab-2">Shop, Cart, Checkout, Account</a> <br>
|
97 |
+
Add WhatsApp:
|
98 |
+
<a class="open_tab" data-tab="add_whatsapp_tab-1" href="#add_whatsapp_tab-1">Single product</a> | <a class="open_tab" data-tab="add_whatsapp_tab-2" href="#add_whatsapp_tab-2">Shop</a> | <a class="open_tab" data-tab="add_whatsapp_tab-3" href="#add_whatsapp_tab-3">Advanced</a>
|
99 |
+
</p>
|
100 |
<br>
|
101 |
<?php
|
102 |
do_action('ht_ctc_ah_admin' );
|
163 |
$woo_shop_margin_unit = ( isset( $woo_options['woo_shop_margin_unit']) ) ? esc_attr( $woo_options['woo_shop_margin_unit'] ) : 'px';
|
164 |
|
165 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
+
<!-- overwrite settings -->
|
168 |
+
<div class="margin_bottom_15"><strong class="description ht_ctc_subtitle">Overwrite Settings for WooCommerce Pages</strong></div>
|
169 |
<div class="row">
|
170 |
+
<div class="col s12">
|
171 |
+
<ul class="tabs tabs-fixed-width">
|
172 |
+
<li class="tab col s3 md_tab_li"><a href="#overwrite_tab-1"><?php _e( 'Single Product Pages', 'click-to-chat-for-whatsapp' ); ?></a></li>
|
173 |
+
<li class="tab col s3 md_tab_li"><a href="#overwrite_tab-2"><?php _e( 'Shop, cart, checkout, Account', 'click-to-chat-for-whatsapp' ); ?></a></li>
|
174 |
+
</ul>
|
175 |
</div>
|
|
|
176 |
|
177 |
+
<!-- overwrite: single product page -->
|
178 |
+
<div id="overwrite_tab-1" class="col s12 md_tab">
|
179 |
+
<div class="ctc_md_tab">
|
180 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/"><?php _e( 'WooCommerce Single Product pages', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
181 |
+
<p class="description">Variables: {product}, {price}, {regular_price}, {sku}, {site}, {url}, {title} </p>
|
182 |
+
<p class="description">Leave blank to get value from main settings</p>
|
183 |
+
<br><br>
|
184 |
+
|
185 |
+
<!-- prefilled message -->
|
186 |
+
<div class="row">
|
187 |
+
<div class="input-field col s12 md_tab">
|
188 |
+
<textarea name="ht_ctc_woo_options[woo_pre_filled]" id="woo_pre_filled" class="materialize-textarea input-margin" style="min-height: 64px;" placeholder="<?= $pf_placeholder ?>"><?= $woo_pre_filled ?></textarea>
|
189 |
+
<label for="woo_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
|
|
|
|
|
193 |
|
194 |
+
<!-- Call to Action -->
|
195 |
+
<div class="row">
|
196 |
+
<div class="input-field col s12 md_tab">
|
197 |
+
<input name="ht_ctc_woo_options[woo_call_to_action]" value="<?= $woo_call_to_action ?>" id="woo_call_to_action" type="text" class="input-margin" placeholder="<?= $ctc_placeholder ?>">
|
198 |
+
<label for="woo_call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
<?php
|
203 |
+
do_action('ht_ctc_ah_admin_after_woo_overwrite_single_settings');
|
204 |
+
|
205 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
206 |
?>
|
207 |
+
<!-- todo: docs - greetings docs.. -->
|
208 |
+
<!-- <p class="description">PRO: <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/#greetings">Greetings for WooCommerce Single product pages</a></p> -->
|
209 |
<?php
|
210 |
+
}
|
|
|
|
|
|
|
|
|
211 |
?>
|
212 |
+
|
213 |
+
<br><br>
|
214 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
</div>
|
|
|
216 |
|
217 |
+
<!-- overwrite: shop, cart, checkout, account - page level settings -->
|
218 |
+
<div id="overwrite_tab-2" class="col s12 md_tab">
|
219 |
+
<div class="ctc_md_tab">
|
220 |
+
<!-- Page Level settings - for WooCommerce pages -->
|
221 |
+
<p class="description">At <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a> can overwrite: Number, Call to Action, Prefilled Message (<a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO</a>: Greetings, Style, Time Delay, Scroll Delay)</p>
|
222 |
+
<br>
|
223 |
+
<?php
|
224 |
|
225 |
+
$admin_url = admin_url();
|
226 |
+
|
227 |
+
if (function_exists( 'wc_get_page_id')) {
|
228 |
+
$shop_page_id = wc_get_page_id( 'shop' );
|
229 |
+
$shop_admin_url = "${admin_url}post.php?post=${shop_page_id}&action=edit";
|
230 |
+
|
231 |
+
$cart_page_id = wc_get_page_id( 'cart' );
|
232 |
+
$cart_admin_url = "${admin_url}post.php?post=${cart_page_id}&action=edit";
|
233 |
+
|
234 |
+
$checkout_page_id = wc_get_page_id( 'checkout' );
|
235 |
+
$checkout_admin_url = "${admin_url}post.php?post=${checkout_page_id}&action=edit";
|
236 |
+
|
237 |
+
$myaccount_page_id = wc_get_page_id( 'myaccount' );
|
238 |
+
$myaccount_admin_url = "${admin_url}post.php?post=${myaccount_page_id}&action=edit";
|
239 |
|
240 |
+
?>
|
241 |
+
<p class="description"><a target="_blank" href="<?= $shop_admin_url ?>">Edit Shop Page</a> </p>
|
242 |
+
<p class="description"><a target="_blank" href="<?= $cart_admin_url ?>">Edit Cart Page</a> </p>
|
243 |
+
<p class="description"><a target="_blank" href="<?= $checkout_admin_url ?>">Edit Checkout Page</a> </p>
|
244 |
+
<p class="description"><a target="_blank" href="<?= $myaccount_admin_url ?>">Edit My Account Page</a> </p>
|
245 |
+
<?php
|
246 |
+
}
|
247 |
+
?>
|
248 |
+
<br><br>
|
|
|
|
|
|
|
249 |
</div>
|
250 |
</div>
|
251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
|
|
|
|
|
|
253 |
|
254 |
+
</div>
|
255 |
|
256 |
|
257 |
+
<br><br>
|
258 |
+
<!-- Add WhatsApp -->
|
259 |
+
<div class="margin_bottom_15"><strong class="description ht_ctc_subtitle">Add WhatsApp</strong></div>
|
260 |
+
<div class="row">
|
261 |
+
<div class="col s12">
|
262 |
+
<ul class="tabs tabs-fixed-width">
|
263 |
+
<li class="tab col s3 md_tab_li"><a href="#add_whatsapp_tab-1"><?php _e( 'Single Product Pages', 'click-to-chat-for-whatsapp' ); ?></a></li>
|
264 |
+
<li class="tab col s3 md_tab_li"><a href="#add_whatsapp_tab-2"><?php _e( 'Shop Page', 'click-to-chat-for-whatsapp' ); ?></a></li>
|
265 |
+
<li class="tab col s3 md_tab_li"><a href="#add_whatsapp_tab-3"><?php _e( 'Advanced', 'click-to-chat-for-whatsapp' ); ?></a></li>
|
266 |
+
</ul>
|
267 |
+
</div>
|
268 |
|
269 |
+
<div id="add_whatsapp_tab-1" class="col s12 md_tab">
|
270 |
+
<div class="ctc_md_tab">
|
271 |
+
<!-- Add button/icon -->
|
272 |
+
|
273 |
+
<br>
|
274 |
+
|
275 |
+
<div class="row">
|
276 |
+
<div class="col s6" style="padding-top: 14px;">
|
277 |
+
<p><?php _e( 'Add WhatsApp', 'click-to-chat-for-whatsapp' ); ?>:</p>
|
278 |
+
</div>
|
279 |
+
<div class="input-field col s6">
|
280 |
+
<select name="<?php echo $dbrow ?>[woo_position]" class="woo_single_position_select">
|
281 |
+
<?php
|
282 |
+
foreach ($woo_places as $key => $value) {
|
283 |
+
?>
|
284 |
+
<option value="<?= $key ?>" <?php echo $woo_position == $key ? 'SELECTED' : ''; ?> ><?php _e( $value, 'click-to-chat-for-whatsapp' ); ?></option>
|
285 |
+
<?php
|
286 |
+
}
|
287 |
+
?>
|
288 |
+
</select>
|
289 |
+
<?php
|
290 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
291 |
+
?>
|
292 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/add-whatsapp-in-woocommerce-single-product-pages/#pro_block">More Positions</a> (PRO)</p>
|
293 |
+
<?php
|
294 |
+
}
|
295 |
+
?>
|
296 |
+
|
297 |
+
</div>
|
298 |
+
</div>
|
299 |
|
300 |
+
<!-- style -->
|
301 |
+
<div class="row ctc_init_display_none woo_single_position_settings">
|
302 |
+
<div class="col s6" style="padding-top: 14px;">
|
303 |
+
<p><?php _e( 'Select Style', 'click-to-chat-for-whatsapp' ); ?></p>
|
304 |
+
</div>
|
305 |
+
<div class="input-field col s6">
|
306 |
+
<select name="<?= $dbrow; ?>[woo_style]" class="woo_single_style_select">
|
307 |
+
<option value="1" <?= $woo_style == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
|
308 |
+
<option value="2" <?= $woo_style == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
|
309 |
+
<option value="3" <?= $woo_style == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
|
310 |
+
<option value="3_1" <?= $woo_style == '3_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
311 |
+
<option value="4" <?= $woo_style == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
|
312 |
+
<option value="5" <?= $woo_style == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
|
313 |
+
<option value="7" <?= $woo_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
|
314 |
+
<option value="7_1" <?= $woo_style == '7_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
315 |
+
<option value="8" <?= $woo_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
316 |
+
<option value="99" <?= $woo_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Add your own image / GIF (Style-99)', 'click-to-chat-for-whatsapp' ); ?></option>
|
317 |
+
</select>
|
318 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=woo"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a>   |   <span><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize the styles</a></span> </p>
|
319 |
+
<p class="description"><strong>Recommended Styles: 1, 8</strong></p>
|
320 |
+
</div>
|
321 |
+
</div>
|
322 |
|
323 |
+
<p class="description ctc_init_display_none woo_single_position_settings">These styles and their position appears based on how the Theme is developed. </p>
|
324 |
+
<br>
|
325 |
+
|
326 |
+
<details open class="description ctc_init_display_none woo_single_position_settings">
|
327 |
+
<summary style="padding: 5px; background-color: #eeeeee; cursor: pointer; width: fit-content;">Adjust settings compatible with the theme design</summary>
|
328 |
+
|
329 |
+
<!-- style 1, 8 - add to cart layout -->
|
330 |
+
<div class="woo_single_position_settings_cart_layout" style="display: none;">
|
331 |
+
<div class="row">
|
332 |
+
<div class="col s6" style="padding-top: 14px;">
|
333 |
+
<p>Button layout <br><span style="font-size:0.8em;">WhatsApp button looks like 'Add to Cart' button</span></p>
|
334 |
+
</div>
|
335 |
+
<div class="input-field col s6">
|
336 |
+
<label>
|
337 |
+
<input name="<?= $dbrow; ?>[woo_single_layout_cart_btn]" type="checkbox" value="1" <?php checked( $woo_single_layout_cart_btn, 1 ); ?> id="woo_single_layout_cart_btn" />
|
338 |
+
<span>Displays like 'Add to Cart' button</span>
|
339 |
+
</label>
|
340 |
+
</div>
|
341 |
+
</div>
|
342 |
+
</div>
|
343 |
+
|
344 |
+
<!-- display - center -->
|
345 |
+
<div class="row woo_single_position_settings" style="display: none;">
|
346 |
+
<div class="col s6" style="padding-top: 14px;">
|
347 |
+
<p><?php _e( 'Display Center', 'click-to-chat-for-whatsapp' ); ?></p>
|
348 |
+
</div>
|
349 |
+
<div class="input-field col s6">
|
350 |
+
<label>
|
351 |
+
<input name="<?= $dbrow; ?>[woo_single_position_center]" type="checkbox" value="1" <?php checked( $woo_single_position_center, 1 ); ?> id="woo_single_position_center" />
|
352 |
+
<span><?php _e( 'Display center within available space', 'click-to-chat-for-whatsapp' ); ?></span>
|
353 |
+
</label>
|
354 |
+
</div>
|
355 |
+
</div>
|
356 |
+
|
357 |
+
<!-- display: block, inline-block .. -->
|
358 |
+
<div class="row ctc_init_display_none woo_single_position_settings">
|
359 |
+
<div class="col s6" style="padding-top: 14px;">
|
360 |
+
<p><?php _e( 'Display Block Type', 'click-to-chat-for-whatsapp' ); ?></p>
|
361 |
+
</div>
|
362 |
+
<div class="input-field col s6">
|
363 |
+
<select name="<?= $dbrow; ?>[woo_single_block_type]" class="">
|
364 |
+
<option value="block" <?= $woo_single_block_type == 'block' ? 'SELECTED' : ''; ?> >block</option>
|
365 |
+
<option value="inline" <?= $woo_single_block_type == 'inline' ? 'SELECTED' : ''; ?> >inline</option>
|
366 |
+
<option value="inline-block" <?= $woo_single_block_type == 'inline-block' ? 'SELECTED' : ''; ?> >inline-block</option>
|
367 |
+
</select>
|
368 |
+
<p class="woo_single_position_center_checked_content" style="display: none;">Recommended type: 'block'</p>
|
369 |
+
</div>
|
370 |
+
</div>
|
371 |
+
|
372 |
+
<!-- margin -->
|
373 |
+
<div class="row ctc_init_display_none woo_single_position_settings">
|
374 |
+
<div class="col s6" style="padding-top: 14px;">
|
375 |
+
<p><?php _e( 'Spacing (Margin)', 'click-to-chat-for-whatsapp' ); ?></p>
|
376 |
+
</div>
|
377 |
+
<div class="input-field col s6" style="display: flex; margin-bottom: 1px;">
|
378 |
+
<input name="ht_ctc_woo_options[woo_single_margin_top]" value="<?= $woo_single_margin_top ?>" id="woo_single_margin_top" type="text" style="display:inline; margin-right:4px;" class="input-margin tooltipped" placeholder="Top" data-position="top" data-tooltip="<?php _e( 'Top', 'click-to-chat-for-whatsapp' ); ?>">
|
379 |
+
<input name="ht_ctc_woo_options[woo_single_margin_bottom]" value="<?= $woo_single_margin_bottom ?>" id="woo_single_margin_bottom" type="text" style="display:inline; margin-right:8px;" class="input-margin tooltipped" placeholder="Bottom" data-position="bottom" data-tooltip="<?php _e( 'Bottom', 'click-to-chat-for-whatsapp' ); ?>">
|
380 |
+
<input name="ht_ctc_woo_options[woo_single_margin_left]" value="<?= $woo_single_margin_left ?>" id="woo_single_margin_left" type="text" style="display:inline; margin-right:4px;" class="input-margin tooltipped" placeholder="Left" data-position="left" data-tooltip="<?php _e( 'Left', 'click-to-chat-for-whatsapp' ); ?>">
|
381 |
+
<input name="ht_ctc_woo_options[woo_single_margin_right]" value="<?= $woo_single_margin_right ?>" id="woo_single_margin_right" type="text" style="display:inline;" class="input-margin tooltipped" placeholder="Right" data-position="right" data-tooltip="<?php _e( 'Right', 'click-to-chat-for-whatsapp' ); ?>">
|
382 |
+
</div>
|
383 |
+
<span class="helper-text" style="float:right;">Top, Bottom, Left, Right <span> E.g. 10px, 50%</span> </span>
|
384 |
+
</div>
|
385 |
+
|
386 |
+
</details>
|
387 |
+
|
388 |
+
<p class="description" style="margin-bottom:15px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/add-whatsapp-in-woocommerce-single-product-pages/"><?php _e( 'Add WhatsApp in WooCommerce Single Product pages', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
389 |
+
<?php
|
390 |
|
391 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
392 |
+
?>
|
393 |
+
<p class="description">
|
394 |
+
<a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO</a><br>
|
395 |
+
Before Main Content <br>
|
396 |
+
Before Product <br>
|
397 |
+
Before Product Summary <br>
|
398 |
+
Product Summary <br>
|
399 |
+
Before Add to Cart Form <br>
|
400 |
+
Before Cart Button <br>
|
401 |
+
After Cart Button <br>
|
402 |
+
After Add to Cart Form <br>
|
403 |
+
After Product <br>
|
404 |
+
</p>
|
405 |
+
<?php
|
406 |
+
}
|
|
|
|
|
|
|
|
|
|
|
407 |
|
408 |
+
?>
|
409 |
|
410 |
+
<br><br>
|
411 |
+
</div>
|
|
|
|
|
|
|
412 |
</div>
|
|
|
413 |
|
414 |
+
<div id="add_whatsapp_tab-2" class="col s12 md_tab">
|
415 |
+
<div class="ctc_md_tab">
|
416 |
+
<!-- woo shop page -->
|
417 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/"><?php _e( 'WooCommerce Shop page', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
418 |
+
|
419 |
+
<!-- At WooCommerce shop pages, loop.. -->
|
420 |
+
<div class="row">
|
421 |
+
<div class="col s6" style="padding-top: 14px;">
|
422 |
+
<p><?php _e( 'Add WhatsApp', 'click-to-chat-for-whatsapp' ); ?>:</p>
|
423 |
+
</div>
|
424 |
+
<div class="input-field col s6">
|
425 |
+
<label>
|
426 |
+
<input name="<?= $dbrow; ?>[woo_shop_add_whatsapp]" type="checkbox" value="1" <?php checked( $woo_shop_add_whatsapp, 1 ); ?> id="woo_shop_add_whatsapp" />
|
427 |
+
<span><?php _e( "At Products - Archive, Shop Page", 'click-to-chat-for-whatsapp' ); ?></span>
|
428 |
+
</label>
|
429 |
+
</div>
|
430 |
+
</div>
|
431 |
+
|
432 |
+
<!-- prefilled message -->
|
433 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
434 |
+
<div class="input-field col s12">
|
435 |
+
<textarea name="ht_ctc_woo_options[woo_shop_pre_filled]" id="woo_shop_pre_filled" class="materialize-textarea input-margin" style="min-height: 84px;" placeholder="<?= $pf_placeholder ?>"><?= $woo_shop_pre_filled ?></textarea>
|
436 |
+
<label for="woo_shop_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
437 |
+
<p class="description">pre-filled, call-to-action: if blank, get values from page-level settings if not from the main settings</p>
|
438 |
+
</div>
|
439 |
+
</div>
|
440 |
|
|
|
|
|
441 |
|
442 |
+
<!-- Call to Action -->
|
443 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
444 |
+
<div class="input-field col s12">
|
445 |
+
<input name="ht_ctc_woo_options[woo_shop_call_to_action]" value="<?= $woo_shop_call_to_action ?>" id="woo_shop_call_to_action" type="text" class="input-margin" placeholder="<?= $single_ctc_placeholder ?>">
|
446 |
+
<label for="woo_shop_call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
447 |
+
</div>
|
448 |
</div>
|
449 |
+
|
450 |
+
<!-- style -->
|
451 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
452 |
+
<div class="col s6" style="padding-top: 14px;">
|
453 |
+
<p><?php _e( 'Select Style', 'click-to-chat-for-whatsapp' ); ?></p>
|
454 |
+
</div>
|
455 |
+
<div class="input-field col s6">
|
456 |
+
<select name="<?= $dbrow; ?>[woo_shop_style]" class="woo_shop_style">
|
457 |
+
<option value="1" <?= $woo_shop_style == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
|
458 |
+
<option value="2" <?= $woo_shop_style == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
|
459 |
+
<option value="3" <?= $woo_shop_style == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
|
460 |
+
<option value="3_1" <?= $woo_shop_style == '3_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
461 |
+
<option value="4" <?= $woo_shop_style == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
|
462 |
+
<option value="5" <?= $woo_shop_style == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
|
463 |
+
<option value="7" <?= $woo_shop_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
|
464 |
+
<option value="7_1" <?= $woo_shop_style == '7_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
465 |
+
<option value="8" <?= $woo_shop_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
466 |
+
<option value="99" <?= $woo_shop_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Add your own image / GIF (Style-99)', 'click-to-chat-for-whatsapp' ); ?></option>
|
467 |
+
</select>
|
468 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=woo"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a>   |   <span><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize the styles</a></span> </p>
|
469 |
+
<p class="description"><b>Recommended Styles: 1, 8</b></p>
|
470 |
+
</div>
|
471 |
</div>
|
|
|
|
|
472 |
|
473 |
+
<details open class="description ctc_init_display_none woo_shop_add_whatsapp_settings">
|
474 |
+
<summary style="padding: 5px; background-color: #eeeeee; cursor: pointer; width: fit-content;">Adjust settings compatible with the theme design</summary>
|
475 |
+
|
476 |
+
<!-- style 1, 8 - shop - add to cart layout -->
|
477 |
+
<div class="woo_shop_cart_layout" style="display: none;">
|
478 |
+
<div class="row">
|
479 |
+
<div class="col s6" style="padding-top: 14px;">
|
480 |
+
<p>Button layout <br><span style="font-size:0.8em;">WhatsApp button looks like 'Add to Cart' button</span></p>
|
481 |
+
</div>
|
482 |
+
<div class="input-field col s6">
|
483 |
+
<label>
|
484 |
+
<input name="<?= $dbrow; ?>[woo_shop_layout_cart_btn]" type="checkbox" value="1" <?php checked( $woo_shop_layout_cart_btn, 1 ); ?> id="woo_shop_layout_cart_btn" />
|
485 |
+
<span>Displays like 'Add to Cart' button</span>
|
486 |
+
</label>
|
487 |
+
</div>
|
488 |
+
</div>
|
489 |
+
</div>
|
490 |
+
|
491 |
+
<!-- display - center -->
|
492 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
493 |
+
<div class="col s6" style="padding-top: 14px;">
|
494 |
+
<p><?php _e( 'Display Center', 'click-to-chat-for-whatsapp' ); ?></p>
|
495 |
+
</div>
|
496 |
+
<div class="input-field col s6">
|
497 |
+
<label>
|
498 |
+
<input name="<?= $dbrow; ?>[woo_shop_position_center]" type="checkbox" value="1" <?php checked( $woo_shop_position_center, 1 ); ?> id="woo_shop_position_center" />
|
499 |
+
<span><?php _e( 'Display center', 'click-to-chat-for-whatsapp' ); ?></span>
|
500 |
+
</label>
|
501 |
+
</div>
|
502 |
+
</div>
|
503 |
+
|
504 |
+
<!-- margin -->
|
505 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
506 |
+
<div class="col s6" style="padding-top: 14px;">
|
507 |
+
<p><?php _e( 'Spacing (Margin)', 'click-to-chat-for-whatsapp' ); ?></p>
|
508 |
+
</div>
|
509 |
+
<div class="input-field col s6" style="display: flex; margin-bottom: 1px;">
|
510 |
+
<input name="ht_ctc_woo_options[woo_shop_margin_top]" value="<?= $woo_shop_margin_top ?>" id="woo_shop_margin_top" type="text" style="display:inline; margin-right:4px;" class="input-margin tooltipped" placeholder="Top" data-position="top" data-tooltip="<?php _e( 'Top', 'click-to-chat-for-whatsapp' ); ?>">
|
511 |
+
<input name="ht_ctc_woo_options[woo_shop_margin_bottom]" value="<?= $woo_shop_margin_bottom ?>" id="woo_shop_margin_bottom" type="text" style="display:inline; margin-right:8px;" class="input-margin tooltipped" placeholder="Bottom" data-position="bottom" data-tooltip="<?php _e( 'Bottom', 'click-to-chat-for-whatsapp' ); ?>">
|
512 |
+
<input name="ht_ctc_woo_options[woo_shop_margin_left]" value="<?= $woo_shop_margin_left ?>" id="woo_shop_margin_left" type="text" style="display:inline; margin-right:4px;" class="input-margin tooltipped" placeholder="Left" data-position="left" data-tooltip="<?php _e( 'Left', 'click-to-chat-for-whatsapp' ); ?>">
|
513 |
+
<input name="ht_ctc_woo_options[woo_shop_margin_right]" value="<?= $woo_shop_margin_right ?>" id="woo_shop_margin_right" type="text" style="display:inline;" class="input-margin tooltipped" placeholder="Right" data-position="right" data-tooltip="<?php _e( 'Right', 'click-to-chat-for-whatsapp' ); ?>">
|
514 |
+
</div>
|
515 |
+
<span class="helper-text" style="float:right;">Top, Bottom, Left, Right <span> E.g. 10px, 50%</span> </span>
|
516 |
+
</div>
|
517 |
+
<br>
|
518 |
+
|
519 |
+
<br>
|
520 |
+
<p class="description ctc_init_display_none woo_shop_add_whatsapp_settings"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/"><?php _e( 'WooCommerce Shop page', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
521 |
+
</details>
|
522 |
+
<br><br>
|
523 |
</div>
|
524 |
</div>
|
525 |
|
526 |
+
<div id="add_whatsapp_tab-3" class="col s12 md_tab">
|
527 |
+
<div class="ctc_md_tab">
|
528 |
+
<?php
|
529 |
+
|
530 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
531 |
+
?>
|
532 |
+
<p class="description">
|
533 |
+
PRO: Apply business hours settings to WhatsApp added in WooCommerce Pages (single product, Shop).
|
534 |
+
</p>
|
535 |
+
<?php
|
536 |
+
}
|
537 |
+
|
538 |
+
do_action('ht_ctc_ah_admin_after_woo_settings');
|
539 |
+
?>
|
540 |
+
<br><br>
|
541 |
</div>
|
|
|
542 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
|
544 |
|
545 |
</div>
|
546 |
+
|
|
|
|
|
|
|
|
|
547 |
|
548 |
|
|
|
|
|
|
|
|
|
549 |
<?php
|
550 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
551 |
}
|
552 |
|
553 |
|
564 |
wp_die( 'not allowed to modify - please contact admin ' );
|
565 |
}
|
566 |
|
567 |
+
$editor = [];
|
568 |
+
$editor = apply_filters( 'ht_ctc_fh_greetings_setting_editor_values', $editor );
|
569 |
+
|
570 |
+
// formatting api - emoji ..
|
571 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/ht-ctc-admin-formatting.php';
|
572 |
+
|
573 |
$new_input = array();
|
574 |
|
575 |
foreach ($input as $key => $value) {
|
577 |
|
578 |
if ( 'woo_pre_filled' == $key || 'woo_shop_pre_filled' == $key ) {
|
579 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
580 |
+
} else if ( in_array( $key, $editor ) ) {
|
581 |
+
// editor
|
582 |
+
if ( !empty( $input[$key]) && '' !== $input[$key] && function_exists('ht_ctc_wp_sanitize_text_editor') ) {
|
583 |
+
$new_input[$key] = ht_ctc_wp_sanitize_text_editor( $input[$key] );
|
584 |
+
} else {
|
585 |
+
// save field even if the value is empty..
|
586 |
+
$new_input[$key] = sanitize_text_field( $input[$key] );
|
587 |
+
}
|
588 |
+
} else if ( 'woo_single_margin_top' == $key || 'woo_single_margin_bottom' == $key || 'woo_single_margin_left' == $key || 'woo_single_margin_right' == $key || 'woo_shop_margin_top' == $key || 'woo_shop_margin_bottom' == $key || 'woo_shop_margin_left' == $key || 'woo_shop_margin_right' == $key ) {
|
589 |
$input[$key] = str_replace( ' ', '', $input[$key] );
|
590 |
if ( is_numeric($input[$key]) ) {
|
591 |
$input[$key] = $input[$key] . 'px';
|
592 |
}
|
|
|
|
|
|
|
593 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
594 |
} else {
|
595 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Requires at least: 4.6
|
|
3 |
Tested up to: 6.0
|
4 |
Requires PHP: 5.6
|
5 |
Contributors: holithemes
|
6 |
-
Stable tag: 3.9.
|
7 |
Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -39,7 +39,7 @@ Select a Style that matches your Website design.
|
|
39 |
* All pre-defined styles are customizable
|
40 |
* Select style, customize to match the website design.
|
41 |
|
42 |
-
[list of Styles](https://holithemes.com/plugins/click-to-chat/list-of-styles
|
43 |
|
44 |
|
45 |
= 🌼 Add Own Image =
|
@@ -55,8 +55,9 @@ Convert any Element as WhatsApp Chat Element by adding
|
|
55 |
* Href/link: '#ctc_chat'
|
56 |
|
57 |
The custom design will navigate to WhatsApp based on plugin settings (WhatsApp Number, pre-filled message, .... ).
|
|
|
58 |
|
59 |
-
[Custom Element](https://holithemes.com/plugins/click-to-chat/custom-element
|
60 |
|
61 |
== Greetings Dialog ==
|
62 |
|
@@ -66,13 +67,12 @@ Encourage user engagement by displaying the perfect message at the perfect time
|
|
66 |
* [Greetings-2](https://holithemes.com/plugins/click-to-chat/greetings-2/): Content Specific Design
|
67 |
* [Greetings-Form](https://holithemes.com/plugins/click-to-chat/greetings-form/): Form Filling before initializing the chat [PRO]
|
68 |
|
69 |
-
|
70 |
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
[Actions](https://holithemes.com/plugins/click-to-chat/greetings-actions/)
|
76 |
|
77 |
|
78 |
== ✳️ Position to Place ==
|
@@ -96,7 +96,7 @@ Variables to change values dynamically
|
|
96 |
|
97 |
With these variables, we can understand from which page the user started WhatsApp chat.
|
98 |
|
99 |
-
[Pre-filled Message](https://holithemes.com/plugins/click-to-chat/pre-filled-message
|
100 |
|
101 |
== 🎁 WooCommerce ==
|
102 |
|
@@ -135,10 +135,10 @@ Add WhatsApp at WooCommerce Products list (shop page, related products list)
|
|
135 |
|
136 |
[Shop page](https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/)
|
137 |
|
138 |
-
= 📒
|
139 |
|
140 |
-
At the page-level, we can overwrite the settings
|
141 |
-
(while editing the post, at the right sidebar 'Click to Chat'
|
142 |
|
143 |
* WhatsApp Number
|
144 |
* Call to Action
|
@@ -151,17 +151,17 @@ PRO:
|
|
151 |
* Time Delay
|
152 |
* Scroll Delay
|
153 |
|
154 |
-
[Page-level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level
|
155 |
|
156 |
== 📈 Analytics ==
|
157 |
|
158 |
Creates an Event when the user clicks on the WhatsApp Icon/button.
|
159 |
|
160 |
-
[Google Analytics](https://holithemes.com/plugins/click-to-chat/google-analytics
|
161 |
|
162 |
-
[Facebook Pixel](https://holithemes.com/plugins/click-to-chat/facebook-pixel
|
163 |
|
164 |
-
[Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion
|
165 |
|
166 |
== Webhooks ==
|
167 |
|
@@ -207,10 +207,11 @@ Easy to set up different values for each language
|
|
207 |
* WhatsApp Number
|
208 |
* Call to Action
|
209 |
* Pre-filled Message
|
|
|
210 |
* Group ID
|
211 |
* Share Text
|
212 |
|
213 |
-
Setup for [WPML](https://holithemes.com/plugins/click-to-chat/translate-click-to-chat-settings-using-wpml-plugin
|
214 |
|
215 |
== 🚀 Performance ==
|
216 |
|
@@ -238,7 +239,7 @@ PRO:
|
|
238 |
|
239 |
== ⛳ Shortcodes ==
|
240 |
|
241 |
-
Use shortcodes to add
|
242 |
|
243 |
change the default setting values using shortcode attributes - WhatsApp Number, Style, Pre-filled message, Call to Action.
|
244 |
|
@@ -250,7 +251,7 @@ To change the WhatsApp number use the 'number' attribute
|
|
250 |
|
251 |
[ht-ctc-chat number=915123456789]
|
252 |
|
253 |
-
[Shortcodes for Chat](https://holithemes.com/plugins/click-to-chat/shortcodes-chat
|
254 |
|
255 |
= Group =
|
256 |
|
@@ -258,13 +259,13 @@ Enable Group chat feature and add WhatsApp Group id at the plugin settings.
|
|
258 |
|
259 |
Make it easy for your customers to join your Whatsapp Group.
|
260 |
|
261 |
-
[Group](https://holithemes.com/plugins/click-to-chat/group-chat-feature
|
262 |
|
263 |
= Share =
|
264 |
|
265 |
Let users share your website with their WhatsApp contacts and get more leads.
|
266 |
|
267 |
-
[Share](https://holithemes.com/plugins/click-to-chat/share-feature
|
268 |
|
269 |
= Help Translate The Plugin =
|
270 |
|
@@ -502,6 +503,9 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
|
|
502 |
|
503 |
== Changelog ==
|
504 |
|
|
|
|
|
|
|
505 |
= 3.9.5 =
|
506 |
* Fix: display settings for custom post types
|
507 |
|
3 |
Tested up to: 6.0
|
4 |
Requires PHP: 5.6
|
5 |
Contributors: holithemes
|
6 |
+
Stable tag: 3.9.6
|
7 |
Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
39 |
* All pre-defined styles are customizable
|
40 |
* Select style, customize to match the website design.
|
41 |
|
42 |
+
[list of Styles](https://holithemes.com/plugins/click-to-chat/list-of-styles/) | ✏️[Customize Styles](https://holithemes.com/plugins/click-to-chat/customize-styles/)
|
43 |
|
44 |
|
45 |
= 🌼 Add Own Image =
|
55 |
* Href/link: '#ctc_chat'
|
56 |
|
57 |
The custom design will navigate to WhatsApp based on plugin settings (WhatsApp Number, pre-filled message, .... ).
|
58 |
+
(e.g. Add WhatsApp in menu)
|
59 |
|
60 |
+
[Custom Element](https://holithemes.com/plugins/click-to-chat/custom-element/)
|
61 |
|
62 |
== Greetings Dialog ==
|
63 |
|
67 |
* [Greetings-2](https://holithemes.com/plugins/click-to-chat/greetings-2/): Content Specific Design
|
68 |
* [Greetings-Form](https://holithemes.com/plugins/click-to-chat/greetings-form/): Form Filling before initializing the chat [PRO]
|
69 |
|
70 |
+
= [Actions](https://holithemes.com/plugins/click-to-chat/greetings-actions/) =
|
71 |
|
72 |
+
**Click**: Display Greetings When Clicks on any element with Class name: 'ctc_greetings'
|
73 |
+
**ViewPort**: Display Greetings When an element is in viewport(25% margin) with Class name: 'ctc_greetings_now' [PRO]
|
74 |
+
**Time, Scroll** Display Greetings based on time, scroll [PRO]
|
75 |
|
|
|
76 |
|
77 |
|
78 |
== ✳️ Position to Place ==
|
96 |
|
97 |
With these variables, we can understand from which page the user started WhatsApp chat.
|
98 |
|
99 |
+
[Pre-filled Message](https://holithemes.com/plugins/click-to-chat/pre-filled-message/)
|
100 |
|
101 |
== 🎁 WooCommerce ==
|
102 |
|
135 |
|
136 |
[Shop page](https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/)
|
137 |
|
138 |
+
= 📒 Page Level Settings =
|
139 |
|
140 |
+
At the page-level, we can overwrite the settings for each post. we can add different Whatsapp Number, Prefilled Message, Call to Action.
|
141 |
+
(while editing the post, at the right sidebar 'Click to Chat' metabox)
|
142 |
|
143 |
* WhatsApp Number
|
144 |
* Call to Action
|
151 |
* Time Delay
|
152 |
* Scroll Delay
|
153 |
|
154 |
+
[Page-level settings](https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/)
|
155 |
|
156 |
== 📈 Analytics ==
|
157 |
|
158 |
Creates an Event when the user clicks on the WhatsApp Icon/button.
|
159 |
|
160 |
+
[Google Analytics](https://holithemes.com/plugins/click-to-chat/google-analytics/)
|
161 |
|
162 |
+
[Facebook Pixel](https://holithemes.com/plugins/click-to-chat/facebook-pixel/)
|
163 |
|
164 |
+
[Google Ads Conversations](https://holithemes.com/plugins/click-to-chat/google-ads-conversion/)
|
165 |
|
166 |
== Webhooks ==
|
167 |
|
207 |
* WhatsApp Number
|
208 |
* Call to Action
|
209 |
* Pre-filled Message
|
210 |
+
* Greetings Content
|
211 |
* Group ID
|
212 |
* Share Text
|
213 |
|
214 |
+
Setup for [WPML](https://holithemes.com/plugins/click-to-chat/translate-click-to-chat-settings-using-wpml-plugin/), [Polylang](https://holithemes.com/plugins/click-to-chat/translate-click-to-chat-settings-using-polylang-plugin/)
|
215 |
|
216 |
== 🚀 Performance ==
|
217 |
|
239 |
|
240 |
== ⛳ Shortcodes ==
|
241 |
|
242 |
+
Use shortcodes to add WhatsApp icon/button with inline the Post content, widget area.
|
243 |
|
244 |
change the default setting values using shortcode attributes - WhatsApp Number, Style, Pre-filled message, Call to Action.
|
245 |
|
251 |
|
252 |
[ht-ctc-chat number=915123456789]
|
253 |
|
254 |
+
[Shortcodes for Chat](https://holithemes.com/plugins/click-to-chat/shortcodes-chat/)
|
255 |
|
256 |
= Group =
|
257 |
|
259 |
|
260 |
Make it easy for your customers to join your Whatsapp Group.
|
261 |
|
262 |
+
[Group](https://holithemes.com/plugins/click-to-chat/group-chat-feature/)
|
263 |
|
264 |
= Share =
|
265 |
|
266 |
Let users share your website with their WhatsApp contacts and get more leads.
|
267 |
|
268 |
+
[Share](https://holithemes.com/plugins/click-to-chat/share-feature/)
|
269 |
|
270 |
= Help Translate The Plugin =
|
271 |
|
503 |
|
504 |
== Changelog ==
|
505 |
|
506 |
+
= 3.9.6 =
|
507 |
+
* Enchantment: click to chat admin page for WooCommerce
|
508 |
+
|
509 |
= 3.9.5 =
|
510 |
* Fix: display settings for custom post types
|
511 |
|