Version Description
- New: Add Styles at WooCommerce Shop page. (Products Archive)
- Enchantment: Style-7 font size settings.
- Enchantment: Custom Element (convert any element to navigate to WhatsApp Chat)
Download this release
Release Info
Developer | bhvreddy |
Plugin | Click to Chat for WhatsApp Chat |
Version | 3.5 |
Comparing to | |
See all releases |
Code changes from version 3.3.4 to 3.5
- click-to-chat.php +2 -2
- common/class-ht-ctc-switch.php +3 -0
- new/admin/admin_assets/css/admin.css +30 -10
- new/admin/admin_assets/js/333.admin.js +199 -9
- new/admin/admin_assets/js/admin.js +199 -9
- new/admin/admin_commons/admin-device-settings.php +82 -12
- new/admin/admin_commons/admin-show-hide.php +24 -14
- new/admin/admin_commons/admin-sidebar-content.php +43 -14
- new/admin/admin_commons/class-ht-ctc-admin-hooks.php +82 -0
- new/admin/admin_commons/class-ht-ctc-static.php +0 -274
- new/admin/admin_commons/ht-ctc-admin-formatting.php +31 -0
- new/admin/admin_commons/ht-ctc-formatting.php +36 -0
- new/admin/class-ht-ctc-admin-customize-styles.php +162 -113
- new/admin/class-ht-ctc-admin-main-page.php +54 -37
- new/admin/class-ht-ctc-admin-other-settings.php +64 -64
- new/admin/db/class-ht-ctc-db.php +1 -0
- new/admin/db/class-ht-ctc-db2.php +1 -1
- new/admin/db/class-ht-ctc-update-db-backup.php +1 -1
- new/admin/db/class-ht-ctc-update-db.php +46 -2
- new/inc/assets/js/325.app.js +1 -1
- new/inc/assets/js/331.app.js +1 -1
- new/inc/assets/js/332.app.js +1 -1
- new/inc/assets/js/app.js +1 -1
- new/inc/assets/js/dev/app.dev.js +77 -22
- new/inc/assets/js/dev/group.dev.js +3 -1
- new/inc/assets/js/dev/share.dev.js +3 -1
- new/inc/assets/js/group.js +1 -1
- new/inc/assets/js/share.js +1 -1
- new/inc/chat/class-ht-ctc-chat-shortcode.php +1 -0
- new/inc/chat/class-ht-ctc-chat.php +63 -9
- new/inc/commons/class-ht-ctc-animations.php +138 -14
- new/inc/commons/class-ht-ctc-hooks.php +81 -16
- new/inc/commons/class-ht-ctc-ismobile.php +2 -5
- new/inc/commons/class-ht-ctc-scripts.php +1 -1
- new/inc/commons/ht-ctc-formatting.php +44 -0
- new/inc/greetings/class-ht-ctc-chat-greetings.php +76 -0
- new/inc/greetings/greetings-1.php +21 -0
- new/inc/group/class-ht-ctc-group-shortcode.php +1 -0
- new/inc/group/class-ht-ctc-group.php +5 -10
- new/inc/share/class-ht-ctc-share-shortcode.php +1 -0
- new/inc/share/class-ht-ctc-share.php +5 -10
- new/inc/styles-shortcode/sc-style-99.php +21 -21
- new/inc/styles/style-1.php +1 -0
- new/inc/styles/style-5.php +4 -0
- new/inc/styles/style-7.php +8 -3
- new/inc/styles/style-7_1.php +4 -1
- new/inc/styles/style-8.php +5 -0
- new/inc/styles/style-99.php +18 -18
- new/tools/woo/class-ht-ctc-woo.php +205 -23
- new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php +321 -32
- prev/inc/commons/class-ht-ccw-ismobile.php +6 -31
- prev/inc/commons/styles-list-sc/sc-style-99.php +16 -16
- prev/inc/commons/styles-list/style-99.php +12 -12
- prev/inc/commons/styles.php +0 -14
- readme.txt +95 -19
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.
|
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.
|
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.5
|
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.5' );
|
21 |
}
|
22 |
|
23 |
// define HT_CTC_PLUGIN_FILE
|
common/class-ht-ctc-switch.php
CHANGED
@@ -26,6 +26,9 @@ class HT_CTC_Swift {
|
|
26 |
$this->define( 'HT_CTC_WP_MIN_VERSION', '4.6' );
|
27 |
$this->define( 'HT_CTC_PLUGIN_BASENAME', plugin_basename( HT_CTC_PLUGIN_FILE ) );
|
28 |
$this->define( 'HT_CTC_BLOG_NAME', get_bloginfo('name') );
|
|
|
|
|
|
|
29 |
|
30 |
do_action('ht_ctc_ah_define_constants');
|
31 |
|
26 |
$this->define( 'HT_CTC_WP_MIN_VERSION', '4.6' );
|
27 |
$this->define( 'HT_CTC_PLUGIN_BASENAME', plugin_basename( HT_CTC_PLUGIN_FILE ) );
|
28 |
$this->define( 'HT_CTC_BLOG_NAME', get_bloginfo('name') );
|
29 |
+
// $this->define( 'HT_CTC_SITE_URL', get_site_url() );
|
30 |
+
// $this->define( 'HT_CTC_HOME_URL', home_url('/') );
|
31 |
+
// $this->define( 'HT_CTC_HOME_URL', get_bloginfo('url') );
|
32 |
|
33 |
do_action('ht_ctc_ah_define_constants');
|
34 |
|
new/admin/admin_assets/css/admin.css
CHANGED
@@ -1,19 +1,38 @@
|
|
1 |
/* Admin CSS */
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
}
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
11 |
}
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
.options .submit {
|
18 |
position: sticky !important;
|
19 |
bottom: 1px;
|
@@ -47,6 +66,7 @@
|
|
47 |
margin: 5px 0;
|
48 |
}
|
49 |
|
|
|
50 |
@media only screen and (min-width: 1201px) {
|
51 |
.sticky-sidebar {
|
52 |
position: sticky !important;
|
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;
|
10 |
}
|
11 |
+
|
12 |
+
* {
|
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 {
|
19 |
+
color: green !important;
|
20 |
}
|
21 |
|
22 |
+
.ht_ctc_show_hide_settings :checked ~ .dashicons-hidden,
|
23 |
+
.ht_ctc_show_hide_settings :checked ~ span .dashicons-hidden,
|
24 |
+
.ht_ctc_show_hide_settings .hide_settings .dashicons-hidden {
|
25 |
+
color: red !important;
|
26 |
+
}
|
27 |
|
28 |
+
.show-hide_display-none,
|
29 |
+
.not_samesettings,
|
30 |
+
.show_settings,
|
31 |
+
.hide_settings,
|
32 |
+
.ctc_init_display_none {
|
33 |
+
display: none;
|
34 |
+
}
|
35 |
+
|
36 |
.options .submit {
|
37 |
position: sticky !important;
|
38 |
bottom: 1px;
|
66 |
margin: 5px 0;
|
67 |
}
|
68 |
|
69 |
+
|
70 |
@media only screen and (min-width: 1201px) {
|
71 |
.sticky-sidebar {
|
72 |
position: sticky !important;
|
new/admin/admin_assets/js/333.admin.js
CHANGED
@@ -43,23 +43,25 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
43 |
// default display
|
44 |
var val = $('.global_display:checked').val();
|
45 |
|
46 |
-
$('.global_show_or_hide_label').html('(' + val + ')');
|
47 |
-
|
48 |
if (val == 'show') {
|
|
|
49 |
$(".hide_settings").show();
|
50 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
51 |
$(".show_hide_types .show_box").hide();
|
52 |
} else if (val == 'hide') {
|
|
|
53 |
$(".show_settings").show();
|
54 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
55 |
$(".show_hide_types .hide_box").hide();
|
56 |
}
|
|
|
57 |
|
58 |
// on change
|
59 |
$(".global_display").on("change", function (e) {
|
60 |
|
61 |
var change_val = e.target.value;
|
62 |
-
|
|
|
63 |
|
64 |
$(".hide_settings").hide();
|
65 |
$(".show_settings").hide();
|
@@ -69,14 +71,22 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
69 |
$(".show_hide_types .hide_box").hide();
|
70 |
|
71 |
if (change_val == 'show') {
|
|
|
|
|
72 |
$(".hide_settings").show(500);
|
73 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
74 |
$(".show_hide_types .hide_box").show();
|
75 |
} else if (change_val == 'hide') {
|
|
|
|
|
76 |
$(".show_settings").show(500);
|
77 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
78 |
$(".show_hide_types .show_box").show();
|
79 |
}
|
|
|
|
|
|
|
|
|
80 |
});
|
81 |
|
82 |
}
|
@@ -149,6 +159,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
149 |
|
150 |
if ($('.same_settings').is(':checked')) {
|
151 |
$(".not_samesettings").hide(900);
|
|
|
152 |
} else {
|
153 |
$(".not_samesettings").show(900);
|
154 |
}
|
@@ -163,8 +174,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
163 |
|
164 |
var cc = $("#whatsapp_cc").val();
|
165 |
var num = $("#whatsapp_number").val();
|
166 |
-
var num2 = num;
|
167 |
-
|
168 |
|
169 |
$("#whatsapp_cc").on("change paste keyup", function (e) {
|
170 |
cc = $("#whatsapp_cc").val();
|
@@ -173,18 +182,75 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
173 |
|
174 |
$("#whatsapp_number").on("change paste keyup", function (e) {
|
175 |
num = $("#whatsapp_number").val();
|
176 |
-
num2 = num.replace(/^0+/, '');
|
177 |
call();
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
});
|
179 |
|
180 |
function call() {
|
181 |
$(".ht_ctc_wn").html(cc + '' + num);
|
182 |
-
$("#ctc_whatsapp_number").val(cc + '' +
|
183 |
}
|
184 |
|
185 |
}
|
186 |
wn();
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
// webhook
|
189 |
function hook() {
|
190 |
|
@@ -229,7 +295,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
229 |
|
230 |
// analytics - ga4 display only if ga is enabled.
|
231 |
$("#google_analytics").on("change", function (e) {
|
232 |
-
console.log('change worked');
|
233 |
if ($('#google_analytics').is(':checked')) {
|
234 |
$(".ctc_ga4").show();
|
235 |
} else {
|
@@ -243,10 +308,135 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
243 |
$(".ctc_ga4").hide();
|
244 |
}
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
}
|
247 |
other();
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
});
|
250 |
|
251 |
|
252 |
-
})(jQuery);
|
43 |
// default display
|
44 |
var val = $('.global_display:checked').val();
|
45 |
|
|
|
|
|
46 |
if (val == 'show') {
|
47 |
+
$('.global_show_or_hide_icon').addClass('dashicons dashicons-visibility');
|
48 |
$(".hide_settings").show();
|
49 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
50 |
$(".show_hide_types .show_box").hide();
|
51 |
} else if (val == 'hide') {
|
52 |
+
$('.global_show_or_hide_icon').addClass('dashicons dashicons-hidden');
|
53 |
$(".show_settings").show();
|
54 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
55 |
$(".show_hide_types .hide_box").hide();
|
56 |
}
|
57 |
+
$('.global_show_or_hide_label').html('(' + val + ')');
|
58 |
|
59 |
// on change
|
60 |
$(".global_display").on("change", function (e) {
|
61 |
|
62 |
var change_val = e.target.value;
|
63 |
+
var add_class = '';
|
64 |
+
var remove_class = '';
|
65 |
|
66 |
$(".hide_settings").hide();
|
67 |
$(".show_settings").hide();
|
71 |
$(".show_hide_types .hide_box").hide();
|
72 |
|
73 |
if (change_val == 'show') {
|
74 |
+
add_class = 'dashicons dashicons-visibility';
|
75 |
+
remove_class = 'dashicons-hidden';
|
76 |
$(".hide_settings").show(500);
|
77 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
78 |
$(".show_hide_types .hide_box").show();
|
79 |
} else if (change_val == 'hide') {
|
80 |
+
add_class = 'dashicons dashicons-hidden';
|
81 |
+
remove_class = 'dashicons-visibility';
|
82 |
$(".show_settings").show(500);
|
83 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
84 |
$(".show_hide_types .show_box").show();
|
85 |
}
|
86 |
+
$('.global_show_or_hide_label').html('(' + change_val + ')');
|
87 |
+
$('.global_show_or_hide_icon').removeClass(remove_class);
|
88 |
+
$('.global_show_or_hide_icon').addClass(add_class);
|
89 |
+
|
90 |
});
|
91 |
|
92 |
}
|
159 |
|
160 |
if ($('.same_settings').is(':checked')) {
|
161 |
$(".not_samesettings").hide(900);
|
162 |
+
$(".select_styles_issue_checkbox").hide();
|
163 |
} else {
|
164 |
$(".not_samesettings").show(900);
|
165 |
}
|
174 |
|
175 |
var cc = $("#whatsapp_cc").val();
|
176 |
var num = $("#whatsapp_number").val();
|
|
|
|
|
177 |
|
178 |
$("#whatsapp_cc").on("change paste keyup", function (e) {
|
179 |
cc = $("#whatsapp_cc").val();
|
182 |
|
183 |
$("#whatsapp_number").on("change paste keyup", function (e) {
|
184 |
num = $("#whatsapp_number").val();
|
|
|
185 |
call();
|
186 |
+
|
187 |
+
if (num && 0 == num.charAt(0)) {
|
188 |
+
$('.ctc_wn_initial_zero').show(500);
|
189 |
+
} else {
|
190 |
+
$('.ctc_wn_initial_zero').hide(500);
|
191 |
+
}
|
192 |
});
|
193 |
|
194 |
function call() {
|
195 |
$(".ht_ctc_wn").html(cc + '' + num);
|
196 |
+
$("#ctc_whatsapp_number").val(cc + '' + num);
|
197 |
}
|
198 |
|
199 |
}
|
200 |
wn();
|
201 |
|
202 |
+
// woo page..
|
203 |
+
function woo_page() {
|
204 |
+
|
205 |
+
// Woo single product page - woo position
|
206 |
+
var val = $('.woo_single_position_select').find(":selected").val();
|
207 |
+
|
208 |
+
if (val && '' !== val && 'select' !== val) {
|
209 |
+
$('.woo_single_position_settings').show();
|
210 |
+
}
|
211 |
+
|
212 |
+
// on change
|
213 |
+
$('.woo_single_position_select').on("change", function (e) {
|
214 |
+
var change_val = e.target.value;
|
215 |
+
|
216 |
+
if (change_val == 'select') {
|
217 |
+
$('.woo_single_position_settings').hide(200);
|
218 |
+
} else {
|
219 |
+
$('.woo_single_position_settings').show(200);
|
220 |
+
}
|
221 |
+
});
|
222 |
+
|
223 |
+
if ($('#woo_single_position_center').is(':checked')) {
|
224 |
+
$(".woo_single_position_center_checked_content").show();
|
225 |
+
}
|
226 |
+
|
227 |
+
$("#woo_single_position_center").on("change", function (e) {
|
228 |
+
if ($('#woo_single_position_center').is(':checked')) {
|
229 |
+
$(".woo_single_position_center_checked_content").show(200);
|
230 |
+
} else {
|
231 |
+
$(".woo_single_position_center_checked_content").hide(100);
|
232 |
+
}
|
233 |
+
});
|
234 |
+
|
235 |
+
|
236 |
+
|
237 |
+
// woo shop page ..
|
238 |
+
if ($('#woo_shop_add_whatsapp').is(':checked')) {
|
239 |
+
$(".woo_shop_add_whatsapp_settings").show();
|
240 |
+
}
|
241 |
+
|
242 |
+
$("#woo_shop_add_whatsapp").on("change", function (e) {
|
243 |
+
if ($('#woo_shop_add_whatsapp').is(':checked')) {
|
244 |
+
$(".woo_shop_add_whatsapp_settings").show(200);
|
245 |
+
} else {
|
246 |
+
$(".woo_shop_add_whatsapp_settings").hide(100);
|
247 |
+
}
|
248 |
+
});
|
249 |
+
|
250 |
+
|
251 |
+
}
|
252 |
+
woo_page();
|
253 |
+
|
254 |
// webhook
|
255 |
function hook() {
|
256 |
|
295 |
|
296 |
// analytics - ga4 display only if ga is enabled.
|
297 |
$("#google_analytics").on("change", function (e) {
|
|
|
298 |
if ($('#google_analytics').is(':checked')) {
|
299 |
$(".ctc_ga4").show();
|
300 |
} else {
|
308 |
$(".ctc_ga4").hide();
|
309 |
}
|
310 |
|
311 |
+
// select styles issue
|
312 |
+
|
313 |
+
if ($('#select_styles_issue').is(':checked')) {
|
314 |
+
$(".select_styles_issue_checkbox").show();
|
315 |
+
}
|
316 |
+
$('.select_styles_issue_description').on('click', function (e) {
|
317 |
+
$('.select_styles_issue_checkbox').toggle(500);
|
318 |
+
});
|
319 |
+
|
320 |
+
|
321 |
+
// s3e - shadow on hover
|
322 |
+
if (!$('#s3_box_shadow').is(':checked')) {
|
323 |
+
$(".s3_box_shadow_hover").show();
|
324 |
+
}
|
325 |
+
|
326 |
+
$('#s3_box_shadow').on('change', function (e) {
|
327 |
+
if ($('#s3_box_shadow').is(':checked')) {
|
328 |
+
$(".s3_box_shadow_hover").hide(400);
|
329 |
+
} else {
|
330 |
+
$(".s3_box_shadow_hover").show(500);
|
331 |
+
}
|
332 |
+
});
|
333 |
+
|
334 |
}
|
335 |
other();
|
336 |
|
337 |
+
// collapsible..
|
338 |
+
function collapsible() {
|
339 |
+
|
340 |
+
var ht_ctc_admin = {};
|
341 |
+
|
342 |
+
if (localStorage.getItem('ht_ctc_admin')) {
|
343 |
+
ht_ctc_admin = localStorage.getItem('ht_ctc_admin');
|
344 |
+
ht_ctc_admin = JSON.parse(ht_ctc_admin);
|
345 |
+
}
|
346 |
+
// else {
|
347 |
+
// ht_ctc_admin = demo;
|
348 |
+
// demo = JSON.stringify(demo);
|
349 |
+
// localStorage.setItem('ht_ctc_admin', demo);
|
350 |
+
// }
|
351 |
+
|
352 |
+
// get items from ht_ctc_admin
|
353 |
+
function ctc_getItem(item) {
|
354 |
+
if (ht_ctc_admin[item]) {
|
355 |
+
return ht_ctc_admin[item];
|
356 |
+
} else {
|
357 |
+
return false;
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
// set items to ht_ctc_admin storage
|
362 |
+
function ctc_setItem(name, value) {
|
363 |
+
ht_ctc_admin[name] = value;
|
364 |
+
var newValues = JSON.stringify(ht_ctc_admin);
|
365 |
+
localStorage.setItem('ht_ctc_admin', newValues);
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* ht_ctc_sidebar_contat - not added, as it may cause view distraction..
|
370 |
+
*/
|
371 |
+
var styles_list = [
|
372 |
+
'ht_ctc_s1',
|
373 |
+
'ht_ctc_s2',
|
374 |
+
'ht_ctc_s3',
|
375 |
+
'ht_ctc_s3_1',
|
376 |
+
'ht_ctc_s4',
|
377 |
+
'ht_ctc_s5',
|
378 |
+
'ht_ctc_s6',
|
379 |
+
'ht_ctc_s7',
|
380 |
+
'ht_ctc_s7_1',
|
381 |
+
'ht_ctc_s8',
|
382 |
+
'ht_ctc_s99',
|
383 |
+
'ht_ctc_webhooks',
|
384 |
+
'ht_ctc_analytics',
|
385 |
+
'ht_ctc_animations',
|
386 |
+
'ht_ctc_other_settings',
|
387 |
+
'ht_ctc_enable_share_group',
|
388 |
+
'ht_ctc_debug',
|
389 |
+
'ht_ctc_device_settings',
|
390 |
+
'ht_ctc_show_hide_settings',
|
391 |
+
'ht_ctc_woo_1',
|
392 |
+
'ht_ctc_woo_shop',
|
393 |
+
'ht_ctc_woo_cart',
|
394 |
+
'ht_ctc_woo_checkout',
|
395 |
+
'ht_ctc_woo_myaccount',
|
396 |
+
];
|
397 |
+
|
398 |
+
var default_active = [
|
399 |
+
'ht_ctc_device_settings',
|
400 |
+
'ht_ctc_show_hide_settings',
|
401 |
+
'ht_ctc_woo_1',
|
402 |
+
'ht_ctc_webhooks',
|
403 |
+
'ht_ctc_analytics',
|
404 |
+
'ht_ctc_animations',
|
405 |
+
'ht_ctc_other_settings',
|
406 |
+
];
|
407 |
+
|
408 |
+
|
409 |
+
styles_list.forEach(e => {
|
410 |
+
|
411 |
+
// one known issue.. is already active its not working as expected.
|
412 |
+
var is_col = (ctc_getItem('col_' + e)) ? ctc_getItem('col_' + e) : '';
|
413 |
+
if ('open' == is_col) {
|
414 |
+
$('.' + e + ' li').addClass('active');
|
415 |
+
} else if ('close' == is_col) {
|
416 |
+
$('.' + e + ' li').removeClass('active');
|
417 |
+
} else if (default_active.includes(e)) {
|
418 |
+
// if not changed then for default_active list add active..
|
419 |
+
$('.' + e + ' li').addClass('active');
|
420 |
+
}
|
421 |
+
|
422 |
+
|
423 |
+
$('.' + e).collapsible({
|
424 |
+
onOpenEnd() {
|
425 |
+
ctc_setItem('col_' + e, 'open');
|
426 |
+
},
|
427 |
+
onCloseEnd() {
|
428 |
+
ctc_setItem('col_' + e, 'close');
|
429 |
+
}
|
430 |
+
});
|
431 |
+
|
432 |
+
});
|
433 |
+
|
434 |
+
}
|
435 |
+
try {
|
436 |
+
collapsible();
|
437 |
+
} catch (e) { }
|
438 |
+
|
439 |
});
|
440 |
|
441 |
|
442 |
+
})(jQuery);
|
new/admin/admin_assets/js/admin.js
CHANGED
@@ -43,23 +43,25 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
43 |
// default display
|
44 |
var val = $('.global_display:checked').val();
|
45 |
|
46 |
-
$('.global_show_or_hide_label').html('('+val+')');
|
47 |
-
|
48 |
if (val == 'show') {
|
|
|
49 |
$(".hide_settings").show();
|
50 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
51 |
$(".show_hide_types .show_box").hide();
|
52 |
} else if (val == 'hide') {
|
|
|
53 |
$(".show_settings").show();
|
54 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
55 |
$(".show_hide_types .hide_box").hide();
|
56 |
}
|
|
|
57 |
|
58 |
// on change
|
59 |
$(".global_display").on("change", function (e) {
|
60 |
|
61 |
var change_val = e.target.value;
|
62 |
-
|
|
|
63 |
|
64 |
$(".hide_settings").hide();
|
65 |
$(".show_settings").hide();
|
@@ -69,14 +71,22 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
69 |
$(".show_hide_types .hide_box").hide();
|
70 |
|
71 |
if (change_val == 'show') {
|
|
|
|
|
72 |
$(".hide_settings").show(500);
|
73 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
74 |
$(".show_hide_types .hide_box").show();
|
75 |
} else if (change_val == 'hide') {
|
|
|
|
|
76 |
$(".show_settings").show(500);
|
77 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
78 |
$(".show_hide_types .show_box").show();
|
79 |
}
|
|
|
|
|
|
|
|
|
80 |
});
|
81 |
|
82 |
}
|
@@ -149,6 +159,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
149 |
|
150 |
if ($('.same_settings').is(':checked')) {
|
151 |
$(".not_samesettings").hide(900);
|
|
|
152 |
} else {
|
153 |
$(".not_samesettings").show(900);
|
154 |
}
|
@@ -163,8 +174,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
163 |
|
164 |
var cc = $("#whatsapp_cc").val();
|
165 |
var num = $("#whatsapp_number").val();
|
166 |
-
var num2 = num;
|
167 |
-
|
168 |
|
169 |
$("#whatsapp_cc").on("change paste keyup", function (e) {
|
170 |
cc = $("#whatsapp_cc").val();
|
@@ -173,18 +182,75 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
173 |
|
174 |
$("#whatsapp_number").on("change paste keyup", function (e) {
|
175 |
num = $("#whatsapp_number").val();
|
176 |
-
num2 = num.replace(/^0+/, '');
|
177 |
call();
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
});
|
179 |
|
180 |
function call() {
|
181 |
$(".ht_ctc_wn").html(cc + '' + num);
|
182 |
-
$("#ctc_whatsapp_number").val(cc + '' +
|
183 |
}
|
184 |
|
185 |
}
|
186 |
wn();
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
// webhook
|
189 |
function hook() {
|
190 |
|
@@ -229,7 +295,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
229 |
|
230 |
// analytics - ga4 display only if ga is enabled.
|
231 |
$("#google_analytics").on("change", function (e) {
|
232 |
-
console.log('change worked');
|
233 |
if ($('#google_analytics').is(':checked')) {
|
234 |
$(".ctc_ga4").show();
|
235 |
} else {
|
@@ -243,10 +308,135 @@ document.addEventListener('DOMContentLoaded', function () {
|
|
243 |
$(".ctc_ga4").hide();
|
244 |
}
|
245 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
}
|
247 |
other();
|
248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
});
|
250 |
|
251 |
|
252 |
-
})(jQuery);
|
43 |
// default display
|
44 |
var val = $('.global_display:checked').val();
|
45 |
|
|
|
|
|
46 |
if (val == 'show') {
|
47 |
+
$('.global_show_or_hide_icon').addClass('dashicons dashicons-visibility');
|
48 |
$(".hide_settings").show();
|
49 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
50 |
$(".show_hide_types .show_box").hide();
|
51 |
} else if (val == 'hide') {
|
52 |
+
$('.global_show_or_hide_icon').addClass('dashicons dashicons-hidden');
|
53 |
$(".show_settings").show();
|
54 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
55 |
$(".show_hide_types .hide_box").hide();
|
56 |
}
|
57 |
+
$('.global_show_or_hide_label').html('(' + val + ')');
|
58 |
|
59 |
// on change
|
60 |
$(".global_display").on("change", function (e) {
|
61 |
|
62 |
var change_val = e.target.value;
|
63 |
+
var add_class = '';
|
64 |
+
var remove_class = '';
|
65 |
|
66 |
$(".hide_settings").hide();
|
67 |
$(".show_settings").hide();
|
71 |
$(".show_hide_types .hide_box").hide();
|
72 |
|
73 |
if (change_val == 'show') {
|
74 |
+
add_class = 'dashicons dashicons-visibility';
|
75 |
+
remove_class = 'dashicons-hidden';
|
76 |
$(".hide_settings").show(500);
|
77 |
$(".show_hide_types .show_btn").attr('disabled', 'disabled');
|
78 |
$(".show_hide_types .hide_box").show();
|
79 |
} else if (change_val == 'hide') {
|
80 |
+
add_class = 'dashicons dashicons-hidden';
|
81 |
+
remove_class = 'dashicons-visibility';
|
82 |
$(".show_settings").show(500);
|
83 |
$(".show_hide_types .hide_btn").attr('disabled', 'disabled');
|
84 |
$(".show_hide_types .show_box").show();
|
85 |
}
|
86 |
+
$('.global_show_or_hide_label').html('(' + change_val + ')');
|
87 |
+
$('.global_show_or_hide_icon').removeClass(remove_class);
|
88 |
+
$('.global_show_or_hide_icon').addClass(add_class);
|
89 |
+
|
90 |
});
|
91 |
|
92 |
}
|
159 |
|
160 |
if ($('.same_settings').is(':checked')) {
|
161 |
$(".not_samesettings").hide(900);
|
162 |
+
$(".select_styles_issue_checkbox").hide();
|
163 |
} else {
|
164 |
$(".not_samesettings").show(900);
|
165 |
}
|
174 |
|
175 |
var cc = $("#whatsapp_cc").val();
|
176 |
var num = $("#whatsapp_number").val();
|
|
|
|
|
177 |
|
178 |
$("#whatsapp_cc").on("change paste keyup", function (e) {
|
179 |
cc = $("#whatsapp_cc").val();
|
182 |
|
183 |
$("#whatsapp_number").on("change paste keyup", function (e) {
|
184 |
num = $("#whatsapp_number").val();
|
|
|
185 |
call();
|
186 |
+
|
187 |
+
if (num && 0 == num.charAt(0)) {
|
188 |
+
$('.ctc_wn_initial_zero').show(500);
|
189 |
+
} else {
|
190 |
+
$('.ctc_wn_initial_zero').hide(500);
|
191 |
+
}
|
192 |
});
|
193 |
|
194 |
function call() {
|
195 |
$(".ht_ctc_wn").html(cc + '' + num);
|
196 |
+
$("#ctc_whatsapp_number").val(cc + '' + num);
|
197 |
}
|
198 |
|
199 |
}
|
200 |
wn();
|
201 |
|
202 |
+
// woo page..
|
203 |
+
function woo_page() {
|
204 |
+
|
205 |
+
// Woo single product page - woo position
|
206 |
+
var val = $('.woo_single_position_select').find(":selected").val();
|
207 |
+
|
208 |
+
if (val && '' !== val && 'select' !== val) {
|
209 |
+
$('.woo_single_position_settings').show();
|
210 |
+
}
|
211 |
+
|
212 |
+
// on change
|
213 |
+
$('.woo_single_position_select').on("change", function (e) {
|
214 |
+
var change_val = e.target.value;
|
215 |
+
|
216 |
+
if (change_val == 'select') {
|
217 |
+
$('.woo_single_position_settings').hide(200);
|
218 |
+
} else {
|
219 |
+
$('.woo_single_position_settings').show(200);
|
220 |
+
}
|
221 |
+
});
|
222 |
+
|
223 |
+
if ($('#woo_single_position_center').is(':checked')) {
|
224 |
+
$(".woo_single_position_center_checked_content").show();
|
225 |
+
}
|
226 |
+
|
227 |
+
$("#woo_single_position_center").on("change", function (e) {
|
228 |
+
if ($('#woo_single_position_center').is(':checked')) {
|
229 |
+
$(".woo_single_position_center_checked_content").show(200);
|
230 |
+
} else {
|
231 |
+
$(".woo_single_position_center_checked_content").hide(100);
|
232 |
+
}
|
233 |
+
});
|
234 |
+
|
235 |
+
|
236 |
+
|
237 |
+
// woo shop page ..
|
238 |
+
if ($('#woo_shop_add_whatsapp').is(':checked')) {
|
239 |
+
$(".woo_shop_add_whatsapp_settings").show();
|
240 |
+
}
|
241 |
+
|
242 |
+
$("#woo_shop_add_whatsapp").on("change", function (e) {
|
243 |
+
if ($('#woo_shop_add_whatsapp').is(':checked')) {
|
244 |
+
$(".woo_shop_add_whatsapp_settings").show(200);
|
245 |
+
} else {
|
246 |
+
$(".woo_shop_add_whatsapp_settings").hide(100);
|
247 |
+
}
|
248 |
+
});
|
249 |
+
|
250 |
+
|
251 |
+
}
|
252 |
+
woo_page();
|
253 |
+
|
254 |
// webhook
|
255 |
function hook() {
|
256 |
|
295 |
|
296 |
// analytics - ga4 display only if ga is enabled.
|
297 |
$("#google_analytics").on("change", function (e) {
|
|
|
298 |
if ($('#google_analytics').is(':checked')) {
|
299 |
$(".ctc_ga4").show();
|
300 |
} else {
|
308 |
$(".ctc_ga4").hide();
|
309 |
}
|
310 |
|
311 |
+
// select styles issue
|
312 |
+
|
313 |
+
if ($('#select_styles_issue').is(':checked')) {
|
314 |
+
$(".select_styles_issue_checkbox").show();
|
315 |
+
}
|
316 |
+
$('.select_styles_issue_description').on('click', function (e) {
|
317 |
+
$('.select_styles_issue_checkbox').toggle(500);
|
318 |
+
});
|
319 |
+
|
320 |
+
|
321 |
+
// s3e - shadow on hover
|
322 |
+
if (!$('#s3_box_shadow').is(':checked')) {
|
323 |
+
$(".s3_box_shadow_hover").show();
|
324 |
+
}
|
325 |
+
|
326 |
+
$('#s3_box_shadow').on('change', function (e) {
|
327 |
+
if ($('#s3_box_shadow').is(':checked')) {
|
328 |
+
$(".s3_box_shadow_hover").hide(400);
|
329 |
+
} else {
|
330 |
+
$(".s3_box_shadow_hover").show(500);
|
331 |
+
}
|
332 |
+
});
|
333 |
+
|
334 |
}
|
335 |
other();
|
336 |
|
337 |
+
// collapsible..
|
338 |
+
function collapsible() {
|
339 |
+
|
340 |
+
var ht_ctc_admin = {};
|
341 |
+
|
342 |
+
if (localStorage.getItem('ht_ctc_admin')) {
|
343 |
+
ht_ctc_admin = localStorage.getItem('ht_ctc_admin');
|
344 |
+
ht_ctc_admin = JSON.parse(ht_ctc_admin);
|
345 |
+
}
|
346 |
+
// else {
|
347 |
+
// ht_ctc_admin = demo;
|
348 |
+
// demo = JSON.stringify(demo);
|
349 |
+
// localStorage.setItem('ht_ctc_admin', demo);
|
350 |
+
// }
|
351 |
+
|
352 |
+
// get items from ht_ctc_admin
|
353 |
+
function ctc_getItem(item) {
|
354 |
+
if (ht_ctc_admin[item]) {
|
355 |
+
return ht_ctc_admin[item];
|
356 |
+
} else {
|
357 |
+
return false;
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
// set items to ht_ctc_admin storage
|
362 |
+
function ctc_setItem(name, value) {
|
363 |
+
ht_ctc_admin[name] = value;
|
364 |
+
var newValues = JSON.stringify(ht_ctc_admin);
|
365 |
+
localStorage.setItem('ht_ctc_admin', newValues);
|
366 |
+
}
|
367 |
+
|
368 |
+
/**
|
369 |
+
* ht_ctc_sidebar_contat - not added, as it may cause view distraction..
|
370 |
+
*/
|
371 |
+
var styles_list = [
|
372 |
+
'ht_ctc_s1',
|
373 |
+
'ht_ctc_s2',
|
374 |
+
'ht_ctc_s3',
|
375 |
+
'ht_ctc_s3_1',
|
376 |
+
'ht_ctc_s4',
|
377 |
+
'ht_ctc_s5',
|
378 |
+
'ht_ctc_s6',
|
379 |
+
'ht_ctc_s7',
|
380 |
+
'ht_ctc_s7_1',
|
381 |
+
'ht_ctc_s8',
|
382 |
+
'ht_ctc_s99',
|
383 |
+
'ht_ctc_webhooks',
|
384 |
+
'ht_ctc_analytics',
|
385 |
+
'ht_ctc_animations',
|
386 |
+
'ht_ctc_other_settings',
|
387 |
+
'ht_ctc_enable_share_group',
|
388 |
+
'ht_ctc_debug',
|
389 |
+
'ht_ctc_device_settings',
|
390 |
+
'ht_ctc_show_hide_settings',
|
391 |
+
'ht_ctc_woo_1',
|
392 |
+
'ht_ctc_woo_shop',
|
393 |
+
'ht_ctc_woo_cart',
|
394 |
+
'ht_ctc_woo_checkout',
|
395 |
+
'ht_ctc_woo_myaccount',
|
396 |
+
];
|
397 |
+
|
398 |
+
var default_active = [
|
399 |
+
'ht_ctc_device_settings',
|
400 |
+
'ht_ctc_show_hide_settings',
|
401 |
+
'ht_ctc_woo_1',
|
402 |
+
'ht_ctc_webhooks',
|
403 |
+
'ht_ctc_analytics',
|
404 |
+
'ht_ctc_animations',
|
405 |
+
'ht_ctc_other_settings',
|
406 |
+
];
|
407 |
+
|
408 |
+
|
409 |
+
styles_list.forEach(e => {
|
410 |
+
|
411 |
+
// one known issue.. is already active its not working as expected.
|
412 |
+
var is_col = (ctc_getItem('col_' + e)) ? ctc_getItem('col_' + e) : '';
|
413 |
+
if ('open' == is_col) {
|
414 |
+
$('.' + e + ' li').addClass('active');
|
415 |
+
} else if ('close' == is_col) {
|
416 |
+
$('.' + e + ' li').removeClass('active');
|
417 |
+
} else if (default_active.includes(e)) {
|
418 |
+
// if not changed then for default_active list add active..
|
419 |
+
$('.' + e + ' li').addClass('active');
|
420 |
+
}
|
421 |
+
|
422 |
+
|
423 |
+
$('.' + e).collapsible({
|
424 |
+
onOpenEnd() {
|
425 |
+
ctc_setItem('col_' + e, 'open');
|
426 |
+
},
|
427 |
+
onCloseEnd() {
|
428 |
+
ctc_setItem('col_' + e, 'close');
|
429 |
+
}
|
430 |
+
});
|
431 |
+
|
432 |
+
});
|
433 |
+
|
434 |
+
}
|
435 |
+
try {
|
436 |
+
collapsible();
|
437 |
+
} catch (e) { }
|
438 |
+
|
439 |
});
|
440 |
|
441 |
|
442 |
+
})(jQuery);
|
new/admin/admin_commons/admin-device-settings.php
CHANGED
@@ -30,11 +30,19 @@ $mobile_side_1_value = ( isset( $options['mobile_side_1_value'])) ? esc_attr( $o
|
|
30 |
$mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
|
31 |
$mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
?>
|
35 |
|
36 |
-
<ul class="collapsible">
|
37 |
-
<li class="
|
38 |
<div class="collapsible-header"><?php _e( 'Style, Position - Desktop, Mobile', 'click-to-chat-for-whatsapp' ); ?></div>
|
39 |
<div class="collapsible-body">
|
40 |
|
@@ -59,14 +67,31 @@ $mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $o
|
|
59 |
<option value="8" <?= $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
60 |
<option value="99" <?= $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
61 |
</select>
|
62 |
-
<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=chat"><?php _e( 'List of
|
63 |
</div>
|
64 |
</div>
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
<?php
|
68 |
// Action hook - After select style - Desktop
|
69 |
-
do_action('ht_ctc_ah_admin_desktop_after_select_sytle', $options, $dbrow );
|
70 |
?>
|
71 |
|
72 |
<!-- Desktop position -->
|
@@ -75,14 +100,14 @@ do_action('ht_ctc_ah_admin_desktop_after_select_sytle', $options, $dbrow );
|
|
75 |
<div class="row ht_ctc_admin_desktop">
|
76 |
<br>
|
77 |
<div class="input-field col s6">
|
78 |
-
<select name="<?= $dbrow; ?>[side_1]" class="
|
79 |
<option value="bottom" <?= $side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
|
80 |
<option value="top" <?= $side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
|
81 |
</select>
|
82 |
<label>top / bottom </label>
|
83 |
</div>
|
84 |
<div class="input-field col s6">
|
85 |
-
<input name="<?= $dbrow; ?>[side_1_value]" value="<?= $side_1_value ?>" id="side_1_value" type="text" class="input-margin">
|
86 |
<label for="side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
|
87 |
</div>
|
88 |
</div>
|
@@ -90,7 +115,7 @@ do_action('ht_ctc_ah_admin_desktop_after_select_sytle', $options, $dbrow );
|
|
90 |
<!-- side - 2 -->
|
91 |
<div class="row ht_ctc_admin_desktop" style="margin-bottom:0;">
|
92 |
<div class="input-field col s6">
|
93 |
-
<select name="<?= $dbrow; ?>[side_2]" class="
|
94 |
<option value="right" <?= $side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
|
95 |
<option value="left" <?= $side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
|
96 |
</select>
|
@@ -98,7 +123,7 @@ do_action('ht_ctc_ah_admin_desktop_after_select_sytle', $options, $dbrow );
|
|
98 |
</div>
|
99 |
|
100 |
<div class="input-field col s6">
|
101 |
-
<input name="<?= $dbrow; ?>[side_2_value]" value="<?= $side_2_value ?>" id="side_2_value" type="text" class="input-margin">
|
102 |
<label for="side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
|
103 |
</div>
|
104 |
</div>
|
@@ -152,13 +177,31 @@ if ( isset( $options['same_settings'] ) ) {
|
|
152 |
<option value="8" <?= $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
153 |
<option value="99" <?= $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
154 |
</select>
|
155 |
-
<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=chat"><?php _e( 'List of
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
</div>
|
157 |
</div>
|
158 |
|
159 |
<?php
|
160 |
// Action hook - After select style - Mobile
|
161 |
-
do_action('ht_ctc_ah_admin_mobile_after_select_sytle', $options, $dbrow );
|
162 |
?>
|
163 |
|
164 |
<!-- Mobile position -->
|
@@ -201,9 +244,36 @@ do_action('ht_ctc_ah_admin_mobile_after_select_sytle', $options, $dbrow );
|
|
201 |
<br class="not_samesettings">
|
202 |
<hr class="not_samesettings" style="max-width: 500px;">
|
203 |
<br class="not_samesettings">
|
204 |
-
<p class="description"><span class="not_samesettings" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
|
206 |
</div>
|
207 |
</div>
|
208 |
</li>
|
209 |
-
|
30 |
$mobile_side_2 = ( isset( $options['mobile_side_2']) ) ? esc_attr( $options['mobile_side_2'] ) : '';
|
31 |
$mobile_side_2_value = ( isset( $options['mobile_side_2_value'])) ? esc_attr( $options['mobile_side_2_value'] ) : '';
|
32 |
|
33 |
+
$position_type = ( isset( $options['position_type']) ) ? esc_attr( $options['position_type'] ) : 'fixed';
|
34 |
+
$position_type_mobile = ( isset( $options['position_type_mobile']) ) ? esc_attr( $options['position_type_mobile'] ) : 'fixed';
|
35 |
+
|
36 |
+
$position_type_values = [
|
37 |
+
'fixed' => 'Fixed'
|
38 |
+
];
|
39 |
+
|
40 |
+
$position_type_values = apply_filters( 'ht_ctc_fh_position_type_values', $position_type_values );
|
41 |
|
42 |
?>
|
43 |
|
44 |
+
<ul class="collapsible ht_ctc_device_settings">
|
45 |
+
<li class="">
|
46 |
<div class="collapsible-header"><?php _e( 'Style, Position - Desktop, Mobile', 'click-to-chat-for-whatsapp' ); ?></div>
|
47 |
<div class="collapsible-body">
|
48 |
|
67 |
<option value="8" <?= $style_desktop == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
68 |
<option value="99" <?= $style_desktop == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
69 |
</select>
|
70 |
+
<p class="description"><a style="background-color: #26a69a; color: #fff; padding: 5px;" target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a>   |   <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
|
71 |
</div>
|
72 |
</div>
|
73 |
|
74 |
+
<!-- position type -->
|
75 |
+
<p class="description ht_ctc_admin_desktop ht_ctc_subtitle"><?php _e( 'Position Type', 'click-to-chat-for-whatsapp' ); ?> <span class="not_samesettings"><?php _e( ' (Desktop)', 'click-to-chat-for-whatsapp' ); ?></span>:</p>
|
76 |
+
<div class="row ht_ctc_admin_desktop">
|
77 |
+
<div class="input-field col s12 m12">
|
78 |
+
<select name="<?php echo $dbrow ?>[position_type]" class="chat_select_position_type">
|
79 |
+
<?php
|
80 |
+
foreach ($position_type_values as $key => $value) {
|
81 |
+
?>
|
82 |
+
<option value="<?= $key ?>" <?php echo $position_type == $key ? 'SELECTED' : ''; ?> ><?php _e( $value, 'click-to-chat-for-whatsapp' ); ?></option>
|
83 |
+
<?php
|
84 |
+
}
|
85 |
+
?>
|
86 |
+
</select>
|
87 |
+
<p class="description"><?php _e( 'Fixed: Position relative to the screen, stays at the same place even after page scroll', 'click-to-chat-for-whatsapp' ); ?></p>
|
88 |
+
<p class="description"><?php _e( 'Absolute: Position relative to the content (body tag) and moves with page scroll', 'click-to-chat-for-whatsapp' ); ?> (PRO) - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/position-to-place/#pro_block">more info</a></p>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
|
92 |
<?php
|
93 |
// Action hook - After select style - Desktop
|
94 |
+
// do_action('ht_ctc_ah_admin_desktop_after_select_sytle', $options, $dbrow );
|
95 |
?>
|
96 |
|
97 |
<!-- Desktop position -->
|
100 |
<div class="row ht_ctc_admin_desktop">
|
101 |
<br>
|
102 |
<div class="input-field col s6">
|
103 |
+
<select name="<?= $dbrow; ?>[side_1]" class="position_bottom_top">
|
104 |
<option value="bottom" <?= $side_1 == 'bottom' ? 'SELECTED' : ''; ?> ><?php _e( 'bottom', 'click-to-chat-for-whatsapp' ); ?></option>
|
105 |
<option value="top" <?= $side_1 == 'top' ? 'SELECTED' : ''; ?> ><?php _e( 'top', 'click-to-chat-for-whatsapp' ); ?></option>
|
106 |
</select>
|
107 |
<label>top / bottom </label>
|
108 |
</div>
|
109 |
<div class="input-field col s6">
|
110 |
+
<input name="<?= $dbrow; ?>[side_1_value]" value="<?= $side_1_value ?>" id="side_1_value" type="text" class="input-margin position_bottom_top_value">
|
111 |
<label for="side_1_value"><?php _e( 'E.g. 10px', 'click-to-chat-for-whatsapp' ); ?></label>
|
112 |
</div>
|
113 |
</div>
|
115 |
<!-- side - 2 -->
|
116 |
<div class="row ht_ctc_admin_desktop" style="margin-bottom:0;">
|
117 |
<div class="input-field col s6">
|
118 |
+
<select name="<?= $dbrow; ?>[side_2]" class="position_right_left">
|
119 |
<option value="right" <?= $side_2 == 'right' ? 'SELECTED' : ''; ?> ><?php _e( 'right', 'click-to-chat-for-whatsapp' ); ?></option>
|
120 |
<option value="left" <?= $side_2 == 'left' ? 'SELECTED' : ''; ?> ><?php _e( 'left', 'click-to-chat-for-whatsapp' ); ?></option>
|
121 |
</select>
|
123 |
</div>
|
124 |
|
125 |
<div class="input-field col s6">
|
126 |
+
<input name="<?= $dbrow; ?>[side_2_value]" value="<?= $side_2_value ?>" id="side_2_value" type="text" class="input-margin position_right_left_value">
|
127 |
<label for="side_2_value"><?php _e( 'E.g. 50%', 'click-to-chat-for-whatsapp' ); ?></label>
|
128 |
</div>
|
129 |
</div>
|
177 |
<option value="8" <?= $style_mobile == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
178 |
<option value="99" <?= $style_mobile == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
179 |
</select>
|
180 |
+
<p class="description"><a style="background-color: #26a69a; color: #fff; padding: 5px;" target="_blank" href="https://holithemes.com/plugins/click-to-chat/list-of-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=chat"><?php _e( 'List of Styles', 'click-to-chat-for-whatsapp' ); ?></a>   |   <span><?php _e( 'Customize the styles', 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" class="customize_styles_link" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">( Click to Chat -> Customize )</a></span> </p>
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
|
184 |
+
<!-- position type - mobile -->
|
185 |
+
<p class="description ht_ctc_admin_mobile ht_ctc_subtitle not_samesettings"><?php _e( 'Position Type', 'click-to-chat-for-whatsapp' ); ?>:</p class="description">
|
186 |
+
<div class="row ht_ctc_admin_mobile not_samesettings">
|
187 |
+
<div class="input-field col s12 m12">
|
188 |
+
<select name="<?php echo $dbrow ?>[position_type_mobile]" class="chat_select_position_type">
|
189 |
+
<?php
|
190 |
+
foreach ($position_type_values as $key => $value) {
|
191 |
+
?>
|
192 |
+
<option value="<?= $key ?>" <?php echo $position_type_mobile == $key ? 'SELECTED' : ''; ?> ><?php _e( $value, 'click-to-chat-for-whatsapp' ); ?></option>
|
193 |
+
<?php
|
194 |
+
}
|
195 |
+
?>
|
196 |
+
</select>
|
197 |
+
<p class="description"><?php _e( 'Fixed: Position relative to the screen, stays at the same place even after page scroll', 'click-to-chat-for-whatsapp' ); ?></p>
|
198 |
+
<p class="description"><?php _e( 'Absolute: Position relative to the content (body tag) and moves with page scroll', 'click-to-chat-for-whatsapp' ); ?> (PRO) - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/position-to-place/#pro_block">more info</a></p>
|
199 |
</div>
|
200 |
</div>
|
201 |
|
202 |
<?php
|
203 |
// Action hook - After select style - Mobile
|
204 |
+
// do_action('ht_ctc_ah_admin_mobile_after_select_sytle', $options, $dbrow );
|
205 |
?>
|
206 |
|
207 |
<!-- Mobile position -->
|
244 |
<br class="not_samesettings">
|
245 |
<hr class="not_samesettings" style="max-width: 500px;">
|
246 |
<br class="not_samesettings">
|
247 |
+
<p class="description"><span class="not_samesettings select_styles_issue_description" style="font-size: 0.7em;">If Styles for desktop, mobile not selected as expected <span style="color: #039be5; cursor: pointer;">Check this</span>, - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/select-styles/?utm_source=ctc&utm_medium=admin&utm_campaign=chat">more info</a></span></p>
|
248 |
+
|
249 |
+
<div class="select_styles_issue_checkbox ctc_init_display_none" style="">
|
250 |
+
<?php
|
251 |
+
// If checked loads both styles and display the needed style
|
252 |
+
// cache issue while selecting styles
|
253 |
+
if ( isset( $options['select_styles_issue'] ) ) {
|
254 |
+
?>
|
255 |
+
<p id="styles_issue">
|
256 |
+
<label>
|
257 |
+
<input name="<?= $dbrow; ?>[select_styles_issue]" type="checkbox" value="1" <?php checked( $options['select_styles_issue'], 1 ); ?> id="select_styles_issue" />
|
258 |
+
<!-- <span>Style for device is not as expected(due to cache)</span> -->
|
259 |
+
<span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
|
260 |
+
</label>
|
261 |
+
</p>
|
262 |
+
<?php
|
263 |
+
} else {
|
264 |
+
?>
|
265 |
+
<p id="styles_issue">
|
266 |
+
<label>
|
267 |
+
<input name="<?= $dbrow; ?>[select_styles_issue]" type="checkbox" value="1" id="select_styles_issue" />
|
268 |
+
<span><?php _e( 'Check this, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
|
269 |
+
</label>
|
270 |
+
</p>
|
271 |
+
<?php
|
272 |
+
}
|
273 |
+
?>
|
274 |
+
</div>
|
275 |
|
276 |
</div>
|
277 |
</div>
|
278 |
</li>
|
279 |
+
</ul>
|
new/admin/admin_commons/admin-show-hide.php
CHANGED
@@ -13,8 +13,8 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
13 |
|
14 |
?>
|
15 |
|
16 |
-
<ul class="collapsible">
|
17 |
-
<li class="
|
18 |
<div class="collapsible-header" id="showhide_settings"><?php _e( 'Display Settings', 'click-to-chat-for-whatsapp' ); ?></div>
|
19 |
<div class="collapsible-body">
|
20 |
|
@@ -27,17 +27,12 @@ if ( 'chat' == $type ) {
|
|
27 |
do_action('ht_ctc_ah_admin_before_showhide');
|
28 |
|
29 |
$show_hide_settings = array(
|
30 |
-
// 'Home Page' => '',
|
31 |
'home' => 'Home Page',
|
32 |
-
// 'Build in Post Types' => '',
|
33 |
'posts' => 'Posts',
|
34 |
'pages' => 'Pages',
|
35 |
-
// 'Multiple/Loop Posts' => '',
|
36 |
'archive' => 'Archive pages',
|
37 |
'category' => 'Category pages',
|
38 |
-
// '404 Page' => '',
|
39 |
'page_404' => '404 Page',
|
40 |
-
// 'Post Types' => '',
|
41 |
);
|
42 |
|
43 |
// woocommerce
|
@@ -188,7 +183,10 @@ foreach ($show_hide_settings as $key => $value) {
|
|
188 |
<p class="col s3 m3 l2 global_box">
|
189 |
<label>
|
190 |
<input name="<?= $dbrow; ?>[display][<?= $key; ?>]" value="g" type="radio" <?php checked( '' == $is_checked_show_hide || 'g' == $is_checked_show_hide ); ?> class="with-gap global_btn <?= $key; ?>"/>
|
191 |
-
<span class="ctc_radio_text"><?php _e( 'Global', 'click-to-chat-for-whatsapp' ); ?>
|
|
|
|
|
|
|
192 |
</label>
|
193 |
</p>
|
194 |
</div>
|
@@ -207,16 +205,16 @@ foreach ($show_hide_settings as $key => $value) {
|
|
207 |
<div class="row hide_settings">
|
208 |
<div class="input-field col s7">
|
209 |
<input name="<?= $dbrow; ?>[display][list_hideon_pages]" value="<?= $list_hideon_pages ?>" id="ccw_list_id_tohide" type="text" class="input-margin">
|
210 |
-
<label for="ccw_list_id_tohide"><?php _e( "Hide on this pages", 'click-to-chat-for-whatsapp' );
|
211 |
<p class="description"><?php _e( "Add post id's to hide. Add multiple post id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
|
212 |
</div>
|
213 |
</div>
|
214 |
|
215 |
-
<!-- ID's list to show styles -->
|
216 |
<div class="row show_settings">
|
217 |
<div class="input-field col s7">
|
218 |
<input name="<?= $dbrow; ?>[display][list_showon_pages]" value="<?= $list_showon_pages ?>" id="ccw_list_id_toshow" type="text" class="input-margin">
|
219 |
-
<label for="ccw_list_id_toshow"><?php _e( "Show on this pages", 'click-to-chat-for-whatsapp' );
|
220 |
<p class="description"><?php _e( "Add Post, Page, Media - ID's to show styles, Add multiple id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
|
221 |
</div>
|
222 |
</div>
|
@@ -226,7 +224,7 @@ foreach ($show_hide_settings as $key => $value) {
|
|
226 |
<div class="row hide_settings">
|
227 |
<div class="input-field col s7">
|
228 |
<input name="<?= $dbrow; ?>[display][list_hideon_cat]" value="<?= $list_hideon_cat ?>" id="list_hideon_cat" type="text" class="input-margin">
|
229 |
-
<label for="list_hideon_cat"><?php _e( 'Hide on this Category posts' , 'click-to-chat-for-whatsapp' ) ?>
|
230 |
<p class="description"><?php _e( 'Hides on this Category type pages, Add multiple Categories by separating with a comma ( , ) ', 'click-to-chat-for-whatsapp' ); ?></p>
|
231 |
</div>
|
232 |
</div>
|
@@ -235,13 +233,25 @@ foreach ($show_hide_settings as $key => $value) {
|
|
235 |
<div class="row show_settings">
|
236 |
<div class="input-field col s7">
|
237 |
<input name="<?= $dbrow; ?>[display][list_showon_cat]" value="<?= $list_showon_cat ?>" id="ccw_list_cat_toshow" type="text" class="input-margin">
|
238 |
-
<label for="ccw_list_cat_toshow"><?php _e( 'Show on this Category posts' , 'click-to-chat-for-whatsapp' ) ?>
|
239 |
<p class="description"><?php _e( 'Show on this Category type pages, Add multiple Categories by separating with a comma ( , )', 'click-to-chat-for-whatsapp' ); ?> </p>
|
240 |
</div>
|
241 |
</div>
|
242 |
|
243 |
|
244 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
if ( 'chat' == $type ) {
|
246 |
do_action('ht_ctc_ah_admin_chat_after_showhide');
|
247 |
}
|
@@ -258,4 +268,4 @@ do_action('ht_ctc_ah_admin_after_showhide');
|
|
258 |
|
259 |
</div>
|
260 |
</li>
|
261 |
-
|
13 |
|
14 |
?>
|
15 |
|
16 |
+
<ul class="collapsible ht_ctc_show_hide_settings">
|
17 |
+
<li class="">
|
18 |
<div class="collapsible-header" id="showhide_settings"><?php _e( 'Display Settings', 'click-to-chat-for-whatsapp' ); ?></div>
|
19 |
<div class="collapsible-body">
|
20 |
|
27 |
do_action('ht_ctc_ah_admin_before_showhide');
|
28 |
|
29 |
$show_hide_settings = array(
|
|
|
30 |
'home' => 'Home Page',
|
|
|
31 |
'posts' => 'Posts',
|
32 |
'pages' => 'Pages',
|
|
|
33 |
'archive' => 'Archive pages',
|
34 |
'category' => 'Category pages',
|
|
|
35 |
'page_404' => '404 Page',
|
|
|
36 |
);
|
37 |
|
38 |
// woocommerce
|
183 |
<p class="col s3 m3 l2 global_box">
|
184 |
<label>
|
185 |
<input name="<?= $dbrow; ?>[display][<?= $key; ?>]" value="g" type="radio" <?php checked( '' == $is_checked_show_hide || 'g' == $is_checked_show_hide ); ?> class="with-gap global_btn <?= $key; ?>"/>
|
186 |
+
<span class="ctc_radio_text"><?php _e( 'Global', 'click-to-chat-for-whatsapp' ); ?>
|
187 |
+
<span class="global_show_or_hide_label"></span>
|
188 |
+
<span class="global_show_or_hide_icon"></span>
|
189 |
+
</span>
|
190 |
</label>
|
191 |
</p>
|
192 |
</div>
|
205 |
<div class="row hide_settings">
|
206 |
<div class="input-field col s7">
|
207 |
<input name="<?= $dbrow; ?>[display][list_hideon_pages]" value="<?= $list_hideon_pages ?>" id="ccw_list_id_tohide" type="text" class="input-margin">
|
208 |
+
<label for="ccw_list_id_tohide"><?php _e( "Hide on this pages", 'click-to-chat-for-whatsapp' ); ?> <span class="dashicons dashicons-hidden"></span></label>
|
209 |
<p class="description"><?php _e( "Add post id's to hide. Add multiple post id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
|
210 |
</div>
|
211 |
</div>
|
212 |
|
213 |
+
<!-- ID's list to show styles -->
|
214 |
<div class="row show_settings">
|
215 |
<div class="input-field col s7">
|
216 |
<input name="<?= $dbrow; ?>[display][list_showon_pages]" value="<?= $list_showon_pages ?>" id="ccw_list_id_toshow" type="text" class="input-margin">
|
217 |
+
<label for="ccw_list_id_toshow"><?php _e( "Show on this pages", 'click-to-chat-for-whatsapp' ); ?> <span class="dashicons dashicons-visibility"></span></label>
|
218 |
<p class="description"><?php _e( "Add Post, Page, Media - ID's to show styles, Add multiple id's by separating with a comma ( , )", 'click-to-chat-for-whatsapp' ); ?></p>
|
219 |
</div>
|
220 |
</div>
|
224 |
<div class="row hide_settings">
|
225 |
<div class="input-field col s7">
|
226 |
<input name="<?= $dbrow; ?>[display][list_hideon_cat]" value="<?= $list_hideon_cat ?>" id="list_hideon_cat" type="text" class="input-margin">
|
227 |
+
<label for="list_hideon_cat"><?php _e( 'Hide on this Category posts' , 'click-to-chat-for-whatsapp' ) ?> <span class="dashicons dashicons-hidden"></span></label>
|
228 |
<p class="description"><?php _e( 'Hides on this Category type pages, Add multiple Categories by separating with a comma ( , ) ', 'click-to-chat-for-whatsapp' ); ?></p>
|
229 |
</div>
|
230 |
</div>
|
233 |
<div class="row show_settings">
|
234 |
<div class="input-field col s7">
|
235 |
<input name="<?= $dbrow; ?>[display][list_showon_cat]" value="<?= $list_showon_cat ?>" id="ccw_list_cat_toshow" type="text" class="input-margin">
|
236 |
+
<label for="ccw_list_cat_toshow"><?php _e( 'Show on this Category posts' , 'click-to-chat-for-whatsapp' ) ?> <span class="dashicons dashicons-visibility"></span></label>
|
237 |
<p class="description"><?php _e( 'Show on this Category type pages, Add multiple Categories by separating with a comma ( , )', 'click-to-chat-for-whatsapp' ); ?> </p>
|
238 |
</div>
|
239 |
</div>
|
240 |
|
241 |
|
242 |
<?php
|
243 |
+
|
244 |
+
if ( !defined('HT_CTC_PRO_VERSION') && isset($type) && 'chat' == $type ) {
|
245 |
+
?>
|
246 |
+
<div class="ctc_pro_content" style="margin-bottom: 25px;">
|
247 |
+
<p class="description">Display After Time Delay</p>
|
248 |
+
<p class="description">Display After User Scroll</p>
|
249 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO</a></p>
|
250 |
+
</div>
|
251 |
+
|
252 |
+
<?php
|
253 |
+
}
|
254 |
+
|
255 |
if ( 'chat' == $type ) {
|
256 |
do_action('ht_ctc_ah_admin_chat_after_showhide');
|
257 |
}
|
268 |
|
269 |
</div>
|
270 |
</li>
|
271 |
+
</ul>
|
new/admin/admin_commons/admin-sidebar-content.php
CHANGED
@@ -14,24 +14,53 @@ $othersettings = get_option('ht_ctc_othersettings');
|
|
14 |
|
15 |
<div class="col s12 m8 l12 xl12">
|
16 |
<div class="row">
|
17 |
-
<ul class="collapsible popout">
|
18 |
<li class="active">
|
19 |
-
<
|
20 |
-
|
21 |
-
<
|
22 |
-
|
23 |
-
<p class="description"><?php _e( 'Please let us know if you have any suggestions or feedback!!', 'click-to-chat-for-whatsapp' ); ?> <br><br> <a href="http://api.whatsapp.com/send?phone=919494429789&text=<?= get_bloginfo('url'); ?>%0AHi%20HoliThemes,%0AI%20have%20a%20Suggestion/Feedback:" target="_blank"><?php _e( 'WhatsApp', 'click-to-chat-for-whatsapp' ); ?></a></p>
|
24 |
-
<p class="description"><?php _e( 'Mail', 'click-to-chat-for-whatsapp' ); ?>:<a href="mailto: ctc@holithemes.com"> ctc@holithemes.com</a></p>
|
25 |
-
<p class="description">GitHub <a target="_blank" href="https://github.com/holithemes/click-to-chat/discussions"> Discussions</a></p>
|
26 |
-
<?php
|
27 |
-
do_action('ht_ctc_ah_admin_sidebar_contact' );
|
28 |
-
?>
|
29 |
-
</div>
|
30 |
-
</li>
|
31 |
-
</ul>
|
32 |
</li>
|
33 |
</ul>
|
34 |
</div>
|
35 |
</div>
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
</div>
|
14 |
|
15 |
<div class="col s12 m8 l12 xl12">
|
16 |
<div class="row">
|
17 |
+
<ul class="collapsible popout ht_ctc_sidebar_contat">
|
18 |
<li class="active">
|
19 |
+
<div class="collapsible-header"><?php _e( 'Contact Us', 'click-to-chat-for-whatsapp' ); ?></div>
|
20 |
+
<div class="collapsible-body">
|
21 |
+
<p class="description"><?php _e( 'For any queries, suggestions', 'click-to-chat-for-whatsapp' ); ?>. <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/support/">Contact Us</a></p>
|
22 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
</li>
|
24 |
</ul>
|
25 |
</div>
|
26 |
</div>
|
27 |
|
28 |
+
<?php
|
29 |
+
do_action('ht_ctc_ah_admin_sidebar_contact' );
|
30 |
+
|
31 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
32 |
+
?>
|
33 |
+
<div class="col s12 m8 l12 xl12">
|
34 |
+
<div class="row">
|
35 |
+
<ul class="collapsible popout ht_ctc_sidebar_contat">
|
36 |
+
<li class="active">
|
37 |
+
<div class="collapsible-header"><?php _e( 'PRO', 'click-to-chat-for-whatsapp' ); ?></div>
|
38 |
+
<div class="collapsible-body">
|
39 |
+
<p class="description">Random Numbers</p>
|
40 |
+
<p class="description">Hide based on selected days in a week</p>
|
41 |
+
<p class="description">Hide based on selected time range in a day</p>
|
42 |
+
<p class="description">Change WhatsApp number when offline</p>
|
43 |
+
<p class="description">Change Call to Action when offline</p>
|
44 |
+
<p class="description">Fixed/Absolute Position types</p>
|
45 |
+
<p class="description">Display after Time delay</p>
|
46 |
+
<p class="description">Display after User page Scroll percentage</p>
|
47 |
+
<p class="description">Display only to logged-in users</p>
|
48 |
+
<p class="description">Webhooks - dynamic variables</p>
|
49 |
+
<p class="description">Google Ads Conversion</p>
|
50 |
+
<p class="description">Add WhatsApp in WooCommerce Product pages</p>
|
51 |
+
<p class="description">More features coming soon ..</p>
|
52 |
+
|
53 |
+
<p class="description" style="text-align: center; margin-top: 20px;"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/" class="waves-effect waves-light btn" style="width: 100%;">PRO Version</a></p>
|
54 |
+
|
55 |
+
</div>
|
56 |
+
</li>
|
57 |
+
</ul>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
<?php
|
61 |
+
}
|
62 |
+
|
63 |
+
?>
|
64 |
+
|
65 |
+
|
66 |
</div>
|
new/admin/admin_commons/class-ht-ctc-admin-hooks.php
CHANGED
@@ -28,6 +28,8 @@ class HT_CTC_Admin_Others {
|
|
28 |
add_action( 'load-click-to-chat_page_click-to-chat-customize-styles', array( $this, 'ctc_admin_pages') );
|
29 |
add_action( 'load-click-to-chat_page_click-to-chat-other-settings', array( $this, 'ctc_admin_pages') );
|
30 |
add_action( 'load-click-to-chat_page_click-to-chat-woocommerce', array( $this, 'ctc_admin_pages') );
|
|
|
|
|
31 |
|
32 |
// admin notices
|
33 |
$this->admin_notice();
|
@@ -160,6 +162,86 @@ class HT_CTC_Admin_Others {
|
|
160 |
<?php
|
161 |
}
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
// clear cache after save settings.
|
164 |
function clear_cache() {
|
165 |
|
28 |
add_action( 'load-click-to-chat_page_click-to-chat-customize-styles', array( $this, 'ctc_admin_pages') );
|
29 |
add_action( 'load-click-to-chat_page_click-to-chat-other-settings', array( $this, 'ctc_admin_pages') );
|
30 |
add_action( 'load-click-to-chat_page_click-to-chat-woocommerce', array( $this, 'ctc_admin_pages') );
|
31 |
+
|
32 |
+
add_action( 'ht_ctc_ah_admin_scripts_start', [$this, 'dequeue'] );
|
33 |
|
34 |
// admin notices
|
35 |
$this->admin_notice();
|
162 |
<?php
|
163 |
}
|
164 |
|
165 |
+
|
166 |
+
/**
|
167 |
+
*
|
168 |
+
* runs in click to chat admin pages..
|
169 |
+
*
|
170 |
+
* @source ht_ctc_ah_admin_scripts_start - hook..
|
171 |
+
*/
|
172 |
+
function dequeue() {
|
173 |
+
|
174 |
+
// As now only if in &special mode
|
175 |
+
if ( isset($_GET) && isset($_GET['special']) ) {
|
176 |
+
|
177 |
+
add_action( 'wp_print_scripts', [$this, 'dequeue_scripts'] );
|
178 |
+
|
179 |
+
// add_action( 'wp_print_scripts', [$this, 'dequeue_styles'] );
|
180 |
+
add_action( 'admin_enqueue_scripts', [$this, 'dequeue_styles'], 99 );
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
// dequeue scripts to avioid conflicts..
|
185 |
+
function dequeue_scripts() {
|
186 |
+
|
187 |
+
global $wp_scripts;
|
188 |
+
$scripts = [];
|
189 |
+
|
190 |
+
foreach( $wp_scripts->queue as $handle ) {
|
191 |
+
// $scripts[] = $wp_scripts->registered[$handle];
|
192 |
+
$scripts[$handle] = $wp_scripts->registered[$handle]->src;
|
193 |
+
}
|
194 |
+
|
195 |
+
$plugin = "/plugins/";
|
196 |
+
$ctc_plugin = "/plugins/click-to-chat";
|
197 |
+
|
198 |
+
foreach ($scripts as $handle => $src) {
|
199 |
+
|
200 |
+
if ( false === strpos( $src, $ctc_plugin ) ) {
|
201 |
+
// exclude click to chat plugin
|
202 |
+
|
203 |
+
if ( false !== strpos( $src, $plugin ) ) {
|
204 |
+
wp_dequeue_script( $handle );
|
205 |
+
}
|
206 |
+
}
|
207 |
+
|
208 |
+
}
|
209 |
+
|
210 |
+
}
|
211 |
+
|
212 |
+
|
213 |
+
// dequeue scripts to avioid conflicts..
|
214 |
+
function dequeue_styles() {
|
215 |
+
|
216 |
+
global $wp_styles;
|
217 |
+
|
218 |
+
$styles = [];
|
219 |
+
|
220 |
+
foreach( $wp_styles->queue as $handle ) {
|
221 |
+
$styles[$handle] = $wp_styles->registered[$handle]->src;
|
222 |
+
}
|
223 |
+
|
224 |
+
$plugin = "/plugins/";
|
225 |
+
$ctc_plugin = "/plugins/click-to-chat";
|
226 |
+
|
227 |
+
foreach ($styles as $handle => $src) {
|
228 |
+
|
229 |
+
if ( false === strpos( $src, $ctc_plugin ) ) {
|
230 |
+
// exclude click to chat plugin
|
231 |
+
|
232 |
+
if ( false !== strpos( $src, $plugin ) ) {
|
233 |
+
wp_dequeue_style( $handle );
|
234 |
+
}
|
235 |
+
}
|
236 |
+
|
237 |
+
}
|
238 |
+
|
239 |
+
}
|
240 |
+
|
241 |
+
|
242 |
+
|
243 |
+
|
244 |
+
|
245 |
// clear cache after save settings.
|
246 |
function clear_cache() {
|
247 |
|
new/admin/admin_commons/class-ht-ctc-static.php
DELETED
@@ -1,274 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Static values
|
4 |
-
*
|
5 |
-
* country codes
|
6 |
-
*
|
7 |
-
* @included - as of now directly at admin-main-page.php
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
if ( ! defined( 'ABSPATH' ) ) exit;
|
12 |
-
|
13 |
-
if ( ! class_exists( 'HT_CTC_Static' ) ) :
|
14 |
-
|
15 |
-
class HT_CTC_Static {
|
16 |
-
|
17 |
-
// Country code list - uses as datalayer at admin whatsapp number country code field
|
18 |
-
// todo - make as an associative array in duplicate country codes..
|
19 |
-
static $cc = array(
|
20 |
-
'93' => 'Afghanistan (AF)',
|
21 |
-
'355' => 'Albania (AL)',
|
22 |
-
'213' => 'Algeria (DZ)',
|
23 |
-
'1684' => 'American Samoa (AS)',
|
24 |
-
'376' => 'Andorra (AD)',
|
25 |
-
'244' => 'Angola (AO)',
|
26 |
-
'1264' => 'Anguilla (AI)',
|
27 |
-
'1268' => 'Antigua and Barbuda (AG)',
|
28 |
-
'54' => 'Argentina (AR)',
|
29 |
-
'374' => 'Armenia (AM)',
|
30 |
-
'297' => 'Aruba (AW)',
|
31 |
-
'247' => 'Ascension Island (AC)',
|
32 |
-
|
33 |
-
'64' => array('Antarctica (AQ)', 'New Zealand (NZ)'),
|
34 |
-
'672' => array('Antarctica (AQ)', 'Norfolk Island (NF)' ),
|
35 |
-
'61' => array('Australia (AU)', 'Christmas Island (CX)', 'Cocos(Keeling) Islands (CC)' ),
|
36 |
-
|
37 |
-
'43' => 'Austria (AT)',
|
38 |
-
'994' => 'Azerbaijan (AZ)',
|
39 |
-
'1242' => 'Bahamas (BS)',
|
40 |
-
'973' => 'Bahrain (BH)',
|
41 |
-
'880' => 'Bangladesh (BD)',
|
42 |
-
'1246' => 'Barbados (BB)',
|
43 |
-
'375' => 'Belarus (BY)',
|
44 |
-
'32' => 'Belgium (BE)',
|
45 |
-
'501' => 'Belize (BZ)',
|
46 |
-
'229' => 'Benin (BJ)',
|
47 |
-
'1441' => 'Bermuda (BM)',
|
48 |
-
'975' => 'Bhutan (BT)',
|
49 |
-
'591' => 'Bolivia (BO)',
|
50 |
-
'387' => 'Bosnia and Herzegovina (BA)',
|
51 |
-
'267' => 'Botswana (BW)',
|
52 |
-
'55' => 'Brazil (BR)',
|
53 |
-
'1284' => 'British Virgin Islands (VG)',
|
54 |
-
'673' => 'Brunei (BN)',
|
55 |
-
'359' => 'Bulgaria (BG)',
|
56 |
-
'226' => 'Burkina Faso (BF)',
|
57 |
-
'95' => 'Burma (Myanmar) (MM)',
|
58 |
-
'257' => 'Burundi (BI)',
|
59 |
-
'855' => 'Cambodia (KH)',
|
60 |
-
'237' => 'Cameroon (CM)',
|
61 |
-
'1' => 'Canada (CA)',
|
62 |
-
'238' => 'Cape Verde (CV)',
|
63 |
-
'1345' => 'Cayman Islands (KY)',
|
64 |
-
'236' => 'Central African Republic (CF)',
|
65 |
-
'235' => 'Chad (TD)',
|
66 |
-
'56' => 'Chile (CL)',
|
67 |
-
'86' => 'China (CN)',
|
68 |
-
|
69 |
-
'57' => 'Colombia (CO)',
|
70 |
-
'269' => 'Comoros (KM)',
|
71 |
-
'242' => 'Congo (CG)',
|
72 |
-
'682' => 'Cook Islands (CK)',
|
73 |
-
'506' => 'Costa Rica (CR)',
|
74 |
-
'385' => 'Croatia (HR)',
|
75 |
-
'53' => 'Cuba (CU)',
|
76 |
-
'357' => ' Cyprus (CY)',
|
77 |
-
'420' => 'Czech Republic (CZ)',
|
78 |
-
'243' => 'Republic of the Congo (CD)',
|
79 |
-
'45' => 'Denmark (DK)',
|
80 |
-
'246' => 'Diego Garcia (DG/DGA)',
|
81 |
-
'253' => 'Djibouti (DJ)',
|
82 |
-
'1767' => 'Dominica (DM)',
|
83 |
-
'1809' => ' Dominican Republic (DO)',
|
84 |
-
'1829' => ' Dominican Republic (DO)',
|
85 |
-
'1849' => ' Dominican Republic (DO)',
|
86 |
-
'593' => 'Ecuador (EC)',
|
87 |
-
'20' => 'Egypt (EG)',
|
88 |
-
'503' => 'El Salvador (SV)',
|
89 |
-
'240' => 'Equatorial Guinea (GQ)',
|
90 |
-
'291' => ' Eritrea (ER)',
|
91 |
-
'372' => 'Estonia (EE)',
|
92 |
-
'251' => 'Ethiopia (ET)',
|
93 |
-
'500' => 'Falkland Islands (FK)',
|
94 |
-
'298' => 'Faroe Islands (FO)',
|
95 |
-
'679' => 'Fiji (FJ)',
|
96 |
-
'358' => 'Finland (FI)',
|
97 |
-
'33' => 'France (FR)',
|
98 |
-
'594' => 'French Guiana (GF)',
|
99 |
-
'689' => 'French Polynesia (PF)',
|
100 |
-
'241' => 'Gabon (GA)',
|
101 |
-
'220' => 'Gambia (GM)',
|
102 |
-
'995' => 'Georgia (GE)',
|
103 |
-
'49' => 'Germany (DE)',
|
104 |
-
'233' => 'Ghana (GH)',
|
105 |
-
'350' => 'Gibraltar (GI)',
|
106 |
-
'30' => 'Greece (GR)',
|
107 |
-
'299' => 'Greenland (GL)',
|
108 |
-
'1473' => 'Grenada (GD)',
|
109 |
-
'590' => 'Guadeloupe (GP)',
|
110 |
-
'1671' => 'Guam (GU)',
|
111 |
-
'502' => 'Guatemala (GT)',
|
112 |
-
'224' => 'Guinea (GN)',
|
113 |
-
'245' => 'Guinea-Bissau (GW)',
|
114 |
-
'592' => 'Guyana (GY)',
|
115 |
-
'509' => 'Haiti (HT)',
|
116 |
-
'39' => 'Holy See (Vatican City)(VA)',
|
117 |
-
'504' => 'Honduras (HN)',
|
118 |
-
'852' => 'Hong Kong (HK)',
|
119 |
-
'36' => 'Hungary (HU)',
|
120 |
-
'354' => 'Iceland (IS)',
|
121 |
-
'91' => 'India (Bharat)',
|
122 |
-
'62' => 'Indonesia (ID)',
|
123 |
-
'98' => 'Iran (IR)',
|
124 |
-
'964' => 'Iraq (IQ)',
|
125 |
-
'353' => 'Ireland (IE)',
|
126 |
-
'44' => 'Isle of Man (IM)',
|
127 |
-
'972' => 'Israel (IL)',
|
128 |
-
'39' => 'Italy (IT)',
|
129 |
-
'225' => 'Ivory Coast(Côte d\'Ivoire)(CI)',
|
130 |
-
'1876' => 'Jamaica (JM)',
|
131 |
-
'81' => 'Japan (JP)',
|
132 |
-
'44' => 'Jersey (JE)',
|
133 |
-
'962' => 'Jordan (JO)',
|
134 |
-
'7' => 'Kazakhstan (KZ)',
|
135 |
-
'254' => 'Kenya (KE)',
|
136 |
-
'686' => 'Kiribati (KI)',
|
137 |
-
'965' => 'Kuwait (KW)',
|
138 |
-
'996' => 'Kyrgyzstan (KG)',
|
139 |
-
'856' => 'Laos (LA)',
|
140 |
-
'371' => 'Latvia (LV)',
|
141 |
-
'961' => 'Lebanon (LB)',
|
142 |
-
'266' => 'Lesotho (LS)',
|
143 |
-
'231' => 'Liberia (LR)',
|
144 |
-
'218' => 'Libya (LY)',
|
145 |
-
'423' => 'Liechtenstein (LI)',
|
146 |
-
'370' => 'Lithuania (LT)',
|
147 |
-
'352' => 'Luxembourg (LU)',
|
148 |
-
'853' => 'Macau (MO)',
|
149 |
-
'389' => 'Macedonia (MK)',
|
150 |
-
'261' => 'Madagascar (MG)',
|
151 |
-
'265' => 'Malawi (MW)',
|
152 |
-
'60' => 'Malaysia (MY)',
|
153 |
-
'960' => 'Maldives (MV)',
|
154 |
-
'223' => 'Mali (ML)',
|
155 |
-
'356' => 'Malta (MT)',
|
156 |
-
'692' => 'Marshall Islands (MH)',
|
157 |
-
'596' => 'Martinique (MQ)',
|
158 |
-
'222' => 'Mauritania (MR)',
|
159 |
-
'230' => 'Mauritius (MU)',
|
160 |
-
'262' => 'Mayotte (YT)',
|
161 |
-
'52' => 'Mexico (MX)',
|
162 |
-
'691' => 'Micronesia (FM)',
|
163 |
-
'373' => 'Moldova (MD)',
|
164 |
-
'377' => 'Monaco (MC)',
|
165 |
-
'976' => 'Mongolia (MN)',
|
166 |
-
'382' => 'Montenegro (ME)',
|
167 |
-
'1664' => 'Montserrat (MS)',
|
168 |
-
'212' => 'Morocco (MA)',
|
169 |
-
'258' => 'Mozambique (MZ)',
|
170 |
-
'264' => 'Namibia (NA)',
|
171 |
-
'674' => 'Nauru (NR)',
|
172 |
-
'977' => 'Nepal (NP)',
|
173 |
-
'31' => 'Netherlands (NL)',
|
174 |
-
'599' => 'Netherlands Antilles (AN)',
|
175 |
-
'687' => 'New Caledonia (NC)',
|
176 |
-
'505' => 'Nicaragua (NI)',
|
177 |
-
'227' => 'Niger (NE)',
|
178 |
-
'234' => 'Nigeria (NG)',
|
179 |
-
'683' => 'Niue (NU)',
|
180 |
-
'850' => 'North Korea (KP)',
|
181 |
-
'1670' => 'Northern Mariana Islands (MP)',
|
182 |
-
'47' => 'Norway (NO)',
|
183 |
-
'968' => 'Oman (OM)',
|
184 |
-
'92' => 'Pakistan (PK)',
|
185 |
-
'680' => 'Palau (PW)',
|
186 |
-
'970' => 'Palestine (PS)',
|
187 |
-
'507' => 'Panama (PA)',
|
188 |
-
'675' => 'Papua New Guinea (PG)',
|
189 |
-
'595' => 'Paraguay (PY)',
|
190 |
-
'51' => 'Peru (PE)',
|
191 |
-
'63' => 'Philippines (PH)',
|
192 |
-
'870' => 'Pitcairn Islands (PN)',
|
193 |
-
'48' => 'Poland (PL)',
|
194 |
-
'351' => 'Portugal (PT)',
|
195 |
-
'1787' => 'Puerto Rico (PR)',
|
196 |
-
'1939' => 'Puerto Rico (PR)',
|
197 |
-
'974' => 'Qatar (QA)',
|
198 |
-
'242' => 'Republic of the Congo (CG)',
|
199 |
-
'262' => 'Reunion Island (RE)',
|
200 |
-
'40' => 'Romania (RO)',
|
201 |
-
'7' => 'Russia (RU)',
|
202 |
-
'250' => 'Rwanda (RW)',
|
203 |
-
'590' => 'Saint Barthelemy (BL)',
|
204 |
-
'290' => 'Saint Helena (SH)',
|
205 |
-
'1869' => 'Saint Kitts and Nevis (KN)',
|
206 |
-
'1758' => 'Saint Lucia (LC)',
|
207 |
-
'590' => 'Saint Martin (MF)',
|
208 |
-
'508' => 'Saint Pierre and Miquelon (PM)',
|
209 |
-
'1784' => 'Saint Vincent Grenadines(VC)',
|
210 |
-
'685' => 'Samoa (WS)',
|
211 |
-
'378' => 'San Marino (SM)',
|
212 |
-
'239' => 'Sao Tome and Principe (ST)',
|
213 |
-
'966' => 'Saudi Arabia (SA)',
|
214 |
-
'221' => 'Senegal (SN)',
|
215 |
-
'381' => 'Serbia (RS)',
|
216 |
-
'248' => 'Seychelles (SC)',
|
217 |
-
'232' => 'Sierra Leone (SL)',
|
218 |
-
'65' => 'Singapore (SG)',
|
219 |
-
'1721' => 'Sint Maarten (SX)',
|
220 |
-
'421' => 'Slovakia (SK)',
|
221 |
-
'386' => 'Slovenia (SI)',
|
222 |
-
'677' => 'Solomon Islands (SB)',
|
223 |
-
'252' => 'Somalia (SO)',
|
224 |
-
'27' => 'South Africa (ZA)',
|
225 |
-
'82' => 'South Korea (KR)',
|
226 |
-
'211' => 'South Sudan (SS)',
|
227 |
-
'34' => 'Spain (España) (ES)',
|
228 |
-
'94' => 'Sri Lanka (LK)',
|
229 |
-
'249' => 'Sudan (SD)',
|
230 |
-
'597' => 'Suriname (SR)',
|
231 |
-
'47' => 'Svalbard (SJ)',
|
232 |
-
'268' => 'Swaziland (SZ)',
|
233 |
-
'46' => 'Sweden (SE)',
|
234 |
-
'41' => 'Switzerland (CH)',
|
235 |
-
'963' => 'Syria (SY)',
|
236 |
-
'886' => 'Taiwan (TW)',
|
237 |
-
'992' => 'Tajikistan (TJ)',
|
238 |
-
'255' => 'Tanzania (TZ)',
|
239 |
-
'66' => 'Thailand (TH)',
|
240 |
-
'670' => 'Timor-Leste (East Timor) (TL)',
|
241 |
-
'228' => 'Togo (TG)',
|
242 |
-
'690' => 'Tokelau (TK)',
|
243 |
-
'676' => 'Tonga Islands (TO)',
|
244 |
-
'1868' => 'Trinidad and Tobago (TT)',
|
245 |
-
'216' => 'Tunisia (TN)',
|
246 |
-
'90' => 'Turkey (TR)',
|
247 |
-
'993' => 'Turkmenistan (TM)',
|
248 |
-
'1649' => 'Turks and Caicos Islands (TC)',
|
249 |
-
'688' => 'Tuvalu (TV)',
|
250 |
-
'256' => 'Uganda (UG)',
|
251 |
-
'380' => 'Ukraine (UA)',
|
252 |
-
'971' => 'United Arab Emirates (AE)',
|
253 |
-
'44' => 'United Kingdom (GB)',
|
254 |
-
'1' => 'United States (US)',
|
255 |
-
'598' => 'Uruguay (UY)',
|
256 |
-
'1340' => 'US Virgin Islands (VI)',
|
257 |
-
'998' => 'Uzbekistan (UZ)',
|
258 |
-
'678' => 'Vanuatu (VU)',
|
259 |
-
'58' => 'Venezuela (VE)',
|
260 |
-
'84' => 'Vietnam (VN)',
|
261 |
-
'681' => 'Wallis and Futuna (WF)',
|
262 |
-
'212' => 'Western Sahara (EH)',
|
263 |
-
'967' => 'Yemen (YE)',
|
264 |
-
'260' => 'Zambia (ZM)',
|
265 |
-
'263' => 'Zimbabwe (ZW)',
|
266 |
-
);
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
}
|
271 |
-
|
272 |
-
new HT_CTC_Static();
|
273 |
-
|
274 |
-
endif; // END class_exists check
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new/admin/admin_commons/ht-ctc-admin-formatting.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Formatting API - Admin related.
|
4 |
+
*
|
5 |
+
* Encode emoji..
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Encoding emoji
|
12 |
+
*
|
13 |
+
* To check the charset and run
|
14 |
+
* @uses wp_encode_emoji
|
15 |
+
*
|
16 |
+
* @since 3.3.5
|
17 |
+
* @param string $value input value to convert emojis to html entity
|
18 |
+
*/
|
19 |
+
if ( ! function_exists('ht_ctc_wp_encode_emoji') ) {
|
20 |
+
function ht_ctc_wp_encode_emoji($value = '') {
|
21 |
+
|
22 |
+
if ( defined('DB_CHARSET') && 'utf8' == DB_CHARSET ) {
|
23 |
+
|
24 |
+
if (function_exists('wp_encode_emoji')) {
|
25 |
+
$value = wp_encode_emoji( $value );
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
return $value;
|
30 |
+
}
|
31 |
+
}
|
new/admin/admin_commons/ht-ctc-formatting.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @deprecated since 3.4 - Moved to - ht-ctc-admin-formatting.php
|
4 |
+
* remove this in v3.8 - duplicate: kept with initial file name also - to avoid cache issue..
|
5 |
+
*
|
6 |
+
*
|
7 |
+
* Formatting API
|
8 |
+
*
|
9 |
+
* Encode emoji..
|
10 |
+
* @since 3.3.5
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Encoding emoji
|
17 |
+
*
|
18 |
+
* To check the charset and run
|
19 |
+
* @uses wp_encode_emoji
|
20 |
+
*
|
21 |
+
* @since 3.3.5
|
22 |
+
* @param string $value input value to convert emojis to html entity
|
23 |
+
*/
|
24 |
+
if ( ! function_exists('ht_ctc_wp_encode_emoji') ) {
|
25 |
+
function ht_ctc_wp_encode_emoji($value = '') {
|
26 |
+
|
27 |
+
if ( defined('DB_CHARSET') && 'utf8' == DB_CHARSET ) {
|
28 |
+
|
29 |
+
if (function_exists('wp_encode_emoji')) {
|
30 |
+
$value = wp_encode_emoji( $value );
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
return $value;
|
35 |
+
}
|
36 |
+
}
|
new/admin/class-ht-ctc-admin-customize-styles.php
CHANGED
@@ -12,65 +12,14 @@ if ( ! class_exists( 'HT_CTC_Admin_Customize_Styles' ) ) :
|
|
12 |
|
13 |
class HT_CTC_Admin_Customize_Styles {
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
* sf_class - settings field class names
|
18 |
-
*/
|
19 |
-
public $s1_class = '';
|
20 |
-
public $s2_class = '';
|
21 |
-
public $s3_class = '';
|
22 |
-
public $s3_1_class = '';
|
23 |
-
public $s4_class = '';
|
24 |
-
public $s5_class = '';
|
25 |
-
public $s6_class = '';
|
26 |
-
public $s7_class = '';
|
27 |
-
public $s7_1_class = '';
|
28 |
-
public $s8_class = '';
|
29 |
-
public $s99_class = '';
|
30 |
-
public $cs_class = '';
|
31 |
-
|
32 |
// public function __construct() {
|
33 |
// // $this->this_variables();
|
34 |
// }
|
35 |
|
36 |
-
public function this_variables() {
|
37 |
-
|
38 |
-
$ht_ctc_othersettings = get_option('ht_ctc_othersettings');
|
39 |
-
$ht_ctc_chat = get_option('ht_ctc_chat_options');
|
40 |
-
$ht_ctc_cs = get_option('ht_ctc_cs_options');
|
41 |
-
|
42 |
-
// if group or share enable display on all.
|
43 |
-
if ( isset($ht_ctc_othersettings['enable_group']) || isset($ht_ctc_othersettings['enable_share']) ) {
|
44 |
-
$this->sf_class = "ht_ctc_display";
|
45 |
-
$this->cs_class .= 'ht_ctc_display_none';
|
46 |
-
} else {
|
47 |
-
// only chat enabled.
|
48 |
-
|
49 |
-
if ( !isset( $ht_ctc_cs['display_allstyles'] ) ) {
|
50 |
-
|
51 |
-
$style_d = (isset($ht_ctc_chat['style_desktop'])) ? esc_attr($ht_ctc_chat['style_desktop']) : '';
|
52 |
-
$style_m = (isset($ht_ctc_chat['style_mobile'])) ? esc_attr($ht_ctc_chat['style_mobile']) : '';
|
53 |
-
|
54 |
-
$this->s1_class .= ( '1' == $style_d || '1' == $style_m ) ? '' : 'ht_ctc_display_none';
|
55 |
-
$this->s2_class .= ( '2' == $style_d || '2' == $style_m ) ? '' : 'ht_ctc_display_none';
|
56 |
-
$this->s3_class .= ( '3' == $style_d || '3' == $style_m ) ? '' : 'ht_ctc_display_none';
|
57 |
-
$this->s3_1_class .= ( '3_1' == $style_d || '3_1' == $style_m ) ? '' : 'ht_ctc_display_none';
|
58 |
-
$this->s4_class .= ( '4' == $style_d || '4' == $style_m ) ? '' : 'ht_ctc_display_none';
|
59 |
-
$this->s5_class .= ( '5' == $style_d || '5' == $style_m ) ? '' : 'ht_ctc_display_none';
|
60 |
-
$this->s6_class .= ( '6' == $style_d || '6' == $style_m ) ? '' : 'ht_ctc_display_none';
|
61 |
-
$this->s7_class .= ( '7' == $style_d || '7' == $style_m ) ? '' : 'ht_ctc_display_none';
|
62 |
-
$this->s7_1_class .= ( '7_1' == $style_d || '7_1' == $style_m ) ? '' : 'ht_ctc_display_none';
|
63 |
-
$this->s8_class .= ( '8' == $style_d || '8' == $style_m ) ? '' : 'ht_ctc_display_none';
|
64 |
-
$this->s99_class .= ( '99' == $style_d || '99' == $style_m ) ? '' : 'ht_ctc_display_none';
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
}
|
69 |
-
|
70 |
public function menu() {
|
71 |
|
72 |
-
$this->this_variables();
|
73 |
-
|
74 |
add_submenu_page(
|
75 |
'click-to-chat',
|
76 |
'Customize',
|
@@ -115,35 +64,98 @@ class HT_CTC_Admin_Customize_Styles {
|
|
115 |
|
116 |
public function settings() {
|
117 |
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_cs_options' , array( $this, 'options_sanitize' ) );
|
130 |
-
|
131 |
add_settings_section( 'ht_ctc_cs_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_cs_page_settings_sections_do' );
|
132 |
-
|
133 |
-
add_settings_field
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
|
149 |
public function main_settings_section_cb() {
|
@@ -168,31 +180,29 @@ class HT_CTC_Admin_Customize_Styles {
|
|
168 |
$count = ( isset( $options['count']) ) ? esc_attr( $options['count'] ) : '1';
|
169 |
$count++;
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
?>
|
172 |
<!-- not make empty table -->
|
173 |
<input name="<?= $dbrow; ?>[count]" value="<?= $count; ?>" type="hidden" class="hide" >
|
174 |
|
175 |
-
|
176 |
-
|
177 |
-
if ( isset( $options['display_allstyles'] ) ) {
|
178 |
-
?>
|
179 |
<p>
|
180 |
<label>
|
181 |
-
<input name="<?= $dbrow; ?>[display_allstyles]" type="checkbox" value="1" <?php checked( $
|
182 |
<span><?php _e( 'Display all Styles', 'click-to-chat-for-whatsapp' ); ?></span>
|
183 |
</label>
|
184 |
</p>
|
185 |
-
|
186 |
-
|
187 |
-
?>
|
188 |
-
<p>
|
189 |
-
<label>
|
190 |
-
<input name="<?= $dbrow; ?>[display_allstyles]" type="checkbox" value="1" id="display_allstyles" />
|
191 |
-
<span><?php _e( 'Display all Styles', 'click-to-chat-for-whatsapp' ); ?></span>
|
192 |
-
</label>
|
193 |
-
</p>
|
194 |
<?php
|
195 |
-
}
|
196 |
}
|
197 |
|
198 |
|
@@ -542,12 +552,15 @@ class HT_CTC_Admin_Customize_Styles {
|
|
542 |
</div>
|
543 |
<div class="input-field col s6">
|
544 |
<input class="ht-ctc-color" name="ht_ctc_s3_1[s3_bg_color_hover]" data-default-color="#25D366" value="<?= $s3_bg_color_hover; ?>" id="s3_bg_color_hover" type="text">
|
545 |
-
<p class="description"><?php _e( 'E.g.
|
546 |
</div>
|
547 |
</div>
|
548 |
<?php
|
549 |
|
550 |
// shadow
|
|
|
|
|
|
|
551 |
if ( isset( $options['s3_box_shadow'] ) ) {
|
552 |
?>
|
553 |
<p>
|
@@ -567,14 +580,20 @@ class HT_CTC_Admin_Customize_Styles {
|
|
567 |
</p>
|
568 |
<?php
|
569 |
}
|
|
|
|
|
|
|
570 |
|
571 |
// shadow on hover
|
|
|
|
|
|
|
572 |
if ( isset( $options['s3_box_shadow_hover'] ) ) {
|
573 |
?>
|
574 |
<p>
|
575 |
<label>
|
576 |
<input name="ht_ctc_s3_1[s3_box_shadow_hover]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow_hover'], 1 ); ?> id="s3_box_shadow_hover" />
|
577 |
-
<span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
|
578 |
</label>
|
579 |
</p>
|
580 |
<?php
|
@@ -583,14 +602,14 @@ class HT_CTC_Admin_Customize_Styles {
|
|
583 |
<p>
|
584 |
<label>
|
585 |
<input name="ht_ctc_s3_1[s3_box_shadow_hover]" type="checkbox" value="1" id="s3_box_shadow_hover" />
|
586 |
-
<span><?php _e( 'Shadow on Hover', 'click-to-chat-for-whatsapp' ); ?></span>
|
587 |
</label>
|
588 |
</p>
|
589 |
<?php
|
590 |
}
|
591 |
?>
|
592 |
-
|
593 |
-
<br
|
594 |
|
595 |
<?php
|
596 |
$select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
|
@@ -884,6 +903,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
884 |
<div class="input-field col s6">
|
885 |
<input name="ht_ctc_s5[s5_content_width]" value="<?= $s5_content_width ?>" id="s5_content_width" type="text" class="" >
|
886 |
<label for="s5_content_width"><?php _e( 'Content Box Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
|
|
887 |
</div>
|
888 |
</div>
|
889 |
|
@@ -1014,6 +1034,8 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1014 |
$cta_textcolor_hover = ( isset( $options['cta_textcolor_hover']) ) ? esc_attr( $options['cta_textcolor_hover'] ) : '';
|
1015 |
$cta_bgcolor = ( isset( $options['cta_bgcolor']) ) ? esc_attr( $options['cta_bgcolor'] ) : '';
|
1016 |
$cta_bgcolor_hover = ( isset( $options['cta_bgcolor_hover']) ) ? esc_attr( $options['cta_bgcolor_hover'] ) : '';
|
|
|
|
|
1017 |
?>
|
1018 |
<ul class="collapsible ht_ctc_s7" data-collapsible="accordion">
|
1019 |
<li>
|
@@ -1134,6 +1156,18 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1134 |
</div>
|
1135 |
</div>
|
1136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1137 |
</div>
|
1138 |
</div>
|
1139 |
</li>
|
@@ -1156,6 +1190,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1156 |
$s7_border_size = ( isset( $options['s7_border_size']) ) ? esc_attr( $options['s7_border_size'] ) : '';
|
1157 |
$s7_bgcolor = ( isset( $options['s7_bgcolor']) ) ? esc_attr( $options['s7_bgcolor'] ) : '';
|
1158 |
$s7_bgcolor_hover = ( isset( $options['s7_bgcolor_hover']) ) ? esc_attr( $options['s7_bgcolor_hover'] ) : '';
|
|
|
1159 |
|
1160 |
$select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
|
1161 |
|
@@ -1242,6 +1277,18 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1242 |
</div>
|
1243 |
</div>
|
1244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1245 |
|
1246 |
</div>
|
1247 |
</div>
|
@@ -1449,12 +1496,12 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1449 |
function ht_ctc_s99_cb() {
|
1450 |
|
1451 |
$options = get_option('ht_ctc_s99');
|
1452 |
-
$
|
1453 |
-
$
|
1454 |
-
$
|
1455 |
-
$
|
1456 |
-
$
|
1457 |
-
$
|
1458 |
?>
|
1459 |
<ul class="collapsible ht_ctc_s99" data-collapsible="accordion">
|
1460 |
<li>
|
@@ -1467,7 +1514,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1467 |
<p>Image URL</p>
|
1468 |
</div> -->
|
1469 |
<div class="input-field col s12">
|
1470 |
-
<input name="ht_ctc_s99[s99_dekstop_img_url]" value="<?= $
|
1471 |
<label for="s99_dekstop_img_url"><?php _e( 'Image URL - Desktop', 'click-to-chat-for-whatsapp' ); ?></label>
|
1472 |
</div>
|
1473 |
</div>
|
@@ -1478,7 +1525,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1478 |
<p>Image URL</p>
|
1479 |
</div> -->
|
1480 |
<div class="input-field col s12">
|
1481 |
-
<input name="ht_ctc_s99[s99_mobile_img_url]" value="<?= $
|
1482 |
<label for="s99_mobile_img_url"><?php _e( 'Image URL - Mobile', 'click-to-chat-for-whatsapp' ); ?></label>
|
1483 |
</div>
|
1484 |
</div>
|
@@ -1489,7 +1536,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1489 |
<p><?php _e( 'Desktop - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
1490 |
</div>
|
1491 |
<div class="input-field col s6">
|
1492 |
-
<input name="ht_ctc_s99[s99_desktop_img_height]" value="<?= $
|
1493 |
<label for="s99_desktop_img_height"><?php _e( 'Desktop - Image Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
1494 |
</div>
|
1495 |
</div>
|
@@ -1500,7 +1547,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1500 |
<p><?php _e( 'Desktop - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
1501 |
</div>
|
1502 |
<div class="input-field col s6">
|
1503 |
-
<input name="ht_ctc_s99[s99_desktop_img_width]" value="<?= $
|
1504 |
<label for="s99_desktop_img_width"><?php _e( 'Desktop - Image Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
1505 |
</div>
|
1506 |
</div>
|
@@ -1511,7 +1558,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1511 |
<p><?php _e( 'Mobile - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
1512 |
</div>
|
1513 |
<div class="input-field col s6">
|
1514 |
-
<input name="ht_ctc_s99[s99_mobile_img_height]" value="<?= $
|
1515 |
<label for="s99_mobile_img_height"><?php _e( 'Mobile - Image Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
1516 |
</div>
|
1517 |
</div>
|
@@ -1522,7 +1569,7 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1522 |
<p><?php _e( 'Mobile - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
1523 |
</div>
|
1524 |
<div class="input-field col s6">
|
1525 |
-
<input name="ht_ctc_s99[s99_mobile_img_width]" value="<?= $
|
1526 |
<label for="s99_mobile_img_width"><?php _e( 'Mobile - Image Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
1527 |
</div>
|
1528 |
</div>
|
@@ -1617,7 +1664,9 @@ class HT_CTC_Admin_Customize_Styles {
|
|
1617 |
$ht_ctc_admin_customize_styles = new HT_CTC_Admin_Customize_Styles();
|
1618 |
|
1619 |
add_action('admin_menu', array($ht_ctc_admin_customize_styles, 'menu') );
|
1620 |
-
add_action('admin_init', array($ht_ctc_admin_customize_styles, 'settings') );
|
1621 |
|
|
|
|
|
|
|
1622 |
|
1623 |
endif; // END class_exists check
|
12 |
|
13 |
class HT_CTC_Admin_Customize_Styles {
|
14 |
|
15 |
+
public $display_all_styles_checkbox = 'show';
|
16 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
// public function __construct() {
|
18 |
// // $this->this_variables();
|
19 |
// }
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
public function menu() {
|
22 |
|
|
|
|
|
23 |
add_submenu_page(
|
24 |
'click-to-chat',
|
25 |
'Customize',
|
64 |
|
65 |
public function settings() {
|
66 |
|
67 |
+
$ht_ctc_othersettings = get_option('ht_ctc_othersettings');
|
68 |
+
$ht_ctc_chat = get_option('ht_ctc_chat_options');
|
69 |
+
$ht_ctc_cs = get_option('ht_ctc_cs_options');
|
70 |
+
|
71 |
+
// @uses for register_setting, add_settings_field
|
72 |
+
$styles_list = [
|
73 |
+
'ht_ctc_s1',
|
74 |
+
'ht_ctc_s2',
|
75 |
+
'ht_ctc_s3',
|
76 |
+
'ht_ctc_s3_1',
|
77 |
+
'ht_ctc_s4',
|
78 |
+
'ht_ctc_s5',
|
79 |
+
'ht_ctc_s6',
|
80 |
+
'ht_ctc_s7',
|
81 |
+
'ht_ctc_s7_1',
|
82 |
+
'ht_ctc_s8',
|
83 |
+
'ht_ctc_s99'
|
84 |
+
];
|
85 |
+
|
86 |
+
|
87 |
+
//
|
88 |
+
/**
|
89 |
+
* Display all - if group or share enabled or display_allstyles option is checked.
|
90 |
+
*/
|
91 |
+
if ( isset($ht_ctc_othersettings['enable_group']) || isset($ht_ctc_othersettings['enable_share']) ) {
|
92 |
+
// load all styles
|
93 |
+
$this->display_all_styles_checkbox = 'hide';
|
94 |
+
|
95 |
+
} else {
|
96 |
+
// only chat enabled.
|
97 |
+
|
98 |
+
// display_allstyles option is checked.
|
99 |
+
if ( !isset( $ht_ctc_cs['display_allstyles'] ) ) {
|
100 |
+
|
101 |
+
$style_d = (isset($ht_ctc_chat['style_desktop'])) ? esc_attr($ht_ctc_chat['style_desktop']) : '';
|
102 |
+
$style_m = (isset($ht_ctc_chat['style_mobile'])) ? esc_attr($ht_ctc_chat['style_mobile']) : '';
|
103 |
+
|
104 |
+
// $styles_list redefined..
|
105 |
+
$styles_list = [];
|
106 |
+
|
107 |
+
if ( '' !== $style_d ) {
|
108 |
+
array_push($styles_list, "ht_ctc_s$style_d");
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( !isset($ht_ctc_chat['same_settings']) && '' !== $style_m && $style_d !== $style_m ) {
|
112 |
+
array_push($styles_list, "ht_ctc_s$style_m");
|
113 |
+
}
|
114 |
+
|
115 |
+
// // woo style and if not match with style desktop, mobile.
|
116 |
+
// $woo = get_option('ht_ctc_woo_options');
|
117 |
+
// $woo_style = (isset($woo['woo_style'])) ? esc_attr($woo['woo_style']) : '';
|
118 |
+
// if ( '' !== $woo_style && $style_d !== $woo_style && $style_m !== $woo_style ) {
|
119 |
+
// array_push($styles_list, "ht_ctc_s$woo_style");
|
120 |
+
// }
|
121 |
+
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
// register_setting
|
127 |
+
foreach ($styles_list as $s) {
|
128 |
+
|
129 |
+
register_setting(
|
130 |
+
'ht_ctc_cs_page_settings_fields',
|
131 |
+
$s,
|
132 |
+
[$this, 'options_sanitize']
|
133 |
+
);
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
register_setting( 'ht_ctc_cs_page_settings_fields', 'ht_ctc_cs_options' , array( $this, 'options_sanitize' ) );
|
138 |
+
|
139 |
add_settings_section( 'ht_ctc_cs_settings_sections_add', '', array( $this, 'main_settings_section_cb' ), 'ht_ctc_cs_page_settings_sections_do' );
|
140 |
+
|
141 |
+
// add_settings_field
|
142 |
+
foreach ($styles_list as $s) {
|
143 |
+
|
144 |
+
$name = str_replace( 'ht_ctc_s', 'Style ', $s );
|
145 |
+
|
146 |
+
add_settings_field(
|
147 |
+
$s,
|
148 |
+
$name,
|
149 |
+
[$this, "{$s}_cb"],
|
150 |
+
'ht_ctc_cs_page_settings_sections_do',
|
151 |
+
'ht_ctc_cs_settings_sections_add'
|
152 |
+
);
|
153 |
+
|
154 |
+
}
|
155 |
+
|
156 |
+
add_settings_field( 'ht_ctc_cs', '', array( $this, 'ht_ctc_cs_cb' ), 'ht_ctc_cs_page_settings_sections_do', 'ht_ctc_cs_settings_sections_add' );
|
157 |
+
|
158 |
+
|
159 |
}
|
160 |
|
161 |
public function main_settings_section_cb() {
|
180 |
$count = ( isset( $options['count']) ) ? esc_attr( $options['count'] ) : '1';
|
181 |
$count++;
|
182 |
|
183 |
+
|
184 |
+
$display_allstyles = ( isset( $options['display_allstyles']) ) ? esc_attr( $options['display_allstyles'] ) : '';
|
185 |
+
|
186 |
+
$hide_checkbox = '';
|
187 |
+
if ( isset( $this->display_all_styles_checkbox ) && 'hide' == $this->display_all_styles_checkbox ) {
|
188 |
+
$hide_checkbox = 'ctc_init_display_none';
|
189 |
+
}
|
190 |
+
|
191 |
?>
|
192 |
<!-- not make empty table -->
|
193 |
<input name="<?= $dbrow; ?>[count]" value="<?= $count; ?>" type="hidden" class="hide" >
|
194 |
|
195 |
+
<!-- display all styles -->
|
196 |
+
<div class="display_all_styles_checkbox <?= $hide_checkbox ?>">
|
|
|
|
|
197 |
<p>
|
198 |
<label>
|
199 |
+
<input name="<?= $dbrow; ?>[display_allstyles]" type="checkbox" value="1" <?php checked( $display_allstyles, 1 ); ?> id="display_allstyles" />
|
200 |
<span><?php _e( 'Display all Styles', 'click-to-chat-for-whatsapp' ); ?></span>
|
201 |
</label>
|
202 |
</p>
|
203 |
+
</div>
|
204 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
<?php
|
|
|
206 |
}
|
207 |
|
208 |
|
552 |
</div>
|
553 |
<div class="input-field col s6">
|
554 |
<input class="ht-ctc-color" name="ht_ctc_s3_1[s3_bg_color_hover]" data-default-color="#25D366" value="<?= $s3_bg_color_hover; ?>" id="s3_bg_color_hover" type="text">
|
555 |
+
<p class="description"><?php _e( 'E.g. ', 'click-to-chat-for-whatsapp' ); ?> #25D366, #20b038</p>
|
556 |
</div>
|
557 |
</div>
|
558 |
<?php
|
559 |
|
560 |
// shadow
|
561 |
+
?>
|
562 |
+
<div class="s3_box_shadow">
|
563 |
+
<?php
|
564 |
if ( isset( $options['s3_box_shadow'] ) ) {
|
565 |
?>
|
566 |
<p>
|
580 |
</p>
|
581 |
<?php
|
582 |
}
|
583 |
+
?>
|
584 |
+
</div>
|
585 |
+
<?php
|
586 |
|
587 |
// shadow on hover
|
588 |
+
?>
|
589 |
+
<div class="s3_box_shadow_hover ctc_init_display_none">
|
590 |
+
<?php
|
591 |
if ( isset( $options['s3_box_shadow_hover'] ) ) {
|
592 |
?>
|
593 |
<p>
|
594 |
<label>
|
595 |
<input name="ht_ctc_s3_1[s3_box_shadow_hover]" type="checkbox" value="1" <?php checked( $options['s3_box_shadow_hover'], 1 ); ?> id="s3_box_shadow_hover" />
|
596 |
+
<span><?php _e( 'Shadow on Hover only', 'click-to-chat-for-whatsapp' ); ?></span>
|
597 |
</label>
|
598 |
</p>
|
599 |
<?php
|
602 |
<p>
|
603 |
<label>
|
604 |
<input name="ht_ctc_s3_1[s3_box_shadow_hover]" type="checkbox" value="1" id="s3_box_shadow_hover" />
|
605 |
+
<span><?php _e( 'Shadow on Hover only', 'click-to-chat-for-whatsapp' ); ?></span>
|
606 |
</label>
|
607 |
</p>
|
608 |
<?php
|
609 |
}
|
610 |
?>
|
611 |
+
</div>
|
612 |
+
<br>
|
613 |
|
614 |
<?php
|
615 |
$select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
|
903 |
<div class="input-field col s6">
|
904 |
<input name="ht_ctc_s5[s5_content_width]" value="<?= $s5_content_width ?>" id="s5_content_width" type="text" class="" >
|
905 |
<label for="s5_content_width"><?php _e( 'Content Box Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
906 |
+
<p class="description"><?php _e( 'E.g.', 'click-to-chat-for-whatsapp' ); ?> 270px, 100%</p>
|
907 |
</div>
|
908 |
</div>
|
909 |
|
1034 |
$cta_textcolor_hover = ( isset( $options['cta_textcolor_hover']) ) ? esc_attr( $options['cta_textcolor_hover'] ) : '';
|
1035 |
$cta_bgcolor = ( isset( $options['cta_bgcolor']) ) ? esc_attr( $options['cta_bgcolor'] ) : '';
|
1036 |
$cta_bgcolor_hover = ( isset( $options['cta_bgcolor_hover']) ) ? esc_attr( $options['cta_bgcolor_hover'] ) : '';
|
1037 |
+
$cta_font_size = ( isset( $options['cta_font_size']) ) ? esc_attr( $options['cta_font_size'] ) : '';
|
1038 |
+
|
1039 |
?>
|
1040 |
<ul class="collapsible ht_ctc_s7" data-collapsible="accordion">
|
1041 |
<li>
|
1156 |
</div>
|
1157 |
</div>
|
1158 |
|
1159 |
+
<!-- font size -->
|
1160 |
+
<div class="row cta_font_size cta_stick">
|
1161 |
+
<div class="col s6">
|
1162 |
+
<p><?php _e( 'Font Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
1163 |
+
</div>
|
1164 |
+
<div class="input-field col s6">
|
1165 |
+
<input name="<?= $dbrow; ?>[cta_font_size]" value="<?= $cta_font_size ?>" id="s7_cta_font_size" type="text" class="" >
|
1166 |
+
<label for="s7_cta_font_size"><?php _e( 'Font Size (e.g. 15px)', 'click-to-chat-for-whatsapp' ); ?></label>
|
1167 |
+
<span class="helper-text"><?php _e( 'Leave blank for default settings', 'click-to-chat-for-whatsapp' ); ?></span>
|
1168 |
+
</div>
|
1169 |
+
</div>
|
1170 |
+
|
1171 |
</div>
|
1172 |
</div>
|
1173 |
</li>
|
1190 |
$s7_border_size = ( isset( $options['s7_border_size']) ) ? esc_attr( $options['s7_border_size'] ) : '';
|
1191 |
$s7_bgcolor = ( isset( $options['s7_bgcolor']) ) ? esc_attr( $options['s7_bgcolor'] ) : '';
|
1192 |
$s7_bgcolor_hover = ( isset( $options['s7_bgcolor_hover']) ) ? esc_attr( $options['s7_bgcolor_hover'] ) : '';
|
1193 |
+
$cta_font_size = ( isset( $options['cta_font_size']) ) ? esc_attr( $options['cta_font_size'] ) : '';
|
1194 |
|
1195 |
$select_cta_type = ( isset( $options['cta_type']) ) ? esc_attr( $options['cta_type'] ) : '';
|
1196 |
|
1277 |
</div>
|
1278 |
</div>
|
1279 |
|
1280 |
+
<!-- font size -->
|
1281 |
+
<div class="row cta_font_size cta_stick">
|
1282 |
+
<div class="col s6">
|
1283 |
+
<p><?php _e( 'Font Size', 'click-to-chat-for-whatsapp' ); ?></p>
|
1284 |
+
</div>
|
1285 |
+
<div class="input-field col s6">
|
1286 |
+
<input name="<?= $dbrow; ?>[cta_font_size]" value="<?= $cta_font_size ?>" id="s7_1_cta_font_size" type="text" class="" >
|
1287 |
+
<label for="s7_1_cta_font_size"><?php _e( 'Font Size (e.g. 15px)', 'click-to-chat-for-whatsapp' ); ?></label>
|
1288 |
+
<span class="helper-text"><?php _e( 'Leave blank for default settings', 'click-to-chat-for-whatsapp' ); ?></span>
|
1289 |
+
</div>
|
1290 |
+
</div>
|
1291 |
+
|
1292 |
|
1293 |
</div>
|
1294 |
</div>
|
1496 |
function ht_ctc_s99_cb() {
|
1497 |
|
1498 |
$options = get_option('ht_ctc_s99');
|
1499 |
+
$s_99_dekstop_img_url = ( isset( $options['s99_dekstop_img_url']) ) ? esc_attr( $options['s99_dekstop_img_url'] ) : '';
|
1500 |
+
$s_99_mobile_img_url = ( isset( $options['s99_mobile_img_url']) ) ? esc_attr( $options['s99_mobile_img_url'] ) : '';
|
1501 |
+
$s_99_desktop_img_height = ( isset( $options['s99_desktop_img_height']) ) ? esc_attr( $options['s99_desktop_img_height'] ) : '';
|
1502 |
+
$s_99_desktop_img_width = ( isset( $options['s99_desktop_img_width']) ) ? esc_attr( $options['s99_desktop_img_width'] ) : '';
|
1503 |
+
$s_99_mobile_img_height = ( isset( $options['s99_mobile_img_height']) ) ? esc_attr( $options['s99_mobile_img_height'] ) : '';
|
1504 |
+
$s_99_mobile_img_width = ( isset( $options['s99_mobile_img_width']) ) ? esc_attr( $options['s99_mobile_img_width'] ) : '';
|
1505 |
?>
|
1506 |
<ul class="collapsible ht_ctc_s99" data-collapsible="accordion">
|
1507 |
<li>
|
1514 |
<p>Image URL</p>
|
1515 |
</div> -->
|
1516 |
<div class="input-field col s12">
|
1517 |
+
<input name="ht_ctc_s99[s99_dekstop_img_url]" value="<?= $s_99_dekstop_img_url ?>" id="s99_dekstop_img_url" type="text" class="" >
|
1518 |
<label for="s99_dekstop_img_url"><?php _e( 'Image URL - Desktop', 'click-to-chat-for-whatsapp' ); ?></label>
|
1519 |
</div>
|
1520 |
</div>
|
1525 |
<p>Image URL</p>
|
1526 |
</div> -->
|
1527 |
<div class="input-field col s12">
|
1528 |
+
<input name="ht_ctc_s99[s99_mobile_img_url]" value="<?= $s_99_mobile_img_url ?>" id="s99_mobile_img_url" type="text" class="" >
|
1529 |
<label for="s99_mobile_img_url"><?php _e( 'Image URL - Mobile', 'click-to-chat-for-whatsapp' ); ?></label>
|
1530 |
</div>
|
1531 |
</div>
|
1536 |
<p><?php _e( 'Desktop - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
1537 |
</div>
|
1538 |
<div class="input-field col s6">
|
1539 |
+
<input name="ht_ctc_s99[s99_desktop_img_height]" value="<?= $s_99_desktop_img_height ?>" id="s99_desktop_img_height" type="text" class="" >
|
1540 |
<label for="s99_desktop_img_height"><?php _e( 'Desktop - Image Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
1541 |
</div>
|
1542 |
</div>
|
1547 |
<p><?php _e( 'Desktop - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
1548 |
</div>
|
1549 |
<div class="input-field col s6">
|
1550 |
+
<input name="ht_ctc_s99[s99_desktop_img_width]" value="<?= $s_99_desktop_img_width ?>" id="s99_desktop_img_width" type="text" class="" >
|
1551 |
<label for="s99_desktop_img_width"><?php _e( 'Desktop - Image Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
1552 |
</div>
|
1553 |
</div>
|
1558 |
<p><?php _e( 'Mobile - Image Height', 'click-to-chat-for-whatsapp' ); ?></p>
|
1559 |
</div>
|
1560 |
<div class="input-field col s6">
|
1561 |
+
<input name="ht_ctc_s99[s99_mobile_img_height]" value="<?= $s_99_mobile_img_height ?>" id="s99_mobile_img_height" type="text" class="" >
|
1562 |
<label for="s99_mobile_img_height"><?php _e( 'Mobile - Image Height', 'click-to-chat-for-whatsapp' ); ?></label>
|
1563 |
</div>
|
1564 |
</div>
|
1569 |
<p><?php _e( 'Mobile - Image Width', 'click-to-chat-for-whatsapp' ); ?></p>
|
1570 |
</div>
|
1571 |
<div class="input-field col s6">
|
1572 |
+
<input name="ht_ctc_s99[s99_mobile_img_width]" value="<?= $s_99_mobile_img_width ?>" id="s99_mobile_img_width" type="text" class="" >
|
1573 |
<label for="s99_mobile_img_width"><?php _e( 'Mobile - Image Width', 'click-to-chat-for-whatsapp' ); ?></label>
|
1574 |
</div>
|
1575 |
</div>
|
1664 |
$ht_ctc_admin_customize_styles = new HT_CTC_Admin_Customize_Styles();
|
1665 |
|
1666 |
add_action('admin_menu', array($ht_ctc_admin_customize_styles, 'menu') );
|
|
|
1667 |
|
1668 |
+
if ( isset($_GET['page']) && 'click-to-chat-customize-styles' == $_GET['page'] ) {
|
1669 |
+
add_action('admin_init', array($ht_ctc_admin_customize_styles, 'settings') );
|
1670 |
+
}
|
1671 |
|
1672 |
endif; // END class_exists check
|
new/admin/class-ht-ctc-admin-main-page.php
CHANGED
@@ -18,12 +18,8 @@ if ( ! class_exists( 'HT_CTC_Admin_Main_Page' ) ) :
|
|
18 |
class HT_CTC_Admin_Main_Page {
|
19 |
|
20 |
public function menu() {
|
21 |
-
|
22 |
-
|
23 |
-
$icon = 'dashicons-whatsapp';
|
24 |
-
if( version_compare( get_bloginfo('version'), '5.6', '<') ) {
|
25 |
-
$icon = 'dashicons-format-chat';
|
26 |
-
}
|
27 |
|
28 |
add_menu_page(
|
29 |
'Click to Chat ',
|
@@ -50,7 +46,7 @@ class HT_CTC_Admin_Main_Page {
|
|
50 |
<!-- full row -->
|
51 |
<div class="row">
|
52 |
|
53 |
-
<div class="col s12 m12
|
54 |
<form action="options.php" method="post" class="">
|
55 |
<?php settings_fields( 'ht_ctc_main_page_settings_fields' ); ?>
|
56 |
<?php do_settings_sections( 'ht_ctc_main_page_settings_sections_do' ) ?>
|
@@ -59,7 +55,7 @@ class HT_CTC_Admin_Main_Page {
|
|
59 |
</div>
|
60 |
|
61 |
<!-- sidebar content -->
|
62 |
-
<div class="col s12
|
63 |
<?php include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-sidebar-content.php'; ?>
|
64 |
</div>
|
65 |
|
@@ -122,9 +118,6 @@ class HT_CTC_Admin_Main_Page {
|
|
122 |
if ('' == $num && '' == $cc ) {
|
123 |
$num = $number;
|
124 |
}
|
125 |
-
|
126 |
-
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/class-ht-ctc-static.php';
|
127 |
-
$cc_list = HT_CTC_Static::$cc;
|
128 |
?>
|
129 |
|
130 |
<style>
|
@@ -152,25 +145,8 @@ class HT_CTC_Admin_Main_Page {
|
|
152 |
|
153 |
<!-- country code -->
|
154 |
<div class="input-field col s3 m3 ctc_num_field">
|
155 |
-
<input name="ht_ctc_chat_options[cc]"
|
156 |
-
|
157 |
-
<datalist id="ctc_cc_list_next" style="height: 20px; overflow:hidden;">
|
158 |
-
<?php
|
159 |
-
foreach ( $cc_list as $key => $value ) {
|
160 |
-
if (is_array($value)) {
|
161 |
-
foreach ( $value as $v ) {
|
162 |
-
?>
|
163 |
-
<option value="<?= $key; ?>"><?= $v; ?></option>
|
164 |
-
<?php
|
165 |
-
}
|
166 |
-
} else {
|
167 |
-
?>
|
168 |
-
<option value="<?= $key; ?>"><?= $value; ?></option>
|
169 |
-
<?php
|
170 |
-
}
|
171 |
-
}
|
172 |
-
?>
|
173 |
-
</datalist>
|
174 |
<label for="whatsapp_cc"><?php _e( 'Country Code', 'click-to-chat-for-whatsapp' ); ?></label>
|
175 |
|
176 |
|
@@ -180,7 +156,7 @@ class HT_CTC_Admin_Main_Page {
|
|
180 |
<div class="input-field col s9 m7 ctc_num_field">
|
181 |
<input name="ht_ctc_chat_options[num]" value="<?= $num ?>" id="whatsapp_number" type="text" class="input-margin tooltipped" data-position="right" data-tooltip="Number">
|
182 |
<label for="whatsapp_number"><?php _e( 'Number', 'click-to-chat-for-whatsapp' ); ?></label>
|
183 |
-
|
184 |
</div>
|
185 |
|
186 |
<!-- full number - hidden field -->
|
@@ -192,6 +168,14 @@ class HT_CTC_Admin_Main_Page {
|
|
192 |
|
193 |
<?php do_action('ht_ctc_ah_admin_chat_number'); ?>
|
194 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
</div>
|
196 |
<?php
|
197 |
}
|
@@ -207,7 +191,7 @@ class HT_CTC_Admin_Main_Page {
|
|
207 |
<div class="input-field col s12">
|
208 |
<textarea style="min-height: 84px;" placeholder="<?= $placeholder ?>" name="ht_ctc_chat_options[pre_filled]" id="pre_filled" class="materialize-textarea input-margin"><?= $value ?></textarea>
|
209 |
<label for="pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
210 |
-
<p class="description"><?php _e( "Text that
|
211 |
</div>
|
212 |
</div>
|
213 |
<?php
|
@@ -282,13 +266,38 @@ class HT_CTC_Admin_Main_Page {
|
|
282 |
|
283 |
// More options - for addon plugins
|
284 |
function options_cb() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
do_action('ht_ctc_ah_admin_chat_more_options');
|
286 |
}
|
287 |
|
288 |
function ctc_notes_cb() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
?>
|
290 |
<p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize Styles</a></p>
|
291 |
<p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-other-settings' ); ?>">Other Settings</a></p>
|
|
|
|
|
292 |
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/shortcodes-chat">Shortcodes for Chat: </a>[ht-ctc-chat]</p>
|
293 |
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/custom-element">Custom Element: </a>Class name: ctc_chat | Href/Link: #ctc_chat</p>
|
294 |
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/faq">Frequently Asked Questions (FAQ)</a></p>
|
@@ -312,7 +321,7 @@ class HT_CTC_Admin_Main_Page {
|
|
312 |
|
313 |
}
|
314 |
|
315 |
-
|
316 |
|
317 |
/**
|
318 |
* Sanitize each setting field as needed
|
@@ -325,17 +334,25 @@ class HT_CTC_Admin_Main_Page {
|
|
325 |
wp_die( 'not allowed to modify - please contact admin ' );
|
326 |
}
|
327 |
|
|
|
|
|
|
|
|
|
328 |
$new_input = array();
|
329 |
|
330 |
foreach ($input as $key => $value) {
|
331 |
if( isset( $input[$key] ) ) {
|
332 |
|
333 |
if ( 'pre_filled' == $key || 'woo_pre_filled' == $key ) {
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
// }
|
338 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
|
|
|
|
|
|
|
|
|
|
339 |
} elseif ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
|
340 |
$input[$key] = str_replace( ' ', '', $input[$key] );
|
341 |
if ( is_numeric($input[$key]) ) {
|
18 |
class HT_CTC_Admin_Main_Page {
|
19 |
|
20 |
public function menu() {
|
21 |
+
|
22 |
+
$icon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iI2ZmZiIgY2xhc3M9ImJpIGJpLXdoYXRzYXBwIiB2aWV3Qm94PSIwIDAgMTYgMTYiPjxwYXRoIGQ9Ik0xMy42MDEgMi4zMjZBNy44NTQgNy44NTQgMCAwIDAgNy45OTQgMEMzLjYyNyAwIC4wNjggMy41NTguMDY0IDcuOTI2YzAgMS4zOTkuMzY2IDIuNzYgMS4wNTcgMy45NjVMMCAxNmw0LjIwNC0xLjEwMmE3LjkzMyA3LjkzMyAwIDAgMCAzLjc5Ljk2NWguMDA0YzQuMzY4IDAgNy45MjYtMy41NTggNy45My03LjkzQTcuODk4IDcuODk4IDAgMCAwIDEzLjYgMi4zMjZ6TTcuOTk0IDE0LjUyMWE2LjU3MyA2LjU3MyAwIDAgMS0zLjM1Ni0uOTJsLS4yNC0uMTQ0LTIuNDk0LjY1NC42NjYtMi40MzMtLjE1Ni0uMjUxYTYuNTYgNi41NiAwIDAgMS0xLjAwNy0zLjUwNWMwLTMuNjI2IDIuOTU3LTYuNTg0IDYuNTkxLTYuNTg0YTYuNTYgNi41NiAwIDAgMSA0LjY2IDEuOTMxIDYuNTU3IDYuNTU3IDAgMCAxIDEuOTI4IDQuNjZjLS4wMDQgMy42MzktMi45NjEgNi41OTItNi41OTIgNi41OTJ6bTMuNjE1LTQuOTM0Yy0uMTk3LS4wOTktMS4xNy0uNTc4LTEuMzUzLS42NDYtLjE4Mi0uMDY1LS4zMTUtLjA5OS0uNDQ1LjA5OS0uMTMzLjE5Ny0uNTEzLjY0Ni0uNjI3Ljc3NS0uMTE0LjEzMy0uMjMyLjE0OC0uNDMuMDUtLjE5Ny0uMS0uODM2LS4zMDgtMS41OTItLjk4NS0uNTktLjUyNS0uOTg1LTEuMTc1LTEuMTAzLTEuMzcyLS4xMTQtLjE5OC0uMDExLS4zMDQuMDg4LS40MDMuMDg3LS4wODguMTk3LS4yMzIuMjk2LS4zNDYuMS0uMTE0LjEzMy0uMTk4LjE5OC0uMzMuMDY1LS4xMzQuMDM0LS4yNDgtLjAxNS0uMzQ3LS4wNS0uMDk5LS40NDUtMS4wNzYtLjYxMi0xLjQ3LS4xNi0uMzg5LS4zMjMtLjMzNS0uNDQ1LS4zNC0uMTE0LS4wMDctLjI0Ny0uMDA3LS4zOC0uMDA3YS43MjkuNzI5IDAgMCAwLS41MjkuMjQ3Yy0uMTgyLjE5OC0uNjkxLjY3Ny0uNjkxIDEuNjU0IDAgLjk3Ny43MSAxLjkxNi44MSAyLjA0OS4wOTguMTMzIDEuMzk0IDIuMTMyIDMuMzgzIDIuOTkyLjQ3LjIwNS44NC4zMjYgMS4xMjkuNDE4LjQ3NS4xNTIuOTA0LjEyOSAxLjI0Ni4wOC4zOC0uMDU4IDEuMTcxLS40OCAxLjMzOC0uOTQzLjE2NC0uNDY0LjE2NC0uODYuMTE0LS45NDMtLjA0OS0uMDg0LS4xODItLjEzMy0uMzgtLjIzMnoiLz48L3N2Zz4=";
|
|
|
|
|
|
|
|
|
23 |
|
24 |
add_menu_page(
|
25 |
'Click to Chat ',
|
46 |
<!-- full row -->
|
47 |
<div class="row">
|
48 |
|
49 |
+
<div class="col s12 m12 xl8 options">
|
50 |
<form action="options.php" method="post" class="">
|
51 |
<?php settings_fields( 'ht_ctc_main_page_settings_fields' ); ?>
|
52 |
<?php do_settings_sections( 'ht_ctc_main_page_settings_sections_do' ) ?>
|
55 |
</div>
|
56 |
|
57 |
<!-- sidebar content -->
|
58 |
+
<div class="col s12 m9 l7 xl4 ht-ctc-admin-sidebar sticky-sidebar">
|
59 |
<?php include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/admin-sidebar-content.php'; ?>
|
60 |
</div>
|
61 |
|
118 |
if ('' == $num && '' == $cc ) {
|
119 |
$num = $number;
|
120 |
}
|
|
|
|
|
|
|
121 |
?>
|
122 |
|
123 |
<style>
|
145 |
|
146 |
<!-- country code -->
|
147 |
<div class="input-field col s3 m3 ctc_num_field">
|
148 |
+
<input name="ht_ctc_chat_options[cc]" value="<?= $cc ?>" id="whatsapp_cc" type="text" class="input-margin tooltipped" data-position="left" data-tooltip="Country Code">
|
149 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
<label for="whatsapp_cc"><?php _e( 'Country Code', 'click-to-chat-for-whatsapp' ); ?></label>
|
151 |
|
152 |
|
156 |
<div class="input-field col s9 m7 ctc_num_field">
|
157 |
<input name="ht_ctc_chat_options[num]" value="<?= $num ?>" id="whatsapp_number" type="text" class="input-margin tooltipped" data-position="right" data-tooltip="Number">
|
158 |
<label for="whatsapp_number"><?php _e( 'Number', 'click-to-chat-for-whatsapp' ); ?></label>
|
159 |
+
<span class="helper-text ctc_wn_initial_zero" style="display: none;">zero may not needed to add before the number</span>
|
160 |
</div>
|
161 |
|
162 |
<!-- full number - hidden field -->
|
168 |
|
169 |
<?php do_action('ht_ctc_ah_admin_chat_number'); ?>
|
170 |
|
171 |
+
<?php
|
172 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
173 |
+
?>
|
174 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/random-number/">Random Number</a> (PRO)</p>
|
175 |
+
<?php
|
176 |
+
}
|
177 |
+
?>
|
178 |
+
|
179 |
</div>
|
180 |
<?php
|
181 |
}
|
191 |
<div class="input-field col s12">
|
192 |
<textarea style="min-height: 84px;" 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>
|
196 |
</div>
|
197 |
<?php
|
266 |
|
267 |
// More options - for addon plugins
|
268 |
function options_cb() {
|
269 |
+
if ( !defined('HT_CTC_PRO_VERSION') ) {
|
270 |
+
?>
|
271 |
+
<div style="margin-bottom: 25px;">
|
272 |
+
<p class="description">Business Hour (online/offline)</p>
|
273 |
+
<p class="description"> Hide When offline</p>
|
274 |
+
<p class="description"> Change WhatsApp Number When Offline</p>
|
275 |
+
<p class="description"> Change Call to Action When Offline</p>
|
276 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO</a></p>
|
277 |
+
</div>
|
278 |
+
|
279 |
+
<?php
|
280 |
+
}
|
281 |
do_action('ht_ctc_ah_admin_chat_more_options');
|
282 |
}
|
283 |
|
284 |
function ctc_notes_cb() {
|
285 |
+
|
286 |
+
$woo_link = 'https://holithemes.com/plugins/click-to-chat/woocommerce/';
|
287 |
+
$woo_text = '';
|
288 |
+
|
289 |
+
if ( class_exists( 'WooCommerce' ) ) {
|
290 |
+
$woo_link = admin_url( 'admin.php?page=click-to-chat-woocommerce' );
|
291 |
+
} else {
|
292 |
+
$woo_text = "(Only if WooCommerce plugin is Active)";
|
293 |
+
}
|
294 |
+
|
295 |
+
|
296 |
?>
|
297 |
<p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-customize-styles' ); ?>">Customize Styles</a></p>
|
298 |
<p class="description"><a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat-other-settings' ); ?>">Other Settings</a></p>
|
299 |
+
<p class="description"><a target="_blank" href="<?= $woo_link ?>">WooCommerce</a> <?= $woo_text ?></p>
|
300 |
+
<br>
|
301 |
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/shortcodes-chat">Shortcodes for Chat: </a>[ht-ctc-chat]</p>
|
302 |
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/custom-element">Custom Element: </a>Class name: ctc_chat | Href/Link: #ctc_chat</p>
|
303 |
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/faq">Frequently Asked Questions (FAQ)</a></p>
|
321 |
|
322 |
}
|
323 |
|
324 |
+
|
325 |
|
326 |
/**
|
327 |
* Sanitize each setting field as needed
|
334 |
wp_die( 'not allowed to modify - please contact admin ' );
|
335 |
}
|
336 |
|
337 |
+
// formatting api - emoji ..
|
338 |
+
include_once HT_CTC_PLUGIN_DIR .'new/admin/admin_commons/ht-ctc-admin-formatting.php';
|
339 |
+
|
340 |
+
|
341 |
$new_input = array();
|
342 |
|
343 |
foreach ($input as $key => $value) {
|
344 |
if( isset( $input[$key] ) ) {
|
345 |
|
346 |
if ( 'pre_filled' == $key || 'woo_pre_filled' == $key ) {
|
347 |
+
if ( function_exists('ht_ctc_wp_encode_emoji') ) {
|
348 |
+
$input[$key] = ht_ctc_wp_encode_emoji( $input[$key] );
|
349 |
+
}
|
|
|
350 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
351 |
+
} elseif ( 'call_to_action' == $key ) {
|
352 |
+
if ( function_exists('ht_ctc_wp_encode_emoji') ) {
|
353 |
+
$input[$key] = ht_ctc_wp_encode_emoji( $input[$key] );
|
354 |
+
}
|
355 |
+
$new_input[$key] = sanitize_text_field( $input[$key] );
|
356 |
} elseif ( 'side_1_value' == $key || 'side_2_value' == $key || 'mobile_side_1_value' == $key || 'mobile_side_2_value' == $key ) {
|
357 |
$input[$key] = str_replace( ' ', '', $input[$key] );
|
358 |
if ( is_numeric($input[$key]) ) {
|
new/admin/class-ht-ctc-admin-other-settings.php
CHANGED
@@ -94,8 +94,8 @@ class HT_CTC_Admin_Other_Settings {
|
|
94 |
$dbrow = 'ht_ctc_othersettings';
|
95 |
|
96 |
?>
|
97 |
-
<ul class="collapsible" data-collapsible="accordion" id="ht_ctc_analytics">
|
98 |
-
<li class="
|
99 |
<div class="collapsible-header"><?php _e( 'Google Analytics, Facebook Pixel, Google Ads Conversion', 'click-to-chat-for-whatsapp' ); ?></div>
|
100 |
<div class="collapsible-body">
|
101 |
|
@@ -195,14 +195,20 @@ class HT_CTC_Admin_Other_Settings {
|
|
195 |
</p>
|
196 |
<?php
|
197 |
}
|
198 |
-
|
199 |
-
// change function name
|
200 |
?>
|
201 |
-
<!-- call gtag_report_conversion function when user clicks on WhatsApp icon/button -->
|
202 |
<p class="description"><?php _e( 'call gtag_report_conversion function, when user clicks', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/google-ads-conversion/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
203 |
-
|
204 |
-
<br>
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
|
207 |
</div>
|
208 |
</li>
|
@@ -219,8 +225,8 @@ class HT_CTC_Admin_Other_Settings {
|
|
219 |
$hook_url = isset($options['hook_url']) ? esc_attr( $options['hook_url'] ) : '';
|
220 |
|
221 |
?>
|
222 |
-
<ul class="collapsible" data-collapsible="accordion"
|
223 |
-
<li class="
|
224 |
<div class="collapsible-header"><?php _e( 'Webhooks', 'click-to-chat-for-whatsapp' ); ?></div>
|
225 |
<div class="collapsible-body">
|
226 |
|
@@ -278,15 +284,18 @@ class HT_CTC_Admin_Other_Settings {
|
|
278 |
|
279 |
<span style="color:#039be5; cursor:pointer; font-size:16px;"
|
280 |
class="add_hook_value dashicons dashicons-plus-alt2 col s12"
|
281 |
-
data-html='<div class="row"><div class="col s3"><p class="description"><?php _e( "Add Value", "click-to-chat-for-whatsapp" ); ?></p></div><div class="input-field col s9 m6"><input name="ht_ctc_othersettings[hook_v][]" value="" id="hook_v" type="text" class="input-margin"><label for="hook_v"><?php _e( "Value", "click-to-chat-for-whatsapp" ); ?></label></div></div>'
|
282 |
><?php _e( "Add Value", "click-to-chat-for-whatsapp" ); ?></span>
|
283 |
|
284 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
-
<p class="description">New feature: since v3.3.1 ( please contact us for suggestions, improvements. )</p>
|
287 |
-
<br>
|
288 |
-
|
289 |
-
|
290 |
</div>
|
291 |
</li>
|
292 |
</ul>
|
@@ -301,26 +310,34 @@ class HT_CTC_Admin_Other_Settings {
|
|
301 |
$show_effect = ( isset( $options['show_effect']) ) ? esc_attr( $options['show_effect'] ) : 'no-show-effects';
|
302 |
$an_delay = ( isset( $options['an_delay']) ) ? esc_attr( $options['an_delay'] ) : '';
|
303 |
$an_itr = ( isset( $options['an_itr']) ) ? esc_attr( $options['an_itr'] ) : '';
|
304 |
-
$show_effect_list = array(
|
305 |
-
'no-show-effects',
|
306 |
-
'From Center',
|
307 |
-
'From Corner',
|
308 |
-
);
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
$an_type = ( isset( $options['an_type']) ) ? esc_attr( $options['an_type'] ) : '';
|
311 |
|
312 |
$an_list = array(
|
313 |
-
'no-animation',
|
314 |
-
'bounce',
|
315 |
-
'flash',
|
316 |
-
'pulse',
|
317 |
-
'heartBeat',
|
318 |
-
'flip',
|
319 |
);
|
320 |
|
321 |
?>
|
322 |
-
<ul class="collapsible" data-collapsible="accordion"
|
323 |
-
<li class="
|
324 |
<div class="collapsible-header"><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?></div>
|
325 |
<div class="collapsible-body">
|
326 |
|
@@ -337,9 +354,9 @@ class HT_CTC_Admin_Other_Settings {
|
|
337 |
<select name="ht_ctc_othersettings[an_type]" class="select_an_type">
|
338 |
<?php
|
339 |
|
340 |
-
foreach ( $an_list as $value ) {
|
341 |
?>
|
342 |
-
<option value="<?= $
|
343 |
<?php
|
344 |
}
|
345 |
|
@@ -379,21 +396,20 @@ class HT_CTC_Admin_Other_Settings {
|
|
379 |
<!-- Show effect -->
|
380 |
<div class="row">
|
381 |
<div class="col s6">
|
382 |
-
<p><?php _e( '
|
383 |
</div>
|
384 |
<div class="input-field col s6">
|
385 |
<select name="ht_ctc_othersettings[show_effect]" class="show_effect">
|
386 |
<?php
|
387 |
-
|
388 |
-
foreach ( $show_effect_list as $value ) {
|
389 |
?>
|
390 |
-
<option value="<?= $
|
391 |
<?php
|
392 |
}
|
393 |
|
394 |
?>
|
395 |
</select>
|
396 |
-
<label><?php _e( '
|
397 |
</div>
|
398 |
</div>
|
399 |
|
@@ -410,42 +426,25 @@ class HT_CTC_Admin_Other_Settings {
|
|
410 |
$options = get_option('ht_ctc_othersettings');
|
411 |
$dbrow = 'ht_ctc_othersettings';
|
412 |
|
|
|
|
|
413 |
// start other settings
|
414 |
do_action('ht_ctc_ah_admin_start_os');
|
415 |
|
416 |
$li_active_gr_sh = ( isset( $options['enable_group'] ) || isset( $options['enable_share'] ) ) ? "class='active'" : '';
|
417 |
?>
|
418 |
|
419 |
-
<ul class="collapsible" data-collapsible="accordion" id="ht_ctc_othersettings">
|
420 |
-
<li class="
|
421 |
<div class="collapsible-header"><?php _e( 'Other Settings', 'click-to-chat-for-whatsapp' ); ?></div>
|
422 |
<div class="collapsible-body">
|
423 |
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
<input name="<?= $dbrow; ?>[select_styles_issue]" type="checkbox" value="1" <?php checked( $options['select_styles_issue'], 1 ); ?> id="select_styles_issue" />
|
431 |
-
<!-- <span>Style for device is not as expected(due to cache)</span> -->
|
432 |
-
<span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
|
433 |
-
</label>
|
434 |
-
</p>
|
435 |
-
<?php
|
436 |
-
} else {
|
437 |
-
?>
|
438 |
-
<p id="styles_issue">
|
439 |
-
<label>
|
440 |
-
<input name="<?= $dbrow; ?>[select_styles_issue]" type="checkbox" value="1" id="select_styles_issue" />
|
441 |
-
<span><?php _e( 'Check this only, If styles for mobile, desktop not selected as expected(due to cache)', 'click-to-chat-for-whatsapp' ); ?></span>
|
442 |
-
</label>
|
443 |
-
</p>
|
444 |
-
<?php
|
445 |
-
}
|
446 |
-
?>
|
447 |
-
<br>
|
448 |
-
|
449 |
|
450 |
<?php
|
451 |
// hook
|
@@ -461,7 +460,7 @@ class HT_CTC_Admin_Other_Settings {
|
|
461 |
<br>
|
462 |
|
463 |
<!-- enable group, share features -->
|
464 |
-
<ul class="collapsible" data-collapsible="accordion" id="ht_ctc_enable_share_group">
|
465 |
<li <?= $li_active_gr_sh; ?>>
|
466 |
<div class="collapsible-header"><?php _e( 'Group, Share features', 'click-to-chat-for-whatsapp' ); ?></div>
|
467 |
<div class="collapsible-body">
|
@@ -521,7 +520,8 @@ class HT_CTC_Admin_Other_Settings {
|
|
521 |
<br>
|
522 |
|
523 |
<!-- chat -->
|
524 |
-
<p class="description"><?php _e( "Chat settings are enabled by default. If like to hide chat on all pages
|
|
|
525 |
<br>
|
526 |
|
527 |
|
@@ -532,7 +532,7 @@ class HT_CTC_Admin_Other_Settings {
|
|
532 |
<br>
|
533 |
|
534 |
<!-- Troubleshoot, Debug, .. -->
|
535 |
-
<ul class="collapsible" data-collapsible="accordion" id="ht_ctc_debug">
|
536 |
<li>
|
537 |
<div class="collapsible-header"><?php _e( 'Debug, Troubleshoot, ..', 'click-to-chat-for-whatsapp' ); ?></div>
|
538 |
<div class="collapsible-body">
|
94 |
$dbrow = 'ht_ctc_othersettings';
|
95 |
|
96 |
?>
|
97 |
+
<ul class="collapsible ht_ctc_analytics" data-collapsible="accordion" id="ht_ctc_analytics">
|
98 |
+
<li class="">
|
99 |
<div class="collapsible-header"><?php _e( 'Google Analytics, Facebook Pixel, Google Ads Conversion', 'click-to-chat-for-whatsapp' ); ?></div>
|
100 |
<div class="collapsible-body">
|
101 |
|
195 |
</p>
|
196 |
<?php
|
197 |
}
|
|
|
|
|
198 |
?>
|
|
|
199 |
<p class="description"><?php _e( 'call gtag_report_conversion function, when user clicks', 'click-to-chat-for-whatsapp' ); ?> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/google-ads-conversion/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
200 |
+
<?php
|
|
|
201 |
|
202 |
+
do_action('ht_ctc_ah_admin_google_ads');
|
203 |
+
|
204 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
205 |
+
?>
|
206 |
+
<br>
|
207 |
+
<p class="description">PRO - In pro version we can add Conversion ID, Conversion label direclty (no need to add gtag_report_conversion)</p>
|
208 |
+
<?php
|
209 |
+
}
|
210 |
+
|
211 |
+
?>
|
212 |
|
213 |
</div>
|
214 |
</li>
|
225 |
$hook_url = isset($options['hook_url']) ? esc_attr( $options['hook_url'] ) : '';
|
226 |
|
227 |
?>
|
228 |
+
<ul class="collapsible ht_ctc_webhooks" data-collapsible="accordion">
|
229 |
+
<li class="">
|
230 |
<div class="collapsible-header"><?php _e( 'Webhooks', 'click-to-chat-for-whatsapp' ); ?></div>
|
231 |
<div class="collapsible-body">
|
232 |
|
284 |
|
285 |
<span style="color:#039be5; cursor:pointer; font-size:16px;"
|
286 |
class="add_hook_value dashicons dashicons-plus-alt2 col s12"
|
287 |
+
data-html='<div class="row additional-value"><div class="col s3"><p class="description"><?php _e( "Add Value", "click-to-chat-for-whatsapp" ); ?></p></div><div class="input-field col s9 m6" style="display: flex;"><input name="ht_ctc_othersettings[hook_v][]" value="" id="hook_v" type="text" class="input-margin"><label for="hook_v"><?php _e( "Value", "click-to-chat-for-whatsapp" ); ?></label><span style="color:lightgrey; cursor:pointer;" class="hook_remove_value dashicons dashicons-no-alt"></span></div></div>'
|
288 |
><?php _e( "Add Value", "click-to-chat-for-whatsapp" ); ?></span>
|
289 |
|
290 |
</div>
|
291 |
+
<?php
|
292 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
293 |
+
?>
|
294 |
+
<p class="description">Webhook Dynamic Varibales - {number}, {url}, {time} - <a href="https://holithemes.com/plugins/click-to-chat/pricing/">PRO</a></p>
|
295 |
+
<?php
|
296 |
+
}
|
297 |
+
?>
|
298 |
|
|
|
|
|
|
|
|
|
299 |
</div>
|
300 |
</li>
|
301 |
</ul>
|
310 |
$show_effect = ( isset( $options['show_effect']) ) ? esc_attr( $options['show_effect'] ) : 'no-show-effects';
|
311 |
$an_delay = ( isset( $options['an_delay']) ) ? esc_attr( $options['an_delay'] ) : '';
|
312 |
$an_itr = ( isset( $options['an_itr']) ) ? esc_attr( $options['an_itr'] ) : '';
|
|
|
|
|
|
|
|
|
|
|
313 |
|
314 |
+
$entry_effect_list = array(
|
315 |
+
'no-show-effects' => '--No-Show-Effects--',
|
316 |
+
'From Center' => 'Center (zoomIn)',
|
317 |
+
'From Corner' => 'Corner (corner of icon)', // js
|
318 |
+
// // new
|
319 |
+
// 'bounceIn' => 'bounceIn',
|
320 |
+
// 'bounceInDown' => 'bounceInDown',
|
321 |
+
// 'bounceInUP' => 'bounceInUP',
|
322 |
+
// 'bounceInLeft' => 'bounceInLeft',
|
323 |
+
// 'bounceInRight' => 'bounceInRight',
|
324 |
+
// // 'bottomRight' => 'bottomRight', //add bounce effect
|
325 |
+
);
|
326 |
+
|
327 |
$an_type = ( isset( $options['an_type']) ) ? esc_attr( $options['an_type'] ) : '';
|
328 |
|
329 |
$an_list = array(
|
330 |
+
'no-animation' => '--No-Animation--',
|
331 |
+
'bounce' => 'Bounce',
|
332 |
+
'flash' => 'Flash',
|
333 |
+
'pulse' => 'Pulse',
|
334 |
+
'heartBeat' => 'HeartBeat',
|
335 |
+
'flip' => 'Flip',
|
336 |
);
|
337 |
|
338 |
?>
|
339 |
+
<ul class="collapsible ht_ctc_animations" data-collapsible="accordion">
|
340 |
+
<li class="">
|
341 |
<div class="collapsible-header"><?php _e( 'Animations', 'click-to-chat-for-whatsapp' ); ?></div>
|
342 |
<div class="collapsible-body">
|
343 |
|
354 |
<select name="ht_ctc_othersettings[an_type]" class="select_an_type">
|
355 |
<?php
|
356 |
|
357 |
+
foreach ( $an_list as $key => $value ) {
|
358 |
?>
|
359 |
+
<option value="<?= $key ?>" <?= $an_type == $key ? 'SELECTED' : ''; ?> ><?= $value ?></option>
|
360 |
<?php
|
361 |
}
|
362 |
|
396 |
<!-- Show effect -->
|
397 |
<div class="row">
|
398 |
<div class="col s6">
|
399 |
+
<p><?php _e( 'Entry Effects', 'click-to-chat-for-whatsapp' ); ?></p>
|
400 |
</div>
|
401 |
<div class="input-field col s6">
|
402 |
<select name="ht_ctc_othersettings[show_effect]" class="show_effect">
|
403 |
<?php
|
404 |
+
foreach ( $entry_effect_list as $key => $value ) {
|
|
|
405 |
?>
|
406 |
+
<option value="<?= $key ?>" <?= $show_effect == $key ? 'SELECTED' : ''; ?> ><?= $value ?></option>
|
407 |
<?php
|
408 |
}
|
409 |
|
410 |
?>
|
411 |
</select>
|
412 |
+
<label><?php _e( 'Entrance Effects', 'click-to-chat-for-whatsapp' ); ?></label>
|
413 |
</div>
|
414 |
</div>
|
415 |
|
426 |
$options = get_option('ht_ctc_othersettings');
|
427 |
$dbrow = 'ht_ctc_othersettings';
|
428 |
|
429 |
+
$aria = (isset($options['aria'])) ? 1 : '';
|
430 |
+
|
431 |
// start other settings
|
432 |
do_action('ht_ctc_ah_admin_start_os');
|
433 |
|
434 |
$li_active_gr_sh = ( isset( $options['enable_group'] ) || isset( $options['enable_share'] ) ) ? "class='active'" : '';
|
435 |
?>
|
436 |
|
437 |
+
<ul class="collapsible ht_ctc_other_settings" data-collapsible="accordion" id="ht_ctc_othersettings">
|
438 |
+
<li class="">
|
439 |
<div class="collapsible-header"><?php _e( 'Other Settings', 'click-to-chat-for-whatsapp' ); ?></div>
|
440 |
<div class="collapsible-body">
|
441 |
|
442 |
+
<p id="aria">
|
443 |
+
<label>
|
444 |
+
<input name="<?php echo $dbrow ?>[aria]" type="checkbox" value="1" <?php checked( $aria, 1 ); ?> id="aria" />
|
445 |
+
<span><?php _e( 'Add aria-hidden=true - hide for Accessibility API (screen readers)', 'click-to-chat-for-whatsapp' ); ?></span>
|
446 |
+
</label>
|
447 |
+
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
448 |
|
449 |
<?php
|
450 |
// hook
|
460 |
<br>
|
461 |
|
462 |
<!-- enable group, share features -->
|
463 |
+
<ul class="collapsible ht_ctc_enable_share_group" data-collapsible="accordion" id="ht_ctc_enable_share_group">
|
464 |
<li <?= $li_active_gr_sh; ?>>
|
465 |
<div class="collapsible-header"><?php _e( 'Group, Share features', 'click-to-chat-for-whatsapp' ); ?></div>
|
466 |
<div class="collapsible-body">
|
520 |
<br>
|
521 |
|
522 |
<!-- chat -->
|
523 |
+
<p class="description"><?php _e( "Chat settings are enabled by default. If like to hide chat on all pages", 'click-to-chat-for-whatsapp' ); ?></p>
|
524 |
+
<p class="description"><?php _e( "'Click to Chat' - 'Display Settings' - 'Global' - check ", 'click-to-chat-for-whatsapp' ); ?> <a target="_blank" href="<?= admin_url( 'admin.php?page=click-to-chat#showhide_settings' ); ?>"><?php _e( "Hide on all pages", 'click-to-chat-for-whatsapp' ); ?></a> - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/enable-chat"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a> </p>
|
525 |
<br>
|
526 |
|
527 |
|
532 |
<br>
|
533 |
|
534 |
<!-- Troubleshoot, Debug, .. -->
|
535 |
+
<ul class="collapsible ht_ctc_debug" data-collapsible="accordion" id="ht_ctc_debug">
|
536 |
<li>
|
537 |
<div class="collapsible-header"><?php _e( 'Debug, Troubleshoot, ..', 'click-to-chat-for-whatsapp' ); ?></div>
|
538 |
<div class="collapsible-body">
|
new/admin/db/class-ht-ctc-db.php
CHANGED
@@ -221,6 +221,7 @@ class HT_CTC_DB {
|
|
221 |
'v3' => 'v3',
|
222 |
'v3_2_5' => 'v3_2_5',
|
223 |
'v3_3_3' => 'v3_3_3',
|
|
|
224 |
);
|
225 |
|
226 |
// Always use update_option - override new values .. don't preseve already existing values
|
221 |
'v3' => 'v3',
|
222 |
'v3_2_5' => 'v3_2_5',
|
223 |
'v3_3_3' => 'v3_3_3',
|
224 |
+
'v3_3_5' => 'v3_3_5',
|
225 |
);
|
226 |
|
227 |
// Always use update_option - override new values .. don't preseve already existing values
|
new/admin/db/class-ht-ctc-db2.php
CHANGED
@@ -289,7 +289,7 @@ class HT_CTC_DB2 {
|
|
289 |
// @since 3.0 cta
|
290 |
if ( !isset ( $this->os['version'] ) ) {
|
291 |
$style_3['cta_type'] = 'hover';
|
292 |
-
$style_3['cta_font_size'] = '
|
293 |
} else {
|
294 |
$style_3['cta_type'] = 'hide';
|
295 |
}
|
289 |
// @since 3.0 cta
|
290 |
if ( !isset ( $this->os['version'] ) ) {
|
291 |
$style_3['cta_type'] = 'hover';
|
292 |
+
$style_3['cta_font_size'] = '13px';
|
293 |
} else {
|
294 |
$style_3['cta_type'] = 'hide';
|
295 |
}
|
new/admin/db/class-ht-ctc-update-db-backup.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* backup/fallback option - if the updater process not worked well.
|
4 |
*
|
5 |
* @package ctc
|
6 |
* @since 3.3.3
|
1 |
<?php
|
2 |
/**
|
3 |
+
* backup/fallback option - if the updater process not worked well. while upgrading the plugin.
|
4 |
*
|
5 |
* @package ctc
|
6 |
* @since 3.3.3
|
new/admin/db/class-ht-ctc-update-db.php
CHANGED
@@ -33,18 +33,24 @@ class HT_CTC_Update_DB {
|
|
33 |
if ( isset( $ht_ctc_plugin_details['version'] ) ) {
|
34 |
|
35 |
// v3: if not yet updated to v3 or above (in v3 $ht_ctc_plugin_details['v3'] is not added)
|
36 |
-
if ( !isset( $ht_ctc_plugin_details['v3'] ) ) {
|
37 |
$this->v3_update();
|
38 |
}
|
39 |
|
40 |
// v3.3.3: if not yet updated to v3.3.3 or above (in v3 $ht_ctc_plugin_details['v3_3_3'] is not added)
|
41 |
-
if ( !isset( $ht_ctc_plugin_details['v3_3_3'] ) ) {
|
42 |
$this->v3_3_3_update_woo();
|
43 |
$this->v3_3_3_update_show_hide_chat();
|
44 |
$this->v3_3_3_update_show_hide_group();
|
45 |
$this->v3_3_3_update_show_hide_share();
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
|
@@ -55,6 +61,44 @@ class HT_CTC_Update_DB {
|
|
55 |
* Database updates..
|
56 |
*/
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
/**
|
60 |
* updating to v3.3.3 or above
|
33 |
if ( isset( $ht_ctc_plugin_details['version'] ) ) {
|
34 |
|
35 |
// v3: if not yet updated to v3 or above (in v3 $ht_ctc_plugin_details['v3'] is not added)
|
36 |
+
if ( ! isset( $ht_ctc_plugin_details['v3'] ) ) {
|
37 |
$this->v3_update();
|
38 |
}
|
39 |
|
40 |
// v3.3.3: if not yet updated to v3.3.3 or above (in v3 $ht_ctc_plugin_details['v3_3_3'] is not added)
|
41 |
+
if ( ! isset( $ht_ctc_plugin_details['v3_3_3'] ) ) {
|
42 |
$this->v3_3_3_update_woo();
|
43 |
$this->v3_3_3_update_show_hide_chat();
|
44 |
$this->v3_3_3_update_show_hide_group();
|
45 |
$this->v3_3_3_update_show_hide_share();
|
46 |
}
|
47 |
|
48 |
+
// v3.3.5: if not yet updated to v3.3.5 or above (in v3.3.5 $ht_ctc_plugin_details['v3_3_5'] is not added)
|
49 |
+
if ( ! isset( $ht_ctc_plugin_details['v3_3_5'] ) ) {
|
50 |
+
$this->v3_3_5_update();
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
}
|
55 |
|
56 |
|
61 |
* Database updates..
|
62 |
*/
|
63 |
|
64 |
+
|
65 |
+
|
66 |
+
/**
|
67 |
+
* updating to v3.3.3 or above
|
68 |
+
*
|
69 |
+
* select styles issue checkbox move from other styles to its c/g/s
|
70 |
+
*
|
71 |
+
* @note: merge this function in the next db update. as only one value..
|
72 |
+
* @imp - if merging - here 'return' is used if not set. need to update this..
|
73 |
+
*/
|
74 |
+
public function v3_3_5_update() {
|
75 |
+
|
76 |
+
$os = get_option('ht_ctc_othersettings');
|
77 |
+
|
78 |
+
if ( ! isset( $os['select_styles_issue'] ) ) {
|
79 |
+
return;
|
80 |
+
}
|
81 |
+
|
82 |
+
$n = array();
|
83 |
+
$n['select_styles_issue'] = '1';
|
84 |
+
|
85 |
+
$chat = get_option( 'ht_ctc_chat_options', array() );
|
86 |
+
$update_chat = array_merge($n, $chat);
|
87 |
+
update_option('ht_ctc_chat_options', $update_chat);
|
88 |
+
|
89 |
+
$group = get_option( 'ht_ctc_group', array() );
|
90 |
+
$update_group = array_merge($n, $group);
|
91 |
+
update_option('ht_ctc_group', $update_chat);
|
92 |
+
|
93 |
+
$share = get_option( 'ht_ctc_share', array() );
|
94 |
+
$update_share = array_merge($n, $share);
|
95 |
+
update_option('ht_ctc_share', $update_chat);
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
|
102 |
|
103 |
/**
|
104 |
* updating to v3.3.3 or above
|
new/inc/assets/js/325.app.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",h="",i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,e(),c();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=l(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}e(),c()}function e(){var t=document.querySelector(".ht_ctc_chat_data");t&&(h=l(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function c(){var t;l(document).trigger("ht_ctc_ce_settings",[i]),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:i}})),(t=document.querySelector(".ht-ctc-chat"))&&(l(document).trigger("ht_ctc_ce_chat"),document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==i.schedule?(l(document).trigger("ht_ctc_ce_display",[i,r,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:i,display_chat:r,ht_ctc_chat:t}}))):r(t)}(t),t.addEventListener("click",function(){d(t)})),l(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),s(this),u(t)}),l(document).on("click",".ctc_chat, #ctc_chat",function(){d(this)}),l(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),d(this)})}function r(t){var e;"yes"==n?"show"==i.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=i.pos_m+i.css,_(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,_(t))}function _(e){try{l(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t,c;c=l(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},c),l(".ht-ctc-chat").hover(function(){l(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){l(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function s(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var e=i.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;(i.ga||i.ga4)&&("undefined"!=typeof gtag?i.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),i.ads&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),i.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function d(t){l(document).trigger("ht_ctc_ce_number",[i]),document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:i}}));var e=i.number,c=(c=i.pre_filled).replace(/\[url]/gi,o);c=encodeURIComponent(c),""!=e?(i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),s(t),u(e)):l(".ht-ctc-chat").html(h)}function u(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),l(document).trigger("ht_ctc_ce_hook",[i,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:i,number:t}})),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),l.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
|
new/inc/assets/js/331.app.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",
|
1 |
+
!function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",h="",i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,e(),c();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=l(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}e(),c()}function e(){var t=document.querySelector(".ht_ctc_chat_data");t&&(h=l(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function c(){var t;l(document).trigger("ht_ctc_ce_settings",[i]),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:i}})),(t=document.querySelector(".ht-ctc-chat"))&&(l(document).trigger("ht_ctc_ce_chat"),document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==i.schedule?(l(document).trigger("ht_ctc_ce_display",[i,r,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:i,display_chat:r,ht_ctc_chat:t}}))):r(t)}(t),t.addEventListener("click",function(){d(t)})),l(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),s(this),u(t)}),l(document).on("click",".ctc_chat, #ctc_chat",function(){d(this)}),l(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),d(this)})}function r(t){var e;"yes"==n?"show"==i.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=i.pos_m+i.css,_(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,_(t))}function _(e){try{l(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t,c;c=l(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},c),l(".ht-ctc-chat").hover(function(){l(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){l(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function s(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var e=i.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;(i.ga||i.ga4)&&("undefined"!=typeof gtag?i.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),i.ads&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),i.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function d(t){l(document).trigger("ht_ctc_ce_number",[i]),document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:i}}));var e=i.number,c=(c=i.pre_filled).replace(/\[url]/gi,o);c=encodeURIComponent(c),""!=e?(i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),s(t),u(e)):l(".ht-ctc-chat").html(h)}function u(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),l(document).trigger("ht_ctc_ce_hook",[i,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:i,number:t}})),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),l.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
|
new/inc/assets/js/332.app.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",
|
1 |
+
!function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",_="",h="";if("undefined"!=typeof ht_ctc_chat_var)h=ht_ctc_chat_var,e(),c();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=l(".ht_ctc_chat_data").attr("data-settings"),h=JSON.parse(t))}catch(t){h={}}e(),c()}function e(){var t=document.querySelector(".ht_ctc_chat_data");t&&(_=l(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function c(){var e;l(document).trigger("ht_ctc_ce_settings",[h]),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:h}})),(e=document.querySelector(".ht-ctc-chat"))&&(l(document).trigger("ht_ctc_ce_chat"),document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==h.schedule?(l(document).trigger("ht_ctc_ce_display",[h,i,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:h,display_chat:i,ht_ctc_chat:t}}))):i(t)}(e),e.addEventListener("click",function(){l(".ht_ctc_chat_greetings_box_link").length||d(e)}),l(".ht_ctc_chat_greetings_box").length&&l(document).on("click",".ht_ctc_chat_style",function(){l(".ht_ctc_chat_greetings_box").toggle(120)}),l(document).on("click",".ctc_greetings_close_btn",function(t){l(".ht_ctc_chat_greetings_box").hide(120),localStorage.setItem("ht_ctc_chat_greetings_box","user_closed")}),l(document).on("click",".ht_ctc_chat_greetings_box_link",function(t){t.preventDefault(),d(e),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))})),l(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),h.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),r(this),u(t)}),l(document).on("click",".ctc_chat, #ctc_chat",function(t){d(this),l(this).hasClass("ctc_woo_place")&&t.preventDefault()}),l(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),d(this)})}function i(t){var e;"yes"==n?"show"==h.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=h.pos_m+h.css,s(t)):"show"==h.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=h.pos_d+h.css,s(t))}function s(e){try{l(e).show(parseInt(h.se))}catch(t){e.style.display="block"}var t,c;c=l(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",h.ani)},c),l(".ht-ctc-chat").hover(function(){l(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){l(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function r(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var e=h.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;(h.ga||h.ga4)&&("undefined"!=typeof gtag?h.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),h.ads&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),h.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function d(t){l(document).trigger("ht_ctc_ce_number",[h]),document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:h}}));var e=h.number,c=(c=h.pre_filled).replace(/\[url]/gi,o);c=encodeURIComponent(c),""!=e?(h.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),r(t),u(e)):l(".ht-ctc-chat").html(_)}function u(t){var e,c;h.hook_url&&(e=h.hook_url,c={},h.hook_v&&(c=h.hook_v),l(document).trigger("ht_ctc_ce_hook",[h,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:h,number:t}})),e=h.hook_url,c=h.hook_v,data=JSON.stringify(c),l.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
|
new/inc/assets/js/app.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",
|
1 |
+
!function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",_="",h="";if("undefined"!=typeof ht_ctc_chat_var)h=ht_ctc_chat_var,e(),c();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=l(".ht_ctc_chat_data").attr("data-settings"),h=JSON.parse(t))}catch(t){h={}}e(),c()}function e(){var t=document.querySelector(".ht_ctc_chat_data");t&&(_=l(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function c(){var e;l(document).trigger("ht_ctc_ce_settings",[h]),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:h}})),(e=document.querySelector(".ht-ctc-chat"))&&(l(document).trigger("ht_ctc_ce_chat"),document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==h.schedule?(l(document).trigger("ht_ctc_ce_display",[h,i,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:h,display_chat:i,ht_ctc_chat:t}}))):i(t)}(e),e.addEventListener("click",function(){l(".ht_ctc_chat_greetings_box_link").length||d(e)}),l(".ht_ctc_chat_greetings_box").length&&l(document).on("click",".ht_ctc_chat_style",function(){l(".ht_ctc_chat_greetings_box").toggle(120)}),l(document).on("click",".ctc_greetings_close_btn",function(t){l(".ht_ctc_chat_greetings_box").hide(120),localStorage.setItem("ht_ctc_chat_greetings_box","user_closed")}),l(document).on("click",".ht_ctc_chat_greetings_box_link",function(t){t.preventDefault(),d(e),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))})),l(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),h.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),r(this),u(t)}),l(document).on("click",".ctc_chat, #ctc_chat",function(t){d(this),l(this).hasClass("ctc_woo_place")&&t.preventDefault()}),l(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),d(this)})}function i(t){var e;"yes"==n?"show"==h.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=h.pos_m+h.css,s(t)):"show"==h.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=h.pos_d+h.css,s(t))}function s(e){try{l(e).show(parseInt(h.se))}catch(t){e.style.display="block"}var t,c;c=l(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",h.ani)},c),l(".ht-ctc-chat").hover(function(){l(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){l(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function r(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var e=h.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;(h.ga||h.ga4)&&("undefined"!=typeof gtag?h.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),h.ads&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),h.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function d(t){l(document).trigger("ht_ctc_ce_number",[h]),document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:h}}));var e=h.number,c=(c=h.pre_filled).replace(/\[url]/gi,o);c=encodeURIComponent(c),""!=e?(h.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),r(t),u(e)):l(".ht-ctc-chat").html(_)}function u(t){var e,c;h.hook_url&&(e=h.hook_url,c={},h.hook_v&&(c=h.hook_v),l(document).trigger("ht_ctc_ce_hook",[h,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:h,number:t}})),e=h.hook_url,c=h.hook_v,data=JSON.stringify(c),l.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
|
new/inc/assets/js/dev/app.dev.js
CHANGED
@@ -46,14 +46,13 @@ $(function () {
|
|
46 |
function start() {
|
47 |
|
48 |
console.log(ctc);
|
49 |
-
|
|
|
|
|
50 |
|
51 |
// fixed position
|
52 |
ht_ctc();
|
53 |
|
54 |
-
// woo positions
|
55 |
-
woo();
|
56 |
-
|
57 |
// shortcode
|
58 |
shortcode();
|
59 |
|
@@ -73,18 +72,58 @@ $(function () {
|
|
73 |
var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
|
74 |
if (ht_ctc_chat) {
|
75 |
|
76 |
-
|
|
|
|
|
77 |
|
78 |
// display
|
79 |
display_settings(ht_ctc_chat);
|
80 |
|
81 |
// click
|
82 |
ht_ctc_chat.addEventListener('click', function () {
|
83 |
-
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
ht_ctc_link(ht_ctc_chat);
|
|
|
|
|
|
|
|
|
85 |
});
|
86 |
|
87 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
// display settings - Fixed position style
|
@@ -92,7 +131,9 @@ $(function () {
|
|
92 |
|
93 |
if ('yes' == ctc.schedule) {
|
94 |
console.log('scheduled');
|
95 |
-
|
|
|
|
|
96 |
} else {
|
97 |
console.log('display directly');
|
98 |
display_chat(ht_ctc_chat);
|
@@ -127,12 +168,8 @@ $(function () {
|
|
127 |
}
|
128 |
|
129 |
function display(p) {
|
130 |
-
// p.style.removeProperty('display');
|
131 |
-
// var x = p.style.getPropertyValue("display");
|
132 |
-
// p.style.display = "block";
|
133 |
try {
|
134 |
$(p).show(parseInt(ctc.se));
|
135 |
-
console.log(dt);
|
136 |
} catch (e) {
|
137 |
p.style.display = "block";
|
138 |
}
|
@@ -144,9 +181,10 @@ $(function () {
|
|
144 |
function ht_ctc_things(p) {
|
145 |
console.log('animations '+ ctc.ani);
|
146 |
// animations
|
|
|
147 |
setTimeout(function () {
|
148 |
p.classList.add('ht_ctc_animation', ctc.ani);
|
149 |
-
},
|
150 |
|
151 |
// cta hover effects
|
152 |
$(".ht-ctc-chat").hover(function () {
|
@@ -161,7 +199,9 @@ $(function () {
|
|
161 |
|
162 |
console.log('analytics');
|
163 |
|
164 |
-
|
|
|
|
|
165 |
|
166 |
// global number (fixed, user created elememt)
|
167 |
var id = ctc.number;
|
@@ -253,11 +293,25 @@ $(function () {
|
|
253 |
function ht_ctc_link(values) {
|
254 |
|
255 |
console.log(ctc.number);
|
256 |
-
|
|
|
|
|
|
|
257 |
console.log(ctc.number);
|
258 |
|
259 |
var number = ctc.number;
|
260 |
var pre_filled = ctc.pre_filled;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
261 |
pre_filled = pre_filled.replace(/\[url]/gi, url);
|
262 |
pre_filled = encodeURIComponent(pre_filled);
|
263 |
|
@@ -313,9 +367,14 @@ $(function () {
|
|
313 |
// custom element
|
314 |
function custom_link() {
|
315 |
|
316 |
-
$(document).on('click', '.ctc_chat, #ctc_chat', function () {
|
317 |
console.log('class/Id: ctc_chat');
|
318 |
ht_ctc_link(this);
|
|
|
|
|
|
|
|
|
|
|
319 |
});
|
320 |
|
321 |
$(document).on('click', '[href="#ctc_chat"]', function (e) {
|
@@ -325,11 +384,6 @@ $(function () {
|
|
325 |
});
|
326 |
}
|
327 |
|
328 |
-
// woo positions
|
329 |
-
function woo() {
|
330 |
-
console.log('woo');
|
331 |
-
}
|
332 |
-
|
333 |
|
334 |
// webhooks
|
335 |
function hook(number) {
|
@@ -357,8 +411,9 @@ $(function () {
|
|
357 |
console.log(h_url);
|
358 |
console.log(hook_values);
|
359 |
|
360 |
-
|
361 |
-
|
|
|
362 |
h_url = ctc.hook_url;
|
363 |
console.log(h_url);
|
364 |
|
46 |
function start() {
|
47 |
|
48 |
console.log(ctc);
|
49 |
+
document.dispatchEvent(
|
50 |
+
new CustomEvent("ht_ctc_event_settings", { detail: { ctc } })
|
51 |
+
);
|
52 |
|
53 |
// fixed position
|
54 |
ht_ctc();
|
55 |
|
|
|
|
|
|
|
56 |
// shortcode
|
57 |
shortcode();
|
58 |
|
72 |
var ht_ctc_chat = document.querySelector('.ht-ctc-chat');
|
73 |
if (ht_ctc_chat) {
|
74 |
|
75 |
+
document.dispatchEvent(
|
76 |
+
new CustomEvent("ht_ctc_event_chat")
|
77 |
+
);
|
78 |
|
79 |
// display
|
80 |
display_settings(ht_ctc_chat);
|
81 |
|
82 |
// click
|
83 |
ht_ctc_chat.addEventListener('click', function () {
|
84 |
+
// ht_ctc_chat_greetings_box_link is not exists..
|
85 |
+
if (! $('.ht_ctc_chat_greetings_box_link').length) {
|
86 |
+
// link
|
87 |
+
ht_ctc_link(ht_ctc_chat);
|
88 |
+
}
|
89 |
+
});
|
90 |
+
|
91 |
+
// greetings dialog settings..
|
92 |
+
greetings();
|
93 |
+
|
94 |
+
// greetings link click..
|
95 |
+
$(document).on('click', '.ht_ctc_chat_greetings_box_link', function (e) {
|
96 |
+
e.preventDefault();
|
97 |
ht_ctc_link(ht_ctc_chat);
|
98 |
+
|
99 |
+
document.dispatchEvent(
|
100 |
+
new CustomEvent("ht_ctc_event_greetings")
|
101 |
+
);
|
102 |
});
|
103 |
|
104 |
}
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
|
110 |
+
function greetings() {
|
111 |
+
|
112 |
+
// display greetings dialog
|
113 |
+
if ($('.ht_ctc_chat_greetings_box').length) {
|
114 |
+
$(document).on('click', '.ht_ctc_chat_style', function () {
|
115 |
+
$('.ht_ctc_chat_greetings_box').toggle(120);
|
116 |
+
// localStorage.setItem('ht_ctc_chat_greetings_box', 'user_opened');
|
117 |
+
});
|
118 |
+
}
|
119 |
+
|
120 |
+
// close btn - greetings dialog
|
121 |
+
$(document).on('click', '.ctc_greetings_close_btn', function (e) {
|
122 |
+
$('.ht_ctc_chat_greetings_box').hide(120);
|
123 |
+
localStorage.setItem('ht_ctc_chat_greetings_box', 'user_closed');
|
124 |
+
});
|
125 |
+
|
126 |
+
|
127 |
}
|
128 |
|
129 |
// display settings - Fixed position style
|
131 |
|
132 |
if ('yes' == ctc.schedule) {
|
133 |
console.log('scheduled');
|
134 |
+
document.dispatchEvent(
|
135 |
+
new CustomEvent("ht_ctc_event_display", { detail: { ctc, display_chat, ht_ctc_chat } })
|
136 |
+
);
|
137 |
} else {
|
138 |
console.log('display directly');
|
139 |
display_chat(ht_ctc_chat);
|
168 |
}
|
169 |
|
170 |
function display(p) {
|
|
|
|
|
|
|
171 |
try {
|
172 |
$(p).show(parseInt(ctc.se));
|
|
|
173 |
} catch (e) {
|
174 |
p.style.display = "block";
|
175 |
}
|
181 |
function ht_ctc_things(p) {
|
182 |
console.log('animations '+ ctc.ani);
|
183 |
// animations
|
184 |
+
var an_time = ($(p).hasClass('ht_ctc_entry_animation')) ? 1200 : 120;
|
185 |
setTimeout(function () {
|
186 |
p.classList.add('ht_ctc_animation', ctc.ani);
|
187 |
+
}, an_time);
|
188 |
|
189 |
// cta hover effects
|
190 |
$(".ht-ctc-chat").hover(function () {
|
199 |
|
200 |
console.log('analytics');
|
201 |
|
202 |
+
document.dispatchEvent(
|
203 |
+
new CustomEvent("ht_ctc_event_analytics")
|
204 |
+
);
|
205 |
|
206 |
// global number (fixed, user created elememt)
|
207 |
var id = ctc.number;
|
293 |
function ht_ctc_link(values) {
|
294 |
|
295 |
console.log(ctc.number);
|
296 |
+
document.dispatchEvent(
|
297 |
+
new CustomEvent("ht_ctc_event_number", { detail: { ctc } })
|
298 |
+
);
|
299 |
+
|
300 |
console.log(ctc.number);
|
301 |
|
302 |
var number = ctc.number;
|
303 |
var pre_filled = ctc.pre_filled;
|
304 |
+
|
305 |
+
if (values.hasAttribute('data-number')) {
|
306 |
+
console.log('has number attribute');
|
307 |
+
number = values.getAttribute('data-number');
|
308 |
+
}
|
309 |
+
|
310 |
+
if (values.hasAttribute('data-pre_filled')) {
|
311 |
+
console.log('has pre_filled attribute');
|
312 |
+
pre_filled = values.getAttribute('data-pre_filled');
|
313 |
+
}
|
314 |
+
|
315 |
pre_filled = pre_filled.replace(/\[url]/gi, url);
|
316 |
pre_filled = encodeURIComponent(pre_filled);
|
317 |
|
367 |
// custom element
|
368 |
function custom_link() {
|
369 |
|
370 |
+
$(document).on('click', '.ctc_chat, #ctc_chat', function (e) {
|
371 |
console.log('class/Id: ctc_chat');
|
372 |
ht_ctc_link(this);
|
373 |
+
|
374 |
+
if ($(this).hasClass('ctc_woo_place')) {
|
375 |
+
// its woo link..
|
376 |
+
e.preventDefault();
|
377 |
+
}
|
378 |
});
|
379 |
|
380 |
$(document).on('click', '[href="#ctc_chat"]', function (e) {
|
384 |
});
|
385 |
}
|
386 |
|
|
|
|
|
|
|
|
|
|
|
387 |
|
388 |
// webhooks
|
389 |
function hook(number) {
|
411 |
console.log(h_url);
|
412 |
console.log(hook_values);
|
413 |
|
414 |
+
document.dispatchEvent(
|
415 |
+
new CustomEvent("ht_ctc_event_hook", { detail: { ctc, number } })
|
416 |
+
);
|
417 |
h_url = ctc.hook_url;
|
418 |
console.log(h_url);
|
419 |
|
new/inc/assets/js/dev/group.dev.js
CHANGED
@@ -88,9 +88,11 @@ function display(p) {
|
|
88 |
|
89 |
// animations
|
90 |
var animateclass = p.getAttribute('data-an_type')
|
|
|
|
|
91 |
setTimeout(function () {
|
92 |
p.classList.add('ht_ctc_animation', animateclass);
|
93 |
-
},
|
94 |
|
95 |
// cta hover effects
|
96 |
$(".ht-ctc-group").hover(function () {
|
88 |
|
89 |
// animations
|
90 |
var animateclass = p.getAttribute('data-an_type')
|
91 |
+
var an_time = ($(p).hasClass('ht_ctc_entry_animation')) ? 1200 : 120;
|
92 |
+
|
93 |
setTimeout(function () {
|
94 |
p.classList.add('ht_ctc_animation', animateclass);
|
95 |
+
}, an_time);
|
96 |
|
97 |
// cta hover effects
|
98 |
$(".ht-ctc-group").hover(function () {
|
new/inc/assets/js/dev/share.dev.js
CHANGED
@@ -79,9 +79,11 @@ function ht_ctc_share_things(p) {
|
|
79 |
|
80 |
// animations
|
81 |
var animateclass = p.getAttribute('data-an_type')
|
|
|
|
|
82 |
setTimeout(function () {
|
83 |
p.classList.add('ht_ctc_animation', animateclass);
|
84 |
-
},
|
85 |
|
86 |
// hover effects
|
87 |
$(".ht-ctc-share").hover(function () {
|
79 |
|
80 |
// animations
|
81 |
var animateclass = p.getAttribute('data-an_type')
|
82 |
+
var an_time = ($(p).hasClass('ht_ctc_entry_animation')) ? 1200 : 120;
|
83 |
+
|
84 |
setTimeout(function () {
|
85 |
p.classList.add('ht_ctc_animation', animateclass);
|
86 |
+
}, an_time);
|
87 |
|
88 |
// hover effects
|
89 |
$(".ht-ctc-share").hover(function () {
|
new/inc/assets/js/group.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(u){u(function(){var t,e,a,o,n,i=window.location.href,c=void 0!==screen.width&&1024<screen.width?"no":"yes",r=void 0!==document.title?document.title:"";function d(e){try{var t=parseInt(e.getAttribute("data-show_effect"));u(e).show(t)}catch(t){e.style.display="block"}var a=e.getAttribute("data-an_type"),o=u(e).hasClass("ht_ctc_entry_animation")?1200:120;setTimeout(function(){e.classList.add("ht_ctc_animation",a)},o),u(".ht-ctc-group").hover(function(){u(".ht-ctc-group .ht-ctc-cta-hover").show(220)},function(){u(".ht-ctc-group .ht-ctc-cta-hover").hide(100)})}function s(t){var e=t.getAttribute("data-group_id"),a="Click to Chat for WhatsApp",o="group: "+e,n=r+", "+i;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",o,{event_category:a,event_label:n}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,o,n):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,o,n)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:n,event_action:o}),"yes"==t.getAttribute("data-ga_ads")&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"group",ID:e,Title:r,URL:i})}(n=document.querySelector(".ht-ctc-group"))&&(t=n,"yes"==c?"show"==t.getAttribute("data-display_mobile")&&((o=document.querySelector(".ht_ctc_desktop_group"))&&o.remove(),a=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+a,d(t)):"show"==t.getAttribute("data-display_desktop")&&((o=document.querySelector(".ht_ctc_mobile_group"))&&o.remove(),a=t.getAttribute("data-css"),o=t.getAttribute("data-position"),t.style.cssText=o+a,d(t)),n.addEventListener("click",function(){var t=n.getAttribute("data-group_id");window.open("https://chat.whatsapp.com/"+t,"_blank","noopener"),s(n)})),u(document).on("click",".ht-ctc-sc-group",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),s(this)})})}(jQuery);
|
new/inc/assets/js/share.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(h){h(function(){var t,e,a,n,i,o=window.location.href,c=void 0!==screen.width&&1024<screen.width?"no":"yes",r=void 0!==document.title?document.title:"";function s(e){try{var t=parseInt(e.getAttribute("data-show_effect"));h(e).show(t)}catch(t){e.style.display="block"}var a,n;n=(a=e).getAttribute("data-an_type"),setTimeout(function(){a.classList.add("ht_ctc_animation",n)},
|
1 |
+
!function(h){h(function(){var t,e,a,n,i,o=window.location.href,c=void 0!==screen.width&&1024<screen.width?"no":"yes",r=void 0!==document.title?document.title:"";function s(e){try{var t=parseInt(e.getAttribute("data-show_effect"));h(e).show(t)}catch(t){e.style.display="block"}var a,n,i;n=(a=e).getAttribute("data-an_type"),i=h(a).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){a.classList.add("ht_ctc_animation",n)},i),h(".ht-ctc-share").hover(function(){h(".ht-ctc-share .ht-ctc-cta-hover").show(220)},function(){h(".ht-ctc-share .ht-ctc-cta-hover").hide(100)})}function d(t){var e=t.getAttribute("data-share_text"),a="Click to Chat for WhatsApp",n="share: "+e,i=r+", "+o;"yes"==t.getAttribute("data-is_ga_enable")&&("undefined"!=typeof gtag?gtag("event",n,{event_category:a,event_label:i}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",a,n,i):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",a,n,i)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",event_category:a,event_label:i,event_action:n}),"yes"==t.getAttribute("data-ga_ads")&&"undefined"!=typeof gtag_report_conversion&>ag_report_conversion(),"yes"==t.getAttribute("data-is_fb_pixel")&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"share",ID:e,Title:r,URL:o})}(i=document.querySelector(".ht-ctc-share"))&&(t=i,"yes"==c?"show"==t.getAttribute("data-display_mobile")&&((n=document.querySelector(".ht_ctc_desktop_share"))&&n.remove(),a=t.getAttribute("data-css"),e=t.getAttribute("data-position_mobile"),t.style.cssText=e+a,s(t)):"show"==t.getAttribute("data-display_desktop")&&((n=document.querySelector(".ht_ctc_mobile_share"))&&n.remove(),a=t.getAttribute("data-css"),n=t.getAttribute("data-position"),t.style.cssText=n+a,s(t)),i.addEventListener("click",function(){var t;(function(t){var e=t.getAttribute("data-share_text");t="https://"+(t="webapi"==t.getAttribute("data-webandapi")?"yes"==c?"api":"web":"api")+".whatsapp.com/send",window.open(t+"?text="+e,"_blank","noopener")})(t=i),d(t)})),h(document).on("click",".ht-ctc-sc-share",function(){data_link=this.getAttribute("data-ctc-link"),data_link=encodeURI(data_link),window.open(data_link,"_blank","noopener"),d(this)})})}(jQuery);
|
new/inc/chat/class-ht-ctc-chat-shortcode.php
CHANGED
@@ -195,6 +195,7 @@ class HT_CTC_Chat_Shortcode {
|
|
195 |
|
196 |
// analytics
|
197 |
$ht_ctc_os['data-attributes'] = '';
|
|
|
198 |
|
199 |
// Hooks
|
200 |
$ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
|
195 |
|
196 |
// analytics
|
197 |
$ht_ctc_os['data-attributes'] = '';
|
198 |
+
$ht_ctc_os['class_names'] = '';
|
199 |
|
200 |
// Hooks
|
201 |
$ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
|
new/inc/chat/class-ht-ctc-chat.php
CHANGED
@@ -24,12 +24,6 @@ class HT_CTC_Chat {
|
|
24 |
|
25 |
// If db values are not correct
|
26 |
if ( !is_array($options) || !isset($options['number']) ) {
|
27 |
-
// in debug mode
|
28 |
-
if ( isset($othersettings['debug_mode']) ) {
|
29 |
-
?>
|
30 |
-
<script>console.log('please check plugin settings and save changes')</script>
|
31 |
-
<?php
|
32 |
-
}
|
33 |
return;
|
34 |
}
|
35 |
|
@@ -39,9 +33,56 @@ class HT_CTC_Chat {
|
|
39 |
$ht_ctc_settings = array();
|
40 |
|
41 |
$page_id = get_the_ID();
|
|
|
|
|
42 |
$page_url = get_permalink();
|
43 |
$post_title = esc_html( get_the_title() );
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
// page level
|
46 |
$ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
|
47 |
|
@@ -135,8 +176,14 @@ class HT_CTC_Chat {
|
|
135 |
$ht_ctc_os['is_fb_pixel'] = 'yes';
|
136 |
$ht_ctc_os['ga_ads'] = 'no';
|
137 |
$ht_ctc_os['data-attributes'] = '';
|
|
|
|
|
|
|
|
|
|
|
138 |
// show effect
|
139 |
$ht_ctc_os['show_effect'] = '';
|
|
|
140 |
|
141 |
// hooks
|
142 |
$ht_ctc_chat = apply_filters( 'ht_ctc_fh_chat', $ht_ctc_chat );
|
@@ -161,7 +208,9 @@ class HT_CTC_Chat {
|
|
161 |
$style_mobile = $ht_ctc_chat['style_mobile'];
|
162 |
$call_to_action = $ht_ctc_chat['call_to_action'];
|
163 |
|
164 |
-
$
|
|
|
|
|
165 |
|
166 |
// call style
|
167 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
@@ -307,9 +356,13 @@ class HT_CTC_Chat {
|
|
307 |
do_action('ht_ctc_ah_before_fixed_position');
|
308 |
?>
|
309 |
<div class="<?= $ht_ctc_chat['class_names'] ?>" id="<?= $ht_ctc_chat['id'] ?>"
|
310 |
-
style="<?= $display_css ?> <?= $default_position ?>" <?= $on ?> >
|
|
|
|
|
|
|
|
|
311 |
<?php
|
312 |
-
if ( isset( $
|
313 |
?>
|
314 |
<div class="ht_ctc_desktop_chat"><?php include $path_d; ?></div>
|
315 |
<div class="ht_ctc_mobile_chat"><?php include $path_m; ?></div>
|
@@ -318,6 +371,7 @@ class HT_CTC_Chat {
|
|
318 |
include $path;
|
319 |
}
|
320 |
?>
|
|
|
321 |
</div>
|
322 |
<?php
|
323 |
do_action('ht_ctc_ah_after_fixed_position');
|
24 |
|
25 |
// If db values are not correct
|
26 |
if ( !is_array($options) || !isset($options['number']) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
return;
|
28 |
}
|
29 |
|
33 |
$ht_ctc_settings = array();
|
34 |
|
35 |
$page_id = get_the_ID();
|
36 |
+
// $page_id = get_queried_object_id()
|
37 |
+
|
38 |
$page_url = get_permalink();
|
39 |
$post_title = esc_html( get_the_title() );
|
40 |
|
41 |
+
if ( is_home() || is_front_page() ) {
|
42 |
+
// is home page
|
43 |
+
$page_url = home_url('/');
|
44 |
+
// if home page is a loop then return site name.. (instead of getting the last post title in that loop)
|
45 |
+
$post_title = HT_CTC_BLOG_NAME;
|
46 |
+
|
47 |
+
// if home page is a page then return page title.. (if not {site} and {title} will be same )
|
48 |
+
if ( is_page() ) {
|
49 |
+
$post_title = esc_html( get_the_title() );
|
50 |
+
}
|
51 |
+
} elseif ( is_singular() ) {
|
52 |
+
// is singular
|
53 |
+
$page_url = get_permalink();
|
54 |
+
$post_title = esc_html( get_the_title() );
|
55 |
+
} elseif ( is_archive() ) {
|
56 |
+
|
57 |
+
if ( isset($_SERVER['HTTP_HOST']) && $_SERVER['REQUEST_URI'] ) {
|
58 |
+
$protocol = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ) ? 'https' : 'http';
|
59 |
+
$page_url = $protocol . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
60 |
+
}
|
61 |
+
|
62 |
+
if ( is_category() ) {
|
63 |
+
$post_title = single_cat_title( '', false );
|
64 |
+
} elseif ( is_tag() ) {
|
65 |
+
$post_title = single_tag_title( '', false );
|
66 |
+
} elseif ( is_author() ) {
|
67 |
+
$post_title = get_the_author();
|
68 |
+
} elseif ( is_post_type_archive() ) {
|
69 |
+
$post_title = post_type_archive_title( '', false );
|
70 |
+
} elseif ( function_exists( 'is_tax') && function_exists( 'single_term_title') && is_tax() ) {
|
71 |
+
$post_title = single_term_title( '', false );
|
72 |
+
} else {
|
73 |
+
if ( function_exists('get_the_archive_title') ) {
|
74 |
+
$post_title = get_the_archive_title();
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
}
|
79 |
+
|
80 |
+
// is shop page
|
81 |
+
if ( class_exists( 'WooCommerce' ) && function_exists( 'is_shop') && function_exists( 'wc_get_page_id') && is_shop() ) {
|
82 |
+
$page_id = wc_get_page_id( 'shop' );
|
83 |
+
$post_title = esc_html( get_the_title( $page_id ) );
|
84 |
+
}
|
85 |
+
|
86 |
// page level
|
87 |
$ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
|
88 |
|
176 |
$ht_ctc_os['is_fb_pixel'] = 'yes';
|
177 |
$ht_ctc_os['ga_ads'] = 'no';
|
178 |
$ht_ctc_os['data-attributes'] = '';
|
179 |
+
// @since v3.3.5 new way of adding attributes [data-attributes]
|
180 |
+
$ht_ctc_os['attributes'] = '';
|
181 |
+
|
182 |
+
// class name related to animations..
|
183 |
+
$ht_ctc_os['class_names'] = '';
|
184 |
// show effect
|
185 |
$ht_ctc_os['show_effect'] = '';
|
186 |
+
$ht_ctc_os['an_type'] = '';
|
187 |
|
188 |
// hooks
|
189 |
$ht_ctc_chat = apply_filters( 'ht_ctc_fh_chat', $ht_ctc_chat );
|
208 |
$style_mobile = $ht_ctc_chat['style_mobile'];
|
209 |
$call_to_action = $ht_ctc_chat['call_to_action'];
|
210 |
|
211 |
+
$other_classes = $ht_ctc_os['class_names'];
|
212 |
+
|
213 |
+
$ht_ctc_chat['class_names'] .= " $wp_device style-$style $other_classes ";
|
214 |
|
215 |
// call style
|
216 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
356 |
do_action('ht_ctc_ah_before_fixed_position');
|
357 |
?>
|
358 |
<div class="<?= $ht_ctc_chat['class_names'] ?>" id="<?= $ht_ctc_chat['id'] ?>"
|
359 |
+
style="<?= $display_css ?> <?= $default_position ?>" <?= $ht_ctc_os['attributes'] ?> <?= $on ?> >
|
360 |
+
<?php
|
361 |
+
do_action('ht_ctc_ah_in_fixed_position');
|
362 |
+
?>
|
363 |
+
<div class="ht_ctc_style ht_ctc_chat_style">
|
364 |
<?php
|
365 |
+
if ( isset( $options['select_styles_issue'] ) ) {
|
366 |
?>
|
367 |
<div class="ht_ctc_desktop_chat"><?php include $path_d; ?></div>
|
368 |
<div class="ht_ctc_mobile_chat"><?php include $path_m; ?></div>
|
371 |
include $path;
|
372 |
}
|
373 |
?>
|
374 |
+
</div>
|
375 |
</div>
|
376 |
<?php
|
377 |
do_action('ht_ctc_ah_after_fixed_position');
|
new/inc/commons/class-ht-ctc-animations.php
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
|
|
4 |
* @since 2.8
|
|
|
5 |
*/
|
6 |
|
7 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
@@ -15,43 +17,165 @@ class HT_CTC_Animations {
|
|
15 |
// $this->base();
|
16 |
// }
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
?>
|
20 |
-
<style id="ht-ctc-animations">.ht_ctc_animation{animation-duration
|
21 |
-
<?php $this->$a(); ?>
|
22 |
<?php
|
23 |
}
|
24 |
|
25 |
-
|
|
|
|
|
|
|
26 |
?>
|
27 |
-
<style id="ht-ctc-
|
|
|
28 |
<?php
|
29 |
}
|
|
|
30 |
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
?>
|
33 |
-
<style id="
|
34 |
<?php
|
35 |
}
|
36 |
|
37 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
?>
|
39 |
-
<style id="
|
|
|
40 |
<?php
|
41 |
}
|
42 |
|
43 |
-
function
|
44 |
?>
|
45 |
-
<style id="
|
46 |
<?php
|
47 |
}
|
48 |
|
49 |
-
function
|
50 |
?>
|
51 |
-
<style id="
|
52 |
<?php
|
53 |
}
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
|
57 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
+
*
|
4 |
+
* Animation styles - regular, Entry effects
|
5 |
* @since 2.8
|
6 |
+
* @since 3.3.5 added entry effects
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
17 |
// $this->base();
|
18 |
// }
|
19 |
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Animations
|
24 |
+
*
|
25 |
+
* Based of animations - with dealy, iteration
|
26 |
+
* and then calls the necessary animation function.
|
27 |
+
*
|
28 |
+
* @param string $a animation type (bounce, .. )
|
29 |
+
* @param string $ad animation duration (1s)
|
30 |
+
* @param string $d time delay (1s)
|
31 |
+
* @param int|[string] $i interation count 1
|
32 |
+
*
|
33 |
+
* $a($a) - it like calling bounce('bounce')
|
34 |
+
*/
|
35 |
+
function animations( $a, $ad, $d, $i ) {
|
36 |
?>
|
37 |
+
<style id="ht-ctc-animations">.ht_ctc_animation{animation-duration:<?= $ad ?>;animation-fill-mode:both;animation-delay:<?= $d ?>;animation-iteration-count:<?= $i ?>;}</style>
|
38 |
+
<?php $this->$a("ht_ctc_an_$a"); ?>
|
39 |
<?php
|
40 |
}
|
41 |
|
42 |
+
/**
|
43 |
+
* Entry Animations
|
44 |
+
*/
|
45 |
+
function entry( $a, $ad, $d, $i ) {
|
46 |
?>
|
47 |
+
<style id="ht-ctc-entry-animations">.ht_ctc_entry_animation{animation-duration:<?= $ad ?>;animation-fill-mode:both;animation-delay:<?= $d ?>;animation-iteration-count:<?= $i ?>;}</style>
|
48 |
+
<?php $this->$a("ht_ctc_an_entry_$a"); ?>
|
49 |
<?php
|
50 |
}
|
51 |
+
|
52 |
|
53 |
+
// Animations types css for main, entry
|
54 |
+
|
55 |
+
function bounce($a) {
|
56 |
+
?>
|
57 |
+
<style id="<?= $a ?>">@keyframes bounce{from,20%,53%,to{animation-timing-function:cubic-bezier(0.215,0.61,0.355,1);transform:translate3d(0,0,0)}40%,43%{animation-timing-function:cubic-bezier(0.755,0.05,0.855,0.06);transform:translate3d(0,-30px,0) scaleY(1.1)}70%{animation-timing-function:cubic-bezier(0.755,0.05,0.855,0.06);transform:translate3d(0,-15px,0) scaleY(1.05)}80%{transition-timing-function:cubic-bezier(0.215,0.61,0.355,1);transform:translate3d(0,0,0) scaleY(0.95)}90%{transform:translate3d(0,-4px,0) scaleY(1.02)}}<?= '.'.$a ?>{animation-name:bounce;transform-origin:center bottom}</style>
|
58 |
+
<?php
|
59 |
+
}
|
60 |
+
|
61 |
+
function flash($a) {
|
62 |
+
?>
|
63 |
+
<style id="<?= $a ?>">@keyframes flash{from,50%,to{opacity:1}25%,75%{opacity:0}}<?= '.'.$a ?>{animation-name:flash}</style>
|
64 |
+
<?php
|
65 |
+
}
|
66 |
+
|
67 |
+
function pulse($a) {
|
68 |
+
?>
|
69 |
+
<style id="<?= $a ?>">@keyframes pulse{from{transform:scale3d(1,1,1)}50%{transform:scale3d(1.05,1.05,1.05)}to{transform:scale3d(1,1,1)}}<?= '.'.$a ?>{animation-name:pulse;animation-timing-function:ease-in-out}</style>
|
70 |
+
<?php
|
71 |
+
}
|
72 |
+
|
73 |
+
function heartbeat($a) {
|
74 |
+
?>
|
75 |
+
<style id="<?= $a ?>">@keyframes heartBeat{0%{transform:scale(1)}14%{transform:scale(1.3)}28%{transform:scale(1)}42%{transform:scale(1.3)}70%{transform:scale(1)}}<?= '.'.$a ?>{animation-name:heartBeat;animation-duration:calc(1s * 1.3);animation-duration:calc(var(1) * 1.3);animation-timing-function:ease-in-out}</style>
|
76 |
+
<?php
|
77 |
+
}
|
78 |
+
|
79 |
+
function flip($a) {
|
80 |
?>
|
81 |
+
<style id="<?= $a ?>">@keyframes flip{from{transform:perspective(400px) scale3d(1,1,1) translate3d(0,0,0) rotate3d(0,1,0,-360deg);animation-timing-function:ease-out}40%{transform:perspective(400px) scale3d(1,1,1) translate3d(0,0,150px) rotate3d(0,1,0,-190deg);animation-timing-function:ease-out}50%{transform:perspective(400px) scale3d(1,1,1) translate3d(0,0,150px) rotate3d(0,1,0,-170deg);animation-timing-function:ease-in}80%{transform:perspective(400px) scale3d(.95,.95,.95) translate3d(0,0,0) rotate3d(0,1,0,0deg);animation-timing-function:ease-in}to{transform:perspective(400px) scale3d(1,1,1) translate3d(0,0,0) rotate3d(0,1,0,0deg);animation-timing-function:ease-in}}<?= '.'.$a ?>{backface-visibility:visible;animation-name:flip}</style>
|
82 |
<?php
|
83 |
}
|
84 |
|
85 |
+
function bounceInLeft($a) {
|
86 |
+
?>
|
87 |
+
<style id="<?= $a ?>">@keyframes bounceInLeft{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215,0.61,0.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0) scaleX(3)}60%{opacity:1;transform:translate3d(25px,0,0) scaleX(1)}75%{transform:translate3d(-10px,0,0) scaleX(0.98)}90%{transform:translate3d(5px,0,0) scaleX(0.995)}to{transform:translate3d(0,0,0)}}<?= '.'.$a ?>{animation-name:bounceInLeft}</style>
|
88 |
+
<?php
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
function bounceInRight($a) {
|
93 |
?>
|
94 |
+
<style id="<?= $a ?>">@keyframes bounceInRight{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215,0.61,0.355,1)}from{opacity:0;transform:translate3d(3000px,0,0) scaleX(3)}60%{opacity:1;transform:translate3d(-25px,0,0) scaleX(1)}75%{transform:translate3d(10px,0,0) scaleX(0.98)}90%{transform:translate3d(-5px,0,0) scaleX(0.995)}to{transform:translate3d(0,0,0)}}<?= '.'.$a ?>{animation-name:bounceInRight}</style>
|
95 |
+
</style>
|
96 |
<?php
|
97 |
}
|
98 |
|
99 |
+
function bounceIn($a) {
|
100 |
?>
|
101 |
+
<style id="<?= $a ?>">@keyframes bounceIn{from,20%,40%,60%,80%,to{animation-timing-function:cubic-bezier(0.215,0.61,0.355,1)}0%{opacity:0;transform:scale3d(0.3,0.3,0.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(0.9,0.9,0.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(0.97,0.97,0.97)}to{opacity:1;transform:scale3d(1,1,1)}}<?= '.'.$a ?>{animation-duration:calc(1s * 0.75);animation-duration:calc(var(1) * 0.75);animation-name:bounceIn}</style>
|
102 |
<?php
|
103 |
}
|
104 |
|
105 |
+
function bounceInDown($a) {
|
106 |
?>
|
107 |
+
<style id="<?= $a ?>">@keyframes bounceInDown{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215,0.61,0.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0) scaleY(3)}60%{opacity:1;transform:translate3d(0,25px,0) scaleY(0.9)}75%{transform:translate3d(0,-10px,0) scaleY(0.95)}90%{transform:translate3d(0,5px,0) scaleY(0.985)}to{transform:translate3d(0,0,0)}}<?= '.'.$a ?>{animation-name:bounceInDown}</style>
|
108 |
<?php
|
109 |
}
|
110 |
|
111 |
+
function bounceInUp($a) {
|
112 |
+
?>
|
113 |
+
<style id="<?= $a ?>">@keyframes bounceInUp{from,60%,75%,90%,to{animation-timing-function:cubic-bezier(0.215,0.61,0.355,1)}from{opacity:0;transform:translate3d(0,3000px,0) scaleY(5)}60%{opacity:1;transform:translate3d(0,-20px,0) scaleY(0.9)}75%{transform:translate3d(0,10px,0) scaleY(0.95)}90%{transform:translate3d(0,-5px,0) scaleY(0.985)}to{transform:translate3d(0,0,0)}}<?= '.'.$a ?>{animation-name:bounceInUp}</style>
|
114 |
+
<?php
|
115 |
+
}
|
116 |
+
|
117 |
+
|
118 |
+
// local
|
119 |
+
function center($a) {
|
120 |
+
?>
|
121 |
+
<style id="<?= $a ?>">@keyframes center{from{transform:scale(0);}to{transform: scale(1);}}<?= '.'.$a ?>{animation: center .25s;}</style>
|
122 |
+
<?php
|
123 |
+
}
|
124 |
+
|
125 |
+
// local
|
126 |
+
// this function is not calling. js handle the corner effect...
|
127 |
+
function corner($a) {
|
128 |
+
?>
|
129 |
+
<style id="<?= $a ?>">@keyframes corner{to{transform:scale(1)}}<?= '.'.$a ?>{animation:corner .9s}</style>
|
130 |
+
<?php
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
// zoomin not using ( using center() )
|
135 |
+
function zoomIn($a) {
|
136 |
+
?>
|
137 |
+
<style id="<?= $a ?>">
|
138 |
+
@keyframes zoomIn {
|
139 |
+
from {
|
140 |
+
opacity: 0;
|
141 |
+
transform: scale3d(0.3, 0.3, 0.3);
|
142 |
+
}
|
143 |
+
|
144 |
+
50% {
|
145 |
+
opacity: 1;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
<?= '.'.$a ?> {
|
149 |
+
animation: zoomIn .25s;
|
150 |
+
/* animation-name: zoomIn; */
|
151 |
+
}
|
152 |
+
</style>
|
153 |
+
<?php
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
// local
|
158 |
+
// have to improve, add bounce effect..
|
159 |
+
function bottomRight($a) {
|
160 |
+
?>
|
161 |
+
<style id="<?= $a ?>">
|
162 |
+
|
163 |
+
@keyframes bounceInBR {
|
164 |
+
0% {
|
165 |
+
transform: translateY(1000px) translateX(1000px);
|
166 |
+
opacity: 0;
|
167 |
+
}
|
168 |
+
100% {
|
169 |
+
transform: translateY(0) translateX(0);
|
170 |
+
opacity: 1;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
<?= '.'.$a ?> {
|
174 |
+
animation: bounceInBR 0.5s linear both;
|
175 |
+
}
|
176 |
+
</style>
|
177 |
+
<?php
|
178 |
+
}
|
179 |
|
180 |
|
181 |
}
|
new/inc/commons/class-ht-ctc-hooks.php
CHANGED
@@ -40,31 +40,52 @@ class HT_CTC_Hooks {
|
|
40 |
* Action Hooks
|
41 |
*/
|
42 |
|
43 |
-
|
|
|
|
|
|
|
|
|
44 |
function css_styles() {
|
45 |
|
46 |
$othersettings = get_option('ht_ctc_othersettings');
|
47 |
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
<style id="ht_ctc_fromcenter">@keyframes ht_ctc_fromcenter{from{transform:scale(0);}to{transform: scale(1);}}.ht-ctc{animation: ht_ctc_fromcenter .25s;}</style>
|
53 |
-
<?php
|
54 |
-
}
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
// Animation styles
|
57 |
$an_type = ( isset( $othersettings['an_type']) ) ? esc_attr( $othersettings['an_type'] ) : '';
|
58 |
|
59 |
if ( '' !== $an_type && 'no-animation' !== $an_type ) {
|
60 |
|
|
|
61 |
$an_delay = ( isset( $othersettings['an_delay']) ) ? esc_attr( $othersettings['an_delay'] ) : '0';
|
62 |
$an_delay = "{$an_delay}s";
|
63 |
$an_itr = ( isset( $othersettings['an_itr']) ) ? esc_attr( $othersettings['an_itr'] ) : '1';
|
64 |
|
65 |
include_once HT_CTC_PLUGIN_DIR .'new/inc/commons/class-ht-ctc-animations.php';
|
66 |
$animations = new HT_CTC_Animations();
|
67 |
-
$animations->animations( $an_type, $an_delay, $an_itr );
|
68 |
}
|
69 |
|
70 |
}
|
@@ -80,7 +101,14 @@ class HT_CTC_Hooks {
|
|
80 |
* Filter Hooks
|
81 |
*/
|
82 |
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
function chat_settings( $ht_ctc_chat ) {
|
85 |
|
86 |
// Number format
|
@@ -95,34 +123,71 @@ class HT_CTC_Hooks {
|
|
95 |
return $ht_ctc_chat;
|
96 |
}
|
97 |
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
function other_settings( $ht_ctc_os ) {
|
100 |
|
101 |
$othersettings = get_option('ht_ctc_othersettings');
|
102 |
|
103 |
-
$ht_ctc_os['
|
104 |
$ht_ctc_os['is_ga_enable'] = (isset( $othersettings['google_analytics'] )) ? 'yes' : 'no';
|
105 |
$ht_ctc_os['ga4'] = (isset( $othersettings['ga4'] )) ? 'yes' : 'no';
|
106 |
$ht_ctc_os['is_fb_pixel'] = (isset( $othersettings['fb_pixel'] )) ? 'yes' : 'no';
|
107 |
$ht_ctc_os['ga_ads'] = (isset( $othersettings['ga_ads'] )) ? 'yes' : 'no';
|
108 |
-
|
109 |
-
// version number
|
110 |
-
$ht_ctc_os['v'] = HT_CTC_VERSION;
|
111 |
|
|
|
112 |
|
113 |
-
// show effect ? if 'From Corner' - then return time (
|
114 |
if ( 'From Corner' == $ht_ctc_os['show_effect'] ) {
|
115 |
-
$ht_ctc_os['show_effect'] =
|
116 |
}
|
117 |
|
118 |
// Animations
|
119 |
$ht_ctc_os['an_type'] = "no-animations";
|
120 |
$an_type = ( isset( $othersettings['an_type']) ) ? esc_attr( $othersettings['an_type'] ) : 'no-animation';
|
|
|
121 |
if ( 'no-animation' !== $an_type ) {
|
|
|
122 |
$ht_ctc_os['data-attributes'] .= "data-an_type='ht_ctc_an_$an_type' ";
|
|
|
123 |
$ht_ctc_os['an_type'] = "ht_ctc_an_$an_type";
|
124 |
}
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
return $ht_ctc_os;
|
127 |
}
|
128 |
|
40 |
* Action Hooks
|
41 |
*/
|
42 |
|
43 |
+
/**
|
44 |
+
* css styles - before fixed position
|
45 |
+
*
|
46 |
+
* Animations
|
47 |
+
*/
|
48 |
function css_styles() {
|
49 |
|
50 |
$othersettings = get_option('ht_ctc_othersettings');
|
51 |
|
52 |
+
// Entry effects
|
53 |
+
// check: - entry effect - 'from center', 'from corner' - have to make work as similar to other effects
|
54 |
+
$entry = ( isset( $othersettings['show_effect']) ) ? esc_attr( $othersettings['show_effect'] ) : '';
|
55 |
+
|
56 |
+
if ( '' !== $entry && 'no-show-effects' !== $entry && 'From Corner' !== $entry ) {
|
57 |
|
58 |
+
if ('From Center' == $entry) {
|
59 |
+
$entry = 'center';
|
60 |
+
}
|
|
|
|
|
|
|
61 |
|
62 |
+
// From Corner animation handle from js
|
63 |
+
// if ('From Corner' == $entry) {
|
64 |
+
// $entry = 'corner';
|
65 |
+
// }
|
66 |
+
|
67 |
+
$an_duration = '1s';
|
68 |
+
$an_delay = "0s";
|
69 |
+
$an_itr = '1';
|
70 |
+
|
71 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/commons/class-ht-ctc-animations.php';
|
72 |
+
$animations = new HT_CTC_Animations();
|
73 |
+
$animations->entry( $entry, $an_duration, $an_delay, $an_itr );
|
74 |
+
}
|
75 |
+
|
76 |
// Animation styles
|
77 |
$an_type = ( isset( $othersettings['an_type']) ) ? esc_attr( $othersettings['an_type'] ) : '';
|
78 |
|
79 |
if ( '' !== $an_type && 'no-animation' !== $an_type ) {
|
80 |
|
81 |
+
$an_duration = '1s';
|
82 |
$an_delay = ( isset( $othersettings['an_delay']) ) ? esc_attr( $othersettings['an_delay'] ) : '0';
|
83 |
$an_delay = "{$an_delay}s";
|
84 |
$an_itr = ( isset( $othersettings['an_itr']) ) ? esc_attr( $othersettings['an_itr'] ) : '1';
|
85 |
|
86 |
include_once HT_CTC_PLUGIN_DIR .'new/inc/commons/class-ht-ctc-animations.php';
|
87 |
$animations = new HT_CTC_Animations();
|
88 |
+
$animations->animations( $an_type, $an_duration, $an_delay, $an_itr );
|
89 |
}
|
90 |
|
91 |
}
|
101 |
* Filter Hooks
|
102 |
*/
|
103 |
|
104 |
+
/**
|
105 |
+
* Chat settings filer
|
106 |
+
*
|
107 |
+
* number format
|
108 |
+
*
|
109 |
+
* @param [type] $ht_ctc_chat
|
110 |
+
* @return void
|
111 |
+
*/
|
112 |
function chat_settings( $ht_ctc_chat ) {
|
113 |
|
114 |
// Number format
|
123 |
return $ht_ctc_chat;
|
124 |
}
|
125 |
|
126 |
+
/**
|
127 |
+
* other settings - filter hook
|
128 |
+
*
|
129 |
+
* animations, analytics, class names, ..
|
130 |
+
*
|
131 |
+
* @param array $ht_ctc_os
|
132 |
+
* @return $ht_ctc_os
|
133 |
+
*/
|
134 |
function other_settings( $ht_ctc_os ) {
|
135 |
|
136 |
$othersettings = get_option('ht_ctc_othersettings');
|
137 |
|
138 |
+
$ht_ctc_os['v'] = HT_CTC_VERSION;
|
139 |
$ht_ctc_os['is_ga_enable'] = (isset( $othersettings['google_analytics'] )) ? 'yes' : 'no';
|
140 |
$ht_ctc_os['ga4'] = (isset( $othersettings['ga4'] )) ? 'yes' : 'no';
|
141 |
$ht_ctc_os['is_fb_pixel'] = (isset( $othersettings['fb_pixel'] )) ? 'yes' : 'no';
|
142 |
$ht_ctc_os['ga_ads'] = (isset( $othersettings['ga_ads'] )) ? 'yes' : 'no';
|
|
|
|
|
|
|
143 |
|
144 |
+
$ht_ctc_os['show_effect'] = (isset($othersettings['show_effect'])) ? esc_attr($othersettings['show_effect']) : '';
|
145 |
|
146 |
+
// show effect ? if 'From Corner' - then return time (for other effects - this->css_styles() handles)
|
147 |
if ( 'From Corner' == $ht_ctc_os['show_effect'] ) {
|
148 |
+
$ht_ctc_os['show_effect'] = 150;
|
149 |
}
|
150 |
|
151 |
// Animations
|
152 |
$ht_ctc_os['an_type'] = "no-animations";
|
153 |
$an_type = ( isset( $othersettings['an_type']) ) ? esc_attr( $othersettings['an_type'] ) : 'no-animation';
|
154 |
+
|
155 |
if ( 'no-animation' !== $an_type ) {
|
156 |
+
// @used by group/share
|
157 |
$ht_ctc_os['data-attributes'] .= "data-an_type='ht_ctc_an_$an_type' ";
|
158 |
+
|
159 |
$ht_ctc_os['an_type'] = "ht_ctc_an_$an_type";
|
160 |
}
|
161 |
|
162 |
+
|
163 |
+
// class names - animations, entry effects, ..
|
164 |
+
$entry = ( isset( $othersettings['show_effect']) ) ? esc_attr( $othersettings['show_effect'] ) : 'no-show-effects';
|
165 |
+
|
166 |
+
/**
|
167 |
+
* entry effect - add class name only
|
168 |
+
* reqular animation type added from js.
|
169 |
+
*/
|
170 |
+
if ( 'no-show-effects' !== $entry && 'From Corner' !== $entry ) {
|
171 |
+
|
172 |
+
if ('From Center' == $entry) {
|
173 |
+
$entry = 'center';
|
174 |
+
}
|
175 |
+
|
176 |
+
if ('From Corner' == $entry) {
|
177 |
+
$entry = 'corner';
|
178 |
+
}
|
179 |
+
|
180 |
+
$ht_ctc_os['class_names'] .= " ht_ctc_entry_animation ht_ctc_an_entry_$entry";
|
181 |
+
}
|
182 |
+
|
183 |
+
// Aria-hidden = true
|
184 |
+
if ( isset($othersettings['aria']) ) {
|
185 |
+
$ht_ctc_os['data-attributes'] .= " aria-hidden='true' ";
|
186 |
+
$ht_ctc_os['attributes'] = " aria-hidden='true'";
|
187 |
+
}
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
return $ht_ctc_os;
|
192 |
}
|
193 |
|
new/inc/commons/class-ht-ctc-ismobile.php
CHANGED
@@ -50,11 +50,8 @@ class HT_CTC_IsMobile {
|
|
50 |
/**
|
51 |
* @uses $this -> is_mobile
|
52 |
*
|
53 |
-
*
|
54 |
-
*
|
55 |
-
*
|
56 |
-
* wp_is_mobile is more efficient
|
57 |
-
* - uses if in user server cause Fatal error: Uncaught Error
|
58 |
* @return boolean
|
59 |
*/
|
60 |
public function php_is_mobile() {
|
50 |
/**
|
51 |
* @uses $this -> is_mobile
|
52 |
*
|
53 |
+
* php way of find is mobile
|
54 |
+
* fallback if wp_is_mobile is not defined
|
|
|
|
|
|
|
55 |
* @return boolean
|
56 |
*/
|
57 |
public function php_is_mobile() {
|
new/inc/commons/class-ht-ctc-scripts.php
CHANGED
@@ -61,6 +61,6 @@ class HT_CTC_Scripts {
|
|
61 |
|
62 |
$ht_ctc_scripts = new HT_CTC_Scripts();
|
63 |
|
64 |
-
add_action('wp_enqueue_scripts', array( $ht_ctc_scripts, 'register_scripts' ) );
|
65 |
|
66 |
endif; // END class_exists check
|
61 |
|
62 |
$ht_ctc_scripts = new HT_CTC_Scripts();
|
63 |
|
64 |
+
add_action('wp_enqueue_scripts', array( $ht_ctc_scripts, 'register_scripts' ), 1 );
|
65 |
|
66 |
endif; // END class_exists check
|
new/inc/commons/ht-ctc-formatting.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Formatting API
|
4 |
+
*
|
5 |
+
* WooSingle product pages
|
6 |
+
* update variable values - call to action, prefilled...
|
7 |
+
*
|
8 |
+
* @since 3.4
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Variables.. woocommerce single product pages..
|
15 |
+
*
|
16 |
+
* @uses
|
17 |
+
*
|
18 |
+
* @since 3.4
|
19 |
+
* @param string $value input value to convert variables on product page
|
20 |
+
*/
|
21 |
+
if ( ! function_exists('ht_ctc_woo_single_product_page_variables') ) {
|
22 |
+
|
23 |
+
function ht_ctc_woo_single_product_page_variables( $value ) {
|
24 |
+
|
25 |
+
// if woocommerce single product page
|
26 |
+
if ( function_exists( 'is_product' ) && function_exists( 'wc_get_product' )) {
|
27 |
+
if ( is_product() ) {
|
28 |
+
|
29 |
+
$product = wc_get_product();
|
30 |
+
|
31 |
+
$name = $product->get_name();
|
32 |
+
// $title = $product->get_title();
|
33 |
+
$price = $product->get_price();
|
34 |
+
$regular_price = $product->get_regular_price();
|
35 |
+
$sku = $product->get_sku();
|
36 |
+
|
37 |
+
// variables works in default pre_filled also for woo pages.
|
38 |
+
$value = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $value );
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
return $value;
|
43 |
+
}
|
44 |
+
}
|
new/inc/greetings/class-ht-ctc-chat-greetings.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WhatsApp Chat - main page ..
|
4 |
+
*
|
5 |
+
* @subpackage chat
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
9 |
+
|
10 |
+
if ( ! class_exists( 'HT_CTC_Chat_Greetings' ) ) :
|
11 |
+
|
12 |
+
class HT_CTC_Chat_Greetings {
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
$this->start();
|
16 |
+
}
|
17 |
+
|
18 |
+
public function start() {
|
19 |
+
add_action( 'ht_ctc_ah_in_fixed_position', [$this, 'greetings_dialog'] );
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
function greetings_dialog() {
|
25 |
+
|
26 |
+
$ht_ctc_greetings = array();
|
27 |
+
|
28 |
+
$greetings = get_option('ht_ctc_greetings');
|
29 |
+
$chat = get_option('ht_ctc_chat_options');
|
30 |
+
|
31 |
+
$ht_ctc_greetings['template'] = ( isset( $chat['template']) ) ? esc_attr( $chat['template'] ) : '';
|
32 |
+
// todo:
|
33 |
+
$ht_ctc_greetings['template'] = 1;
|
34 |
+
|
35 |
+
// return if template not set..
|
36 |
+
if ( '' == $ht_ctc_greetings['template'] ) {
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
+
$ht_ctc_greetings['path'] = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/greetings/greetings-' . $ht_ctc_greetings['template']. '.php';
|
41 |
+
|
42 |
+
// filter hook to update values...
|
43 |
+
$ht_ctc_greetings = apply_filters( 'ht_ctc_fh_greetings', $ht_ctc_greetings );
|
44 |
+
|
45 |
+
if ( is_file( $ht_ctc_greetings['path'] ) ) {
|
46 |
+
?>
|
47 |
+
<style>
|
48 |
+
.ctc_greetings_close_btn {
|
49 |
+
display: none;
|
50 |
+
}
|
51 |
+
.ht_ctc_chat_greetings_box:hover .ctc_greetings_close_btn {
|
52 |
+
display: block;
|
53 |
+
}
|
54 |
+
</style>
|
55 |
+
<div style="position: relative; bottom: 18px; cursor: auto;">
|
56 |
+
|
57 |
+
<div class="ht_ctc_chat_greetings_box" style="position: absolute; bottom: 0px; right: 0px; min-width: 300px; max-width: 400px; background-color: #ffffff; padding: 25px; box-shadow: 1px 4px 2px 1px rgba(0,0,0,.14); border-radius:4px; ">
|
58 |
+
<span style="color:#ffffff; background-color: lightgray; cursor:pointer; float:right; border-radius: 50%;" class="ctc_greetings_close_btn dashicons dashicons-no-alt"></span>
|
59 |
+
<div class="ctc_greetings_template">
|
60 |
+
<?php include $ht_ctc_greetings['path']; ?>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
<?php
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
}
|
71 |
+
|
72 |
+
// new HT_CTC_Chat();
|
73 |
+
|
74 |
+
new HT_CTC_Chat_Greetings();
|
75 |
+
|
76 |
+
endif; // END class_exists check
|
new/inc/greetings/greetings-1.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Greetings - template - 1
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
|
7 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
8 |
+
|
9 |
+
$g1_options = get_option( 'ht_ctc_g1' );
|
10 |
+
$g1_options = apply_filters( 'ht_ctc_fh_g1_options', $g1_options );
|
11 |
+
|
12 |
+
$g1_heading = (isset( $g1_options['g1_heading'])) ? esc_attr( $g1_options['g1_heading'] ) : '';
|
13 |
+
|
14 |
+
?>
|
15 |
+
<div class="ctc_g_heading"><b>Hello World</b></div>
|
16 |
+
<div class="ctc_g_content">
|
17 |
+
<p>Hello, Are you interested in buying this product. For any queries, Chat with us.</p>
|
18 |
+
</div>
|
19 |
+
<div class="ctc_g_sentbutton">
|
20 |
+
<input class="ht_ctc_chat_greetings_box_link" type="submit" value="WhatsApp">
|
21 |
+
</div>
|
new/inc/group/class-ht-ctc-group-shortcode.php
CHANGED
@@ -148,6 +148,7 @@ class HT_CTC_Group_Shortcode {
|
|
148 |
$ht_ctc_os['is_fb_pixel'] = 'yes';
|
149 |
$ht_ctc_os['ga_ads'] = 'no';
|
150 |
$ht_ctc_os['data-attributes'] = '';
|
|
|
151 |
|
152 |
// Hooks
|
153 |
$ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
|
148 |
$ht_ctc_os['is_fb_pixel'] = 'yes';
|
149 |
$ht_ctc_os['ga_ads'] = 'no';
|
150 |
$ht_ctc_os['data-attributes'] = '';
|
151 |
+
$ht_ctc_os['class_names'] = '';
|
152 |
|
153 |
// Hooks
|
154 |
$ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
|
new/inc/group/class-ht-ctc-group.php
CHANGED
@@ -24,14 +24,6 @@ class HT_CTC_Group {
|
|
24 |
|
25 |
// If db values are not correct
|
26 |
if ( !is_array($options) || !isset($options['group_id']) ) {
|
27 |
-
|
28 |
-
// in debug mode
|
29 |
-
if ( isset($othersettings['debug_mode']) ) {
|
30 |
-
?>
|
31 |
-
<script>console.log('please check plugin settings and save changes')</script>
|
32 |
-
<?php
|
33 |
-
}
|
34 |
-
|
35 |
return;
|
36 |
}
|
37 |
|
@@ -92,6 +84,7 @@ class HT_CTC_Group {
|
|
92 |
$ht_ctc_os['data-attributes'] = '';
|
93 |
// show effect
|
94 |
$ht_ctc_os['show_effect'] = '';
|
|
|
95 |
|
96 |
// hooks
|
97 |
$ht_ctc_group = apply_filters( 'ht_ctc_fh_group', $ht_ctc_group );
|
@@ -110,7 +103,9 @@ class HT_CTC_Group {
|
|
110 |
$style_mobile = $ht_ctc_group['style_mobile'];
|
111 |
$call_to_action = $ht_ctc_group['call_to_action'];
|
112 |
|
113 |
-
$
|
|
|
|
|
114 |
|
115 |
if ( '' == $call_to_action ) {
|
116 |
if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
|
@@ -144,7 +139,7 @@ class HT_CTC_Group {
|
|
144 |
<?= $ht_ctc_os['data-attributes'] ?>
|
145 |
>
|
146 |
<?php
|
147 |
-
if ( isset( $
|
148 |
?>
|
149 |
<div class="ht_ctc_desktop_group"><?php include $path_d; ?></div>
|
150 |
<div class="ht_ctc_mobile_group"><?php include $path_m; ?></div>
|
24 |
|
25 |
// If db values are not correct
|
26 |
if ( !is_array($options) || !isset($options['group_id']) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
return;
|
28 |
}
|
29 |
|
84 |
$ht_ctc_os['data-attributes'] = '';
|
85 |
// show effect
|
86 |
$ht_ctc_os['show_effect'] = '';
|
87 |
+
$ht_ctc_os['class_names'] = '';
|
88 |
|
89 |
// hooks
|
90 |
$ht_ctc_group = apply_filters( 'ht_ctc_fh_group', $ht_ctc_group );
|
103 |
$style_mobile = $ht_ctc_group['style_mobile'];
|
104 |
$call_to_action = $ht_ctc_group['call_to_action'];
|
105 |
|
106 |
+
$other_classes = $ht_ctc_os['class_names'];
|
107 |
+
|
108 |
+
$ht_ctc_group['class_names'] .= " style-$style $other_classes";
|
109 |
|
110 |
if ( '' == $call_to_action ) {
|
111 |
if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
|
139 |
<?= $ht_ctc_os['data-attributes'] ?>
|
140 |
>
|
141 |
<?php
|
142 |
+
if ( isset( $options['select_styles_issue'] ) ) {
|
143 |
?>
|
144 |
<div class="ht_ctc_desktop_group"><?php include $path_d; ?></div>
|
145 |
<div class="ht_ctc_mobile_group"><?php include $path_m; ?></div>
|
new/inc/share/class-ht-ctc-share-shortcode.php
CHANGED
@@ -169,6 +169,7 @@ class HT_CTC_Share_Shortcode {
|
|
169 |
$ht_ctc_os['is_fb_pixel'] = 'yes';
|
170 |
$ht_ctc_os['ga_ads'] = 'no';
|
171 |
$ht_ctc_os['data-attributes'] = '';
|
|
|
172 |
|
173 |
// Hooks
|
174 |
$ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
|
169 |
$ht_ctc_os['is_fb_pixel'] = 'yes';
|
170 |
$ht_ctc_os['ga_ads'] = 'no';
|
171 |
$ht_ctc_os['data-attributes'] = '';
|
172 |
+
$ht_ctc_os['class_names'] = '';
|
173 |
|
174 |
// Hooks
|
175 |
$ht_ctc_os = apply_filters( 'ht_ctc_fh_os', $ht_ctc_os );
|
new/inc/share/class-ht-ctc-share.php
CHANGED
@@ -24,14 +24,6 @@ class HT_CTC_Share {
|
|
24 |
|
25 |
// If db values are not correct
|
26 |
if ( !is_array($options) || !isset($options['share_text']) ) {
|
27 |
-
|
28 |
-
// in debug mode
|
29 |
-
if ( isset($othersettings['debug_mode']) ) {
|
30 |
-
?>
|
31 |
-
<script>console.log('please check plugin settings and save changes')</script>
|
32 |
-
<?php
|
33 |
-
}
|
34 |
-
|
35 |
return;
|
36 |
}
|
37 |
|
@@ -107,6 +99,7 @@ class HT_CTC_Share {
|
|
107 |
$ht_ctc_os['data-attributes'] = '';
|
108 |
// show effect
|
109 |
$ht_ctc_os['show_effect'] = '';
|
|
|
110 |
|
111 |
// hooks
|
112 |
$ht_ctc_share = apply_filters( 'ht_ctc_fh_share', $ht_ctc_share );
|
@@ -125,7 +118,9 @@ class HT_CTC_Share {
|
|
125 |
$style_mobile = $ht_ctc_share['style_mobile'];
|
126 |
$call_to_action = $ht_ctc_share['call_to_action'];
|
127 |
|
128 |
-
$
|
|
|
|
|
129 |
|
130 |
if ( '' == $call_to_action ) {
|
131 |
if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
|
@@ -160,7 +155,7 @@ class HT_CTC_Share {
|
|
160 |
<?= $ht_ctc_os['data-attributes'] ?>
|
161 |
>
|
162 |
<?php
|
163 |
-
if ( isset( $
|
164 |
?>
|
165 |
<div class="ht_ctc_desktop_share"><?php include $path_d; ?></div>
|
166 |
<div class="ht_ctc_mobile_share"><?php include $path_m; ?></div>
|
24 |
|
25 |
// If db values are not correct
|
26 |
if ( !is_array($options) || !isset($options['share_text']) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
return;
|
28 |
}
|
29 |
|
99 |
$ht_ctc_os['data-attributes'] = '';
|
100 |
// show effect
|
101 |
$ht_ctc_os['show_effect'] = '';
|
102 |
+
$ht_ctc_os['class_names'] = '';
|
103 |
|
104 |
// hooks
|
105 |
$ht_ctc_share = apply_filters( 'ht_ctc_fh_share', $ht_ctc_share );
|
118 |
$style_mobile = $ht_ctc_share['style_mobile'];
|
119 |
$call_to_action = $ht_ctc_share['call_to_action'];
|
120 |
|
121 |
+
$other_classes = $ht_ctc_os['class_names'];
|
122 |
+
|
123 |
+
$ht_ctc_share['class_names'] .= " style-$style $other_classes";
|
124 |
|
125 |
if ( '' == $call_to_action ) {
|
126 |
if ( '1' == $style || '4' == $style || '6' == $style || '8' == $style ) {
|
155 |
<?= $ht_ctc_os['data-attributes'] ?>
|
156 |
>
|
157 |
<?php
|
158 |
+
if ( isset( $options['select_styles_issue'] ) ) {
|
159 |
?>
|
160 |
<div class="ht_ctc_desktop_share"><?php include $path_d; ?></div>
|
161 |
<div class="ht_ctc_mobile_share"><?php include $path_m; ?></div>
|
new/inc/styles-shortcode/sc-style-99.php
CHANGED
@@ -5,51 +5,51 @@
|
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
8 |
-
$
|
9 |
|
10 |
-
$
|
11 |
-
$
|
12 |
-
$
|
13 |
-
$
|
14 |
|
15 |
// img url
|
16 |
// image - width, height based on device
|
17 |
-
$
|
18 |
|
19 |
|
20 |
if( 'yes' == $is_mobile ) {
|
21 |
|
22 |
-
$
|
23 |
|
24 |
-
if ( '' !== $
|
25 |
-
$
|
26 |
} else {
|
27 |
-
$
|
28 |
}
|
29 |
|
30 |
-
if ( '' !== $
|
31 |
-
$
|
32 |
}
|
33 |
} else {
|
34 |
-
$
|
35 |
|
36 |
-
if ( '' !== $
|
37 |
-
$
|
38 |
} else {
|
39 |
-
$
|
40 |
}
|
41 |
|
42 |
-
if ( '' !== $
|
43 |
-
$
|
44 |
}
|
45 |
}
|
46 |
|
47 |
// fallback image
|
48 |
-
if ( '' == $
|
49 |
-
$
|
50 |
}
|
51 |
|
52 |
|
53 |
$o .= '
|
54 |
-
<img class="own-img ctc-analytics ctc_cta" title="'.$call_to_action.'" id="style-99" src="'.$
|
55 |
';
|
5 |
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
8 |
+
$s_99_options = get_option( 'ht_ctc_s99' );
|
9 |
|
10 |
+
$s_99_desktop_img_height = esc_attr( $s_99_options['s99_desktop_img_height'] );
|
11 |
+
$s_99_desktop_img_width = esc_attr( $s_99_options['s99_desktop_img_width'] );
|
12 |
+
$s_99_mobile_img_height = esc_attr( $s_99_options['s99_mobile_img_height'] );
|
13 |
+
$s_99_mobile_img_width = esc_attr( $s_99_options['s99_mobile_img_width'] );
|
14 |
|
15 |
// img url
|
16 |
// image - width, height based on device
|
17 |
+
$s_99_img_css = "";
|
18 |
|
19 |
|
20 |
if( 'yes' == $is_mobile ) {
|
21 |
|
22 |
+
$s_99_own_image = esc_html( $s_99_options['s99_mobile_img_url'] );
|
23 |
|
24 |
+
if ( '' !== $s_99_mobile_img_height ) {
|
25 |
+
$s_99_img_css .= "height: $s_99_mobile_img_height; ";
|
26 |
} else {
|
27 |
+
$s_99_img_css .= "height: 40px; ";
|
28 |
}
|
29 |
|
30 |
+
if ( '' !== $s_99_mobile_img_width ) {
|
31 |
+
$s_99_img_css .= "width: $s_99_mobile_img_width; ";
|
32 |
}
|
33 |
} else {
|
34 |
+
$s_99_own_image = esc_html( $s_99_options['s99_dekstop_img_url'] );
|
35 |
|
36 |
+
if ( '' !== $s_99_desktop_img_height ) {
|
37 |
+
$s_99_img_css .= "height: $s_99_desktop_img_height; ";
|
38 |
} else {
|
39 |
+
$s_99_img_css .= "height: 50px; ";
|
40 |
}
|
41 |
|
42 |
+
if ( '' !== $s_99_desktop_img_width ) {
|
43 |
+
$s_99_img_css .= "width: $s_99_desktop_img_width; ";
|
44 |
}
|
45 |
}
|
46 |
|
47 |
// fallback image
|
48 |
+
if ( '' == $s_99_own_image ) {
|
49 |
+
$s_99_own_image = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
|
50 |
}
|
51 |
|
52 |
|
53 |
$o .= '
|
54 |
+
<img class="own-img ctc-analytics ctc_cta" title="'.$call_to_action.'" id="style-99" src="'.$s_99_own_image.'" style="'.$s_99_img_css.'" alt="'.$call_to_action.'">
|
55 |
';
|
new/inc/styles/style-1.php
CHANGED
@@ -12,6 +12,7 @@ $s1_options = get_option( 'ht_ctc_s1' );
|
|
12 |
$s1_options = apply_filters( 'ht_ctc_fh_s1_options', $s1_options );
|
13 |
|
14 |
$s1_css = "";
|
|
|
15 |
$s1_text_color = (isset( $s1_options['s1_text_color'])) ? esc_attr( $s1_options['s1_text_color'] ) : '';
|
16 |
$s1_css .= ('' !== $s1_text_color) ? "color:$s1_text_color;": "";
|
17 |
$s1_bg_color = (isset( $s1_options['s1_bg_color'])) ? esc_attr( $s1_options['s1_bg_color'] ) : '';
|
12 |
$s1_options = apply_filters( 'ht_ctc_fh_s1_options', $s1_options );
|
13 |
|
14 |
$s1_css = "";
|
15 |
+
$s1_css .= "cursor:pointer;";
|
16 |
$s1_text_color = (isset( $s1_options['s1_text_color'])) ? esc_attr( $s1_options['s1_text_color'] ) : '';
|
17 |
$s1_css .= ('' !== $s1_text_color) ? "color:$s1_text_color;": "";
|
18 |
$s1_bg_color = (isset( $s1_options['s1_bg_color'])) ? esc_attr( $s1_options['s1_bg_color'] ) : '';
|
new/inc/styles/style-5.php
CHANGED
@@ -22,6 +22,10 @@ $s5_content_height = esc_attr( $s5_options['s5_content_height'] );
|
|
22 |
$s5_content_width = esc_attr( $s5_options['s5_content_width'] );
|
23 |
$s5_img_position = esc_attr( $s5_options['s5_img_position'] );
|
24 |
|
|
|
|
|
|
|
|
|
25 |
|
26 |
// default image - if user not added any image
|
27 |
if ( '' == $s5_img ) {
|
22 |
$s5_content_width = esc_attr( $s5_options['s5_content_width'] );
|
23 |
$s5_img_position = esc_attr( $s5_options['s5_img_position'] );
|
24 |
|
25 |
+
// if its came from woo page..
|
26 |
+
if ( isset($calling_from) && 'woo_page' == $calling_from ) {
|
27 |
+
$s5_img_position = 'left';
|
28 |
+
}
|
29 |
|
30 |
// default image - if user not added any image
|
31 |
if ( '' == $s5_img ) {
|
new/inc/styles/style-7.php
CHANGED
@@ -21,6 +21,10 @@ $s7_cta_type = (isset( $s7_options['cta_type'])) ? esc_attr( $s7_options['cta_ty
|
|
21 |
$s7_cta_textcolor = (isset( $s7_options['cta_textcolor'])) ? esc_attr( $s7_options['cta_textcolor'] ) : '';
|
22 |
$s7_cta_bgcolor = (isset( $s7_options['cta_bgcolor'])) ? esc_attr( $s7_options['cta_bgcolor'] ) : '#ffffff';
|
23 |
|
|
|
|
|
|
|
|
|
24 |
$rtl_css = "";
|
25 |
if ( function_exists('is_rtl') && is_rtl() ) {
|
26 |
$rtl_css = "flex-direction:row-reverse;";
|
@@ -36,7 +40,8 @@ if ( isset($side_2) && 'right' == $side_2) {
|
|
36 |
$s7_cta_order = "0";
|
37 |
}
|
38 |
|
39 |
-
|
|
|
40 |
$s7_cta_class = "ht-ctc-cta ";
|
41 |
$title = "";
|
42 |
if ( 'hover' == $s7_cta_type ) {
|
@@ -67,8 +72,8 @@ include_once HT_CTC_PLUGIN_DIR .'new/inc/assets/img/ht-ctc-svg-images.php';
|
|
67 |
<?= $s7_hover_icon_styles ?>
|
68 |
</style>
|
69 |
|
70 |
-
<div <?= $title ?> class="ctc_s_7 ctc-analytics
|
71 |
-
<p class="ctc_s_7_cta ctc-analytics <?= $s7_cta_class ?>" style="<?= $s7_cta_css ?>"><?= $call_to_action; ?></p>
|
72 |
<div class="ctc_s_7_icon_padding ctc-analytics " style="<?= $s7_icon_css ?>">
|
73 |
<?= ht_ctc_singlecolor( $s7_svg_attrs ); ?>
|
74 |
</div>
|
21 |
$s7_cta_textcolor = (isset( $s7_options['cta_textcolor'])) ? esc_attr( $s7_options['cta_textcolor'] ) : '';
|
22 |
$s7_cta_bgcolor = (isset( $s7_options['cta_bgcolor'])) ? esc_attr( $s7_options['cta_bgcolor'] ) : '#ffffff';
|
23 |
|
24 |
+
$s7_cta_font_size = (isset( $s7_options['cta_font_size'])) ? esc_attr( $s7_options['cta_font_size'] ) : '';
|
25 |
+
|
26 |
+
$s7_cta_font_size = ('' !== $s7_cta_font_size) ? "font-size: $s7_cta_font_size" : "";
|
27 |
+
|
28 |
$rtl_css = "";
|
29 |
if ( function_exists('is_rtl') && is_rtl() ) {
|
30 |
$rtl_css = "flex-direction:row-reverse;";
|
40 |
$s7_cta_order = "0";
|
41 |
}
|
42 |
|
43 |
+
|
44 |
+
$s7_cta_css = "padding: 0px 16px; $s7_cta_font_size; color: $s7_cta_textcolor; background-color: $s7_cta_bgcolor; border-radius:10px; margin:0 10px; ";
|
45 |
$s7_cta_class = "ht-ctc-cta ";
|
46 |
$title = "";
|
47 |
if ( 'hover' == $s7_cta_type ) {
|
72 |
<?= $s7_hover_icon_styles ?>
|
73 |
</style>
|
74 |
|
75 |
+
<div <?= $title ?> class="ctc_s_7 ctc-analytics" style="<?= $s7_n1_styles; ?>">
|
76 |
+
<p class="ctc_s_7_cta ctc_cta ctc-analytics <?= $s7_cta_class ?>" style="<?= $s7_cta_css ?>"><?= $call_to_action; ?></p>
|
77 |
<div class="ctc_s_7_icon_padding ctc-analytics " style="<?= $s7_icon_css ?>">
|
78 |
<?= ht_ctc_singlecolor( $s7_svg_attrs ); ?>
|
79 |
</div>
|
new/inc/styles/style-7_1.php
CHANGED
@@ -8,6 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
8 |
// shadow
|
9 |
// 0px 0px 11px rgba(0,0,0,.5) / 5px 5px 11px #888888
|
10 |
// $s7_bs = "box-shadow: 5px 5px 11px rgba(0,0,0,.5);";
|
|
|
11 |
// $s7_box_shadow = "";
|
12 |
// if ( !isset( $s7_options['s3_box_shadow'])) {
|
13 |
// $s7_box_shadow = "$s7_bs ";
|
@@ -29,7 +30,9 @@ $s7_border_size = esc_attr( $s7_1_options['s7_border_size'] );
|
|
29 |
|
30 |
// Call to action
|
31 |
$s7_cta_type = (isset( $s7_1_options['cta_type'])) ? esc_attr( $s7_1_options['cta_type'] ) : 'hover';
|
|
|
32 |
|
|
|
33 |
|
34 |
// Call to action - Order
|
35 |
$s7_cta_order = "1";
|
@@ -54,7 +57,7 @@ if ( function_exists('is_rtl') && is_rtl() ) {
|
|
54 |
}
|
55 |
|
56 |
$s7_n1_styles = "display:flex;justify-content:center;align-items:center;$rtl_css ";
|
57 |
-
$s7_cta_css = "";
|
58 |
$s7_icon_padding_css = "";
|
59 |
$s7_cta_class = "ht-ctc-cta ";
|
60 |
$s7_hover_styles = "";
|
8 |
// shadow
|
9 |
// 0px 0px 11px rgba(0,0,0,.5) / 5px 5px 11px #888888
|
10 |
// $s7_bs = "box-shadow: 5px 5px 11px rgba(0,0,0,.5);";
|
11 |
+
// $s7_bs = "box-shadow: 2px 2px 6px rgba(0,0,0,.5);";
|
12 |
// $s7_box_shadow = "";
|
13 |
// if ( !isset( $s7_options['s3_box_shadow'])) {
|
14 |
// $s7_box_shadow = "$s7_bs ";
|
30 |
|
31 |
// Call to action
|
32 |
$s7_cta_type = (isset( $s7_1_options['cta_type'])) ? esc_attr( $s7_1_options['cta_type'] ) : 'hover';
|
33 |
+
$s7_1_cta_font_size = (isset( $s7_1_options['cta_font_size'])) ? esc_attr( $s7_1_options['cta_font_size'] ) : '';
|
34 |
|
35 |
+
$s7_1_cta_font_size = ('' !== $s7_1_cta_font_size) ? "font-size: $s7_1_cta_font_size" : "";
|
36 |
|
37 |
// Call to action - Order
|
38 |
$s7_cta_order = "1";
|
57 |
}
|
58 |
|
59 |
$s7_n1_styles = "display:flex;justify-content:center;align-items:center;$rtl_css ";
|
60 |
+
$s7_cta_css = "$s7_1_cta_font_size; ";
|
61 |
$s7_icon_padding_css = "";
|
62 |
$s7_cta_class = "ht-ctc-cta ";
|
63 |
$s7_hover_styles = "";
|
new/inc/styles/style-8.php
CHANGED
@@ -52,6 +52,11 @@ if ( function_exists('is_rtl') && is_rtl() ) {
|
|
52 |
$s8_icon_css = ( 'right' == $s8_icon_position ) ? "order:1;margin-left: 15px;" : "order:0;margin-right: 15px;";
|
53 |
$s8_text_css = "color:$s8_txt_color; $s8_text_size_css ";
|
54 |
$s8_main_span_css = "display: flex; $rtl_css padding: 0 2rem;letter-spacing: .5px;transition: .2s ease-out;text-align: center;justify-content: center;align-items: center;border-radius:2px;height:$s8_height;line-height:$s8_height;vertical-align:middle;box-shadow:0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12), 0 3px 1px -2px rgba(0,0,0,.2);box-sizing:inherit;background-color:$s8_bg_color;";
|
|
|
|
|
|
|
|
|
|
|
55 |
?>
|
56 |
|
57 |
<style id="ht-ctc-s8">
|
52 |
$s8_icon_css = ( 'right' == $s8_icon_position ) ? "order:1;margin-left: 15px;" : "order:0;margin-right: 15px;";
|
53 |
$s8_text_css = "color:$s8_txt_color; $s8_text_size_css ";
|
54 |
$s8_main_span_css = "display: flex; $rtl_css padding: 0 2rem;letter-spacing: .5px;transition: .2s ease-out;text-align: center;justify-content: center;align-items: center;border-radius:2px;height:$s8_height;line-height:$s8_height;vertical-align:middle;box-shadow:0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12), 0 3px 1px -2px rgba(0,0,0,.2);box-sizing:inherit;background-color:$s8_bg_color;";
|
55 |
+
|
56 |
+
// if ( isset($calling_from) && 'woo_page' == $calling_from ) {
|
57 |
+
// // if its from woo pages..
|
58 |
+
// } else {}
|
59 |
+
|
60 |
?>
|
61 |
|
62 |
<style id="ht-ctc-s8">
|
new/inc/styles/style-99.php
CHANGED
@@ -5,38 +5,38 @@
|
|
5 |
*/
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
8 |
-
$
|
9 |
-
$
|
10 |
|
11 |
-
$
|
12 |
-
$
|
13 |
-
$
|
14 |
-
$
|
15 |
|
16 |
// img - url, width, height based on device
|
17 |
-
$
|
18 |
|
19 |
if( 'yes' == $is_mobile ) {
|
20 |
-
$
|
21 |
-
$
|
22 |
|
23 |
-
if ( '' !== $
|
24 |
-
$
|
25 |
}
|
26 |
} else {
|
27 |
-
$
|
28 |
-
$
|
29 |
|
30 |
-
if ( '' !== $
|
31 |
-
$
|
32 |
}
|
33 |
}
|
34 |
|
35 |
// fallback image
|
36 |
-
if ( '' == $
|
37 |
-
$
|
38 |
}
|
39 |
|
40 |
?>
|
41 |
|
42 |
-
<img class="own-img ctc-analytics ctc_cta" title="<?= $call_to_action ?>" id="style-99" src="<?= $
|
5 |
*/
|
6 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
7 |
|
8 |
+
$s_99_options = get_option( 'ht_ctc_s99' );
|
9 |
+
$s_99_options = apply_filters( 'ht_ctc_fh_s99_options', $s_99_options );
|
10 |
|
11 |
+
$s_99_desktop_img_height = esc_attr( $s_99_options['s99_desktop_img_height'] );
|
12 |
+
$s_99_desktop_img_width = esc_attr( $s_99_options['s99_desktop_img_width'] );
|
13 |
+
$s_99_mobile_img_height = esc_attr( $s_99_options['s99_mobile_img_height'] );
|
14 |
+
$s_99_mobile_img_width = esc_attr( $s_99_options['s99_mobile_img_width'] );
|
15 |
|
16 |
// img - url, width, height based on device
|
17 |
+
$s_99_img_css = "";
|
18 |
|
19 |
if( 'yes' == $is_mobile ) {
|
20 |
+
$s_99_own_image = esc_html( $s_99_options['s99_mobile_img_url'] );
|
21 |
+
$s_99_img_css .= ( '' !== $s_99_mobile_img_height ) ? "height: $s_99_mobile_img_height; " : "height: 40px; ";
|
22 |
|
23 |
+
if ( '' !== $s_99_mobile_img_width ) {
|
24 |
+
$s_99_img_css .= "width: $s_99_mobile_img_width; ";
|
25 |
}
|
26 |
} else {
|
27 |
+
$s_99_own_image = esc_html( $s_99_options['s99_dekstop_img_url'] );
|
28 |
+
$s_99_img_css .= ( '' !== $s_99_desktop_img_height ) ? "height: $s_99_desktop_img_height; " : "height: 50px; ";
|
29 |
|
30 |
+
if ( '' !== $s_99_desktop_img_width ) {
|
31 |
+
$s_99_img_css .= "width: $s_99_desktop_img_width; ";
|
32 |
}
|
33 |
}
|
34 |
|
35 |
// fallback image
|
36 |
+
if ( '' == $s_99_own_image ) {
|
37 |
+
$s_99_own_image = plugins_url( './new/inc/assets/img/whatsapp-logo.svg', HT_CTC_PLUGIN_FILE );
|
38 |
}
|
39 |
|
40 |
?>
|
41 |
|
42 |
+
<img class="own-img ctc-analytics ctc_cta" title="<?= $call_to_action ?>" id="style-99" src="<?= $s_99_own_image ?>" style="<?= $s_99_img_css ?>" alt="<?= $call_to_action ?>">
|
new/tools/woo/class-ht-ctc-woo.php
CHANGED
@@ -8,53 +8,219 @@
|
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
10 |
|
11 |
-
if ( ! class_exists( '
|
12 |
|
13 |
-
class
|
14 |
|
15 |
public function __construct() {
|
16 |
$this->woo_hooks();
|
17 |
}
|
18 |
-
|
19 |
// Hooks
|
20 |
-
function woo_hooks() {
|
21 |
|
|
|
|
|
|
|
22 |
add_filter( 'ht_ctc_fh_chat', array($this, 'chat') );
|
23 |
|
24 |
-
//
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
}
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
function add_styles() {
|
30 |
|
31 |
-
$
|
32 |
$chat = get_option('ht_ctc_chat_options');
|
|
|
|
|
|
|
33 |
|
34 |
$type = 'chat';
|
35 |
-
$
|
|
|
|
|
36 |
// $side_2 = 'right';
|
37 |
|
38 |
-
|
39 |
-
$
|
40 |
-
$
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
$margin_left = "margin-left: $space_left;";
|
45 |
-
$margin_right = "margin-right: $space_right;";
|
46 |
-
$margin_top = "margin-top: $space_top;";
|
47 |
-
$margin_bottom = "margin-bottom: $space_left;";
|
48 |
|
49 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
55 |
}
|
56 |
|
57 |
|
|
|
58 |
function chat( $ht_ctc_chat ) {
|
59 |
|
60 |
$woo_options = get_option('ht_ctc_woo_options');
|
@@ -73,11 +239,21 @@ class HT_CTC_Admin_WOO {
|
|
73 |
$regular_price = $product->get_regular_price();
|
74 |
$sku = $product->get_sku();
|
75 |
|
|
|
|
|
|
|
|
|
76 |
// pre-filled
|
77 |
if ( isset( $woo_options['woo_pre_filled'] ) && '' !== $woo_options['woo_pre_filled'] ) {
|
78 |
$ht_ctc_chat['pre_filled'] = esc_attr( $woo_options['woo_pre_filled'] );
|
79 |
$ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'woo_pre_filled' );
|
80 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
// variables works in default pre_filled also for woo pages.
|
82 |
$ht_ctc_chat['pre_filled'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['pre_filled'] );
|
83 |
|
@@ -85,8 +261,14 @@ class HT_CTC_Admin_WOO {
|
|
85 |
if ( isset( $woo_options['woo_call_to_action'] ) && '' !== $woo_options['woo_call_to_action'] ) {
|
86 |
$ht_ctc_chat['call_to_action'] = esc_attr( $woo_options['woo_call_to_action'] );
|
87 |
$ht_ctc_chat['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['call_to_action'], 'Click to Chat for WhatsApp', 'woo_call_to_action' );
|
88 |
-
$ht_ctc_chat['call_to_action'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['call_to_action'] );
|
89 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
}
|
92 |
}
|
@@ -106,6 +288,6 @@ class HT_CTC_Admin_WOO {
|
|
106 |
|
107 |
}
|
108 |
|
109 |
-
new
|
110 |
|
111 |
endif; // END class_exists check
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
10 |
|
11 |
+
if ( ! class_exists( 'HT_CTC_WOO_Pages' ) ) :
|
12 |
|
13 |
+
class HT_CTC_WOO_Pages {
|
14 |
|
15 |
public function __construct() {
|
16 |
$this->woo_hooks();
|
17 |
}
|
18 |
+
|
19 |
// Hooks
|
20 |
+
public function woo_hooks() {
|
21 |
|
22 |
+
$woo = get_option('ht_ctc_woo_options');
|
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';
|
29 |
+
if ('select' !== $woo_position) {
|
30 |
+
add_action( $woo_position, [$this, 'call_add_styles'] );
|
31 |
+
}
|
32 |
+
|
33 |
+
// shop page - add styles
|
34 |
+
if ( isset( $woo['woo_shop_add_whatsapp']) ) {
|
35 |
+
add_action( 'woocommerce_after_shop_loop_item', [$this, 'shop_page_add_styles'], 20 );
|
36 |
+
}
|
37 |
+
|
38 |
+
// cart page
|
39 |
+
// add_action( 'woocommerce_after_cart_totals', [$this, 'after_cart_totals'] );
|
40 |
+
|
41 |
+
// checkout page
|
42 |
+
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* in cart page.
|
49 |
+
*/
|
50 |
+
// function after_cart_totals() {
|
51 |
+
// foreach ( WC()->cart->get_cart() as $cart_item ) {
|
52 |
+
// $product = $cart_item['data'];
|
53 |
+
// }
|
54 |
+
// }
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Shop page, archive items add style..
|
59 |
+
*/
|
60 |
+
function shop_page_add_styles() {
|
61 |
+
|
62 |
+
$woo_options = get_option('ht_ctc_woo_options');
|
63 |
+
$chat = get_option('ht_ctc_chat_options');
|
64 |
+
$type = 'chat';
|
65 |
+
$calling_from = 'woo_page';
|
66 |
+
|
67 |
+
$style = ( isset( $woo_options['woo_shop_style']) ) ? esc_attr( $woo_options['woo_shop_style'] ) : '8';
|
68 |
+
|
69 |
+
/**
|
70 |
+
* call to action
|
71 |
+
* shop call to action - if not - shop page level - if not - call to action ..
|
72 |
+
* here variables works based on the product .. {url} its product url not the page url..
|
73 |
+
*/
|
74 |
+
$call_to_action = ( isset( $woo_options['woo_shop_call_to_action']) ) ? esc_attr( $woo_options['woo_shop_call_to_action'] ) : '';
|
75 |
+
if ( '' == $call_to_action ) {
|
76 |
+
$call_to_action = (isset($ht_ctc_pagelevel['call_to_action'])) ? esc_attr($ht_ctc_pagelevel['call_to_action']) : esc_attr( $chat['call_to_action'] );
|
77 |
+
}
|
78 |
+
|
79 |
+
$pre_filled = ( isset( $woo_options['woo_shop_pre_filled']) ) ? esc_attr( $woo_options['woo_shop_pre_filled'] ) : '';
|
80 |
+
if ( '' == $pre_filled ) {
|
81 |
+
$pre_filled = (isset($ht_ctc_pagelevel['pre_filled'])) ? esc_attr($ht_ctc_pagelevel['pre_filled']) : esc_attr( $chat['pre_filled'] );
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
if ( function_exists( 'wc_get_product' ) ) {
|
86 |
+
$product = wc_get_product();
|
87 |
+
|
88 |
+
$name = $product->get_name();
|
89 |
+
// $title = $product->get_title();
|
90 |
+
|
91 |
+
$price = $product->get_price();
|
92 |
+
$regular_price = $product->get_regular_price();
|
93 |
+
$sku = $product->get_sku();
|
94 |
+
|
95 |
+
// variables works in default pre_filled also for woo pages.
|
96 |
+
$call_to_action = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $call_to_action );
|
97 |
+
$pre_filled = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $pre_filled );
|
98 |
+
}
|
99 |
+
|
100 |
+
$page_url = get_permalink();
|
101 |
+
$post_title = esc_html( get_the_title() );
|
102 |
+
|
103 |
+
$pre_filled = str_replace( array('{url}', '{title}', '{site}' ), array( $page_url, $post_title, HT_CTC_BLOG_NAME ), $pre_filled );
|
104 |
+
|
105 |
+
|
106 |
+
$woo_shop_margin_top = ( isset( $woo_options['woo_shop_margin_top']) ) ? esc_attr( $woo_options['woo_shop_margin_top'] ) : '';
|
107 |
+
$woo_shop_margin_right = ( isset( $woo_options['woo_shop_margin_right']) ) ? esc_attr( $woo_options['woo_shop_margin_right'] ) : '';
|
108 |
+
$woo_shop_margin_bottom = ( isset( $woo_options['woo_shop_margin_bottom']) ) ? esc_attr( $woo_options['woo_shop_margin_bottom'] ) : '';
|
109 |
+
$woo_shop_margin_left = ( isset( $woo_options['woo_shop_margin_left']) ) ? esc_attr( $woo_options['woo_shop_margin_left'] ) : '';
|
110 |
+
|
111 |
+
|
112 |
+
$css = '';
|
113 |
+
$css .= "cursor:pointer;";
|
114 |
+
|
115 |
+
if ('' !== $woo_shop_margin_left) {
|
116 |
+
$css .= "margin-left:$woo_shop_margin_left;";
|
117 |
+
}
|
118 |
+
if ('' !== $woo_shop_margin_right) {
|
119 |
+
$css .= "margin-right:$woo_shop_margin_right;";
|
120 |
+
}
|
121 |
+
if ('' !== $woo_shop_margin_top) {
|
122 |
+
$css .= "margin-top:$woo_shop_margin_top;";
|
123 |
+
}
|
124 |
+
if ('' !== $woo_shop_margin_bottom) {
|
125 |
+
$css .= "margin-bottom:$woo_shop_margin_bottom;";
|
126 |
+
}
|
127 |
+
|
128 |
+
|
129 |
+
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
130 |
+
|
131 |
+
if ( is_file( $path ) ) {
|
132 |
+
?>
|
133 |
+
<div class="ctc_chat ctc_woo_place" style="<?= $css ?>" data-pre_filled="<?= $pre_filled ?>">
|
134 |
+
<?php include $path; ?>
|
135 |
+
</div>
|
136 |
+
<?php
|
137 |
+
}
|
138 |
|
139 |
}
|
140 |
|
141 |
+
|
142 |
+
// call add styles if its woo single product page..
|
143 |
+
function call_add_styles() {
|
144 |
+
|
145 |
+
if ( function_exists( 'is_product' ) && function_exists( 'wc_get_product' )) {
|
146 |
+
if ( is_product() ) {
|
147 |
+
$this->add_styles();
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* woo places - add styles..
|
155 |
+
*/
|
156 |
function add_styles() {
|
157 |
|
158 |
+
$woo_options = get_option('ht_ctc_woo_options');
|
159 |
$chat = get_option('ht_ctc_chat_options');
|
160 |
+
$page_id = get_the_ID();
|
161 |
+
$ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
|
162 |
+
|
163 |
|
164 |
$type = 'chat';
|
165 |
+
$calling_from = 'woo_page';
|
166 |
+
$style = ( isset( $woo_options['woo_style']) ) ? esc_attr( $woo_options['woo_style'] ) : '8';
|
167 |
+
|
168 |
// $side_2 = 'right';
|
169 |
|
170 |
+
// call to action
|
171 |
+
$call_to_action = (isset($ht_ctc_pagelevel['call_to_action'])) ? esc_attr($ht_ctc_pagelevel['call_to_action']) : esc_attr( $chat['call_to_action'] );
|
172 |
+
if ( !isset($ht_ctc_pagelevel['call_to_action']) && isset( $woo_options['woo_call_to_action'] ) && '' !== $woo_options['woo_call_to_action'] ) {
|
173 |
+
$call_to_action = esc_attr( $woo_options['woo_call_to_action'] );
|
174 |
+
}
|
175 |
+
|
176 |
+
include_once HT_CTC_PLUGIN_DIR .'new/inc/commons/ht-ctc-formatting.php';
|
177 |
+
if ( function_exists('ht_ctc_woo_single_product_page_variables') ) {
|
178 |
+
$call_to_action = ht_ctc_woo_single_product_page_variables( $call_to_action );
|
179 |
+
}
|
180 |
+
|
181 |
+
$woo_single_position_center = ( isset( $woo_options['woo_single_position_center']) ) ? esc_attr( $woo_options['woo_single_position_center'] ) : '';
|
182 |
+
$woo_single_margin_top = ( isset( $woo_options['woo_single_margin_top']) ) ? esc_attr( $woo_options['woo_single_margin_top'] ) : '';
|
183 |
+
$woo_single_margin_right = ( isset( $woo_options['woo_single_margin_right']) ) ? esc_attr( $woo_options['woo_single_margin_right'] ) : '';
|
184 |
+
$woo_single_margin_bottom = ( isset( $woo_options['woo_single_margin_bottom']) ) ? esc_attr( $woo_options['woo_single_margin_bottom'] ) : '';
|
185 |
+
$woo_single_margin_left = ( isset( $woo_options['woo_single_margin_left']) ) ? esc_attr( $woo_options['woo_single_margin_left'] ) : '';
|
186 |
+
|
187 |
+
$woo_single_block_type = ( isset( $woo_options['woo_single_block_type']) ) ? esc_attr( $woo_options['woo_single_block_type'] ) : 'inline-block';
|
188 |
+
|
189 |
+
$css = '';
|
190 |
+
$css .= "display: $woo_single_block_type;cursor:pointer;";
|
191 |
+
|
192 |
+
if ( isset($woo_options['woo_single_position_center']) ) {
|
193 |
+
$css .= "text-align: center;";
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
if ('' !== $woo_single_margin_left) {
|
198 |
+
$css .= "margin-left:$woo_single_margin_left;";
|
199 |
+
}
|
200 |
+
if ('' !== $woo_single_margin_right) {
|
201 |
+
$css .= "margin-right:$woo_single_margin_right;";
|
202 |
+
}
|
203 |
+
if ('' !== $woo_single_margin_top) {
|
204 |
+
$css .= "margin-top:$woo_single_margin_top;";
|
205 |
+
}
|
206 |
+
if ('' !== $woo_single_margin_bottom) {
|
207 |
+
$css .= "margin-bottom:$woo_single_margin_bottom;";
|
208 |
+
}
|
209 |
|
|
|
|
|
|
|
|
|
210 |
|
211 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'new/inc/styles/style-' . $style. '.php';
|
212 |
|
213 |
+
if ( is_file( $path ) ) {
|
214 |
+
?>
|
215 |
+
<div class="ctc_chat ctc_woo_place" style="<?= $css ?>">
|
216 |
+
<?php include $path; ?>
|
217 |
+
</div>
|
218 |
+
<?php
|
219 |
+
}
|
220 |
}
|
221 |
|
222 |
|
223 |
+
|
224 |
function chat( $ht_ctc_chat ) {
|
225 |
|
226 |
$woo_options = get_option('ht_ctc_woo_options');
|
239 |
$regular_price = $product->get_regular_price();
|
240 |
$sku = $product->get_sku();
|
241 |
|
242 |
+
$page_id = get_the_ID();
|
243 |
+
$ht_ctc_pagelevel = get_post_meta( $page_id, 'ht_ctc_pagelevel', true );
|
244 |
+
|
245 |
+
|
246 |
// pre-filled
|
247 |
if ( isset( $woo_options['woo_pre_filled'] ) && '' !== $woo_options['woo_pre_filled'] ) {
|
248 |
$ht_ctc_chat['pre_filled'] = esc_attr( $woo_options['woo_pre_filled'] );
|
249 |
$ht_ctc_chat['pre_filled'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['pre_filled'], 'Click to Chat for WhatsApp', 'woo_pre_filled' );
|
250 |
}
|
251 |
+
|
252 |
+
// page level settings - woo
|
253 |
+
if ( isset($ht_ctc_pagelevel['pre_filled']) ) {
|
254 |
+
$ht_ctc_chat['pre_filled'] = esc_attr($ht_ctc_pagelevel['pre_filled']);
|
255 |
+
}
|
256 |
+
|
257 |
// variables works in default pre_filled also for woo pages.
|
258 |
$ht_ctc_chat['pre_filled'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['pre_filled'] );
|
259 |
|
261 |
if ( isset( $woo_options['woo_call_to_action'] ) && '' !== $woo_options['woo_call_to_action'] ) {
|
262 |
$ht_ctc_chat['call_to_action'] = esc_attr( $woo_options['woo_call_to_action'] );
|
263 |
$ht_ctc_chat['call_to_action'] = apply_filters( 'wpml_translate_single_string', $ht_ctc_chat['call_to_action'], 'Click to Chat for WhatsApp', 'woo_call_to_action' );
|
|
|
264 |
}
|
265 |
+
|
266 |
+
// page level settings - woo
|
267 |
+
if ( isset($ht_ctc_pagelevel['call_to_action']) ) {
|
268 |
+
$ht_ctc_chat['call_to_action'] = esc_attr($ht_ctc_pagelevel['call_to_action']);
|
269 |
+
}
|
270 |
+
|
271 |
+
$ht_ctc_chat['call_to_action'] = str_replace( array('{product}', '{price}', '{regular_price}', '{sku}' ), array( $name, $price, $regular_price, $sku ), $ht_ctc_chat['call_to_action'] );
|
272 |
|
273 |
}
|
274 |
}
|
288 |
|
289 |
}
|
290 |
|
291 |
+
new HT_CTC_WOO_Pages();
|
292 |
|
293 |
endif; // END class_exists check
|
new/tools/woo/woo-admin/class-ht-ctc-admin-woo-page.php
CHANGED
@@ -85,10 +85,11 @@ class HT_CTC_Admin_Woo_Page {
|
|
85 |
|
86 |
// WooCommerce chat feautes
|
87 |
register_setting( 'ht_ctc_woo_page_settings_fields', 'ht_ctc_woo_options' , array( $this, 'options_sanitize' ) );
|
88 |
-
|
89 |
-
add_settings_section( 'ht_ctc_woo_page_settings_sections_add', '', array( $this, 'chat_settings_section_cb' ), 'ht_ctc_woo_page_settings_sections_do' );
|
90 |
|
91 |
-
|
|
|
|
|
|
|
92 |
|
93 |
}
|
94 |
|
@@ -108,33 +109,66 @@ class HT_CTC_Admin_Woo_Page {
|
|
108 |
*
|
109 |
* @var [woo_is_single] - floating style for single product pages
|
110 |
*/
|
111 |
-
function
|
112 |
-
|
113 |
-
$
|
114 |
-
|
115 |
$chat = get_option('ht_ctc_chat_options');
|
|
|
116 |
|
|
|
|
|
|
|
117 |
// pre filled
|
118 |
-
$woo_pre_filled = ( isset( $
|
119 |
-
|
120 |
$pf_placeholder = "Hello {site} \nLike to buy {product}, {url}";
|
121 |
-
|
122 |
// call to action
|
123 |
-
$woo_call_to_action = ( isset( $
|
124 |
-
|
125 |
$ctc_placeholder = 'Buy {product}';
|
|
|
126 |
|
127 |
// Add styles at woo page position
|
128 |
-
$woo_position = ( isset( $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
?>
|
130 |
|
131 |
-
<ul class="collapsible">
|
132 |
-
<li class="
|
133 |
<div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'Single Product Pages', 'click-to-chat-for-whatsapp' ); ?></div>
|
134 |
<div class="collapsible-body">
|
135 |
|
136 |
<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>
|
137 |
-
<!-- <p class="description">Leave blank to get values from main settings</p> -->
|
138 |
<br>
|
139 |
|
140 |
<!-- prefilled message -->
|
@@ -142,8 +176,6 @@ class HT_CTC_Admin_Woo_Page {
|
|
142 |
<div class="input-field col s12">
|
143 |
<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>
|
144 |
<label for="woo_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
145 |
-
<!-- <span class="helper-text" data-error="wrong" data-success="right"><?php _e( 'Leave blank to get value from main settings', 'click-to-chat-for-whatsapp' ); ?></span> -->
|
146 |
-
<!-- <p class="description">Pre-filled message for WooCommerce Single Product pages</p> -->
|
147 |
</div>
|
148 |
</div>
|
149 |
|
@@ -153,8 +185,6 @@ class HT_CTC_Admin_Woo_Page {
|
|
153 |
<div class="input-field col s12">
|
154 |
<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 ?>">
|
155 |
<label for="woo_call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
156 |
-
<!-- <span class="helper-text" data-error="wrong" data-success="right"><?php _e( 'Leave blank to get value from main settings', 'click-to-chat-for-whatsapp' ); ?></span> -->
|
157 |
-
<!-- <p class="description">Call-to-Action for WooCommerce Single Product pages</p> -->
|
158 |
</div>
|
159 |
</div>
|
160 |
|
@@ -163,28 +193,278 @@ class HT_CTC_Admin_Woo_Page {
|
|
163 |
<!-- <p class="description">Change Values for WooCommerce Single Product pages - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></p> -->
|
164 |
<p class="description">Leave blank to get value from main settings</p>
|
165 |
|
|
|
|
|
|
|
166 |
|
167 |
<!-- Add button/icon -->
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
<div class="col s6" style="padding-top: 14px;">
|
170 |
-
<p><?php _e( '
|
171 |
</div>
|
172 |
<div class="input-field col s6">
|
173 |
-
<
|
174 |
-
<
|
175 |
-
<
|
176 |
-
|
177 |
-
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
</select>
|
|
|
180 |
</div>
|
181 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
|
183 |
</div>
|
184 |
</div>
|
185 |
</li>
|
186 |
-
|
|
|
187 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
<?php
|
190 |
}
|
@@ -208,8 +488,17 @@ class HT_CTC_Admin_Woo_Page {
|
|
208 |
foreach ($input as $key => $value) {
|
209 |
if( isset( $input[$key] ) ) {
|
210 |
|
211 |
-
if ( 'woo_pre_filled' == $key ) {
|
212 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
} else {
|
214 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
215 |
}
|
@@ -218,7 +507,7 @@ class HT_CTC_Admin_Woo_Page {
|
|
218 |
|
219 |
// l10n
|
220 |
foreach ($input as $key => $value) {
|
221 |
-
if ( 'woo_pre_filled' == $key || 'woo_call_to_action' == $key ) {
|
222 |
do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', $key, $input[$key] );
|
223 |
}
|
224 |
}
|
85 |
|
86 |
// WooCommerce chat feautes
|
87 |
register_setting( 'ht_ctc_woo_page_settings_fields', 'ht_ctc_woo_options' , array( $this, 'options_sanitize' ) );
|
|
|
|
|
88 |
|
89 |
+
// if ( isset($_GET['page']) && 'click-to-chat-woocommerce' == $_GET['page'] ) {
|
90 |
+
add_settings_section( 'ht_ctc_woo_page_settings_sections_add', '', array( $this, 'chat_settings_section_cb' ), 'ht_ctc_woo_page_settings_sections_do' );
|
91 |
+
add_settings_field( 'ctc_woocommerce', __( 'WooCommerce', 'click-to-chat-for-whatsapp'), array( $this, 'ctc_woocommerce_cb' ), 'ht_ctc_woo_page_settings_sections_do', 'ht_ctc_woo_page_settings_sections_add' );
|
92 |
+
// }
|
93 |
|
94 |
}
|
95 |
|
109 |
*
|
110 |
* @var [woo_is_single] - floating style for single product pages
|
111 |
*/
|
112 |
+
function ctc_woocommerce_cb() {
|
113 |
+
|
114 |
+
$woo_options = get_option('ht_ctc_woo_options');
|
|
|
115 |
$chat = get_option('ht_ctc_chat_options');
|
116 |
+
$dbrow = 'ht_ctc_woo_options';
|
117 |
|
118 |
+
/**
|
119 |
+
* Single product page..
|
120 |
+
*/
|
121 |
// pre filled
|
122 |
+
$woo_pre_filled = ( isset( $woo_options['woo_pre_filled']) ) ? esc_attr( $woo_options['woo_pre_filled'] ) : '';
|
|
|
123 |
$pf_placeholder = "Hello {site} \nLike to buy {product}, {url}";
|
|
|
124 |
// call to action
|
125 |
+
$woo_call_to_action = ( isset( $woo_options['woo_call_to_action']) ) ? esc_attr( $woo_options['woo_call_to_action'] ) : '';
|
|
|
126 |
$ctc_placeholder = 'Buy {product}';
|
127 |
+
$single_ctc_placeholder = "WhatsApp Order";
|
128 |
|
129 |
// Add styles at woo page position
|
130 |
+
$woo_position = ( isset( $woo_options['woo_position']) ) ? esc_attr( $woo_options['woo_position'] ) : '';
|
131 |
+
$woo_style = ( isset( $woo_options['woo_style']) ) ? esc_attr( $woo_options['woo_style'] ) : '8';
|
132 |
+
$woo_single_block_type = ( isset( $woo_options['woo_single_block_type']) ) ? esc_attr( $woo_options['woo_single_block_type'] ) : 'inline-block';
|
133 |
+
|
134 |
+
$woo_places = [
|
135 |
+
'select' => '-- Select --',
|
136 |
+
'woocommerce_after_single_product_summary' => 'After Product Summary'
|
137 |
+
];
|
138 |
+
|
139 |
+
$woo_places = apply_filters( 'ht_ctc_fh_admin_woo_places', $woo_places );
|
140 |
+
|
141 |
+
$woo_single_position_center = ( isset( $woo_options['woo_single_position_center']) ) ? esc_attr( $woo_options['woo_single_position_center'] ) : '';
|
142 |
+
$woo_single_margin_top = ( isset( $woo_options['woo_single_margin_top']) ) ? esc_attr( $woo_options['woo_single_margin_top'] ) : '';
|
143 |
+
$woo_single_margin_right = ( isset( $woo_options['woo_single_margin_right']) ) ? esc_attr( $woo_options['woo_single_margin_right'] ) : '';
|
144 |
+
$woo_single_margin_bottom = ( isset( $woo_options['woo_single_margin_bottom']) ) ? esc_attr( $woo_options['woo_single_margin_bottom'] ) : '';
|
145 |
+
$woo_single_margin_left = ( isset( $woo_options['woo_single_margin_left']) ) ? esc_attr( $woo_options['woo_single_margin_left'] ) : '';
|
146 |
+
$woo_single_margin_unit = ( isset( $woo_options['woo_single_margin_unit']) ) ? esc_attr( $woo_options['woo_single_margin_unit'] ) : 'px';
|
147 |
+
|
148 |
+
/**
|
149 |
+
* woo - shop page
|
150 |
+
*/
|
151 |
+
$woo_shop_style = ( isset( $woo_options['woo_shop_style']) ) ? esc_attr( $woo_options['woo_shop_style'] ) : '1';
|
152 |
+
$woo_shop_pre_filled = ( isset( $woo_options['woo_shop_pre_filled']) ) ? esc_attr( $woo_options['woo_shop_pre_filled'] ) : '';
|
153 |
+
$woo_shop_call_to_action = ( isset( $woo_options['woo_shop_call_to_action']) ) ? esc_attr( $woo_options['woo_shop_call_to_action'] ) : '';
|
154 |
+
$woo_shop_add_whatsapp = ( isset( $woo_options['woo_shop_add_whatsapp']) ) ? esc_attr( $woo_options['woo_shop_add_whatsapp'] ) : '';
|
155 |
+
|
156 |
+
$woo_shop_position_center = ( isset( $woo_options['woo_shop_position_center']) ) ? esc_attr( $woo_options['woo_shop_position_center'] ) : '';
|
157 |
+
$woo_shop_margin_top = ( isset( $woo_options['woo_shop_margin_top']) ) ? esc_attr( $woo_options['woo_shop_margin_top'] ) : '';
|
158 |
+
$woo_shop_margin_right = ( isset( $woo_options['woo_shop_margin_right']) ) ? esc_attr( $woo_options['woo_shop_margin_right'] ) : '';
|
159 |
+
$woo_shop_margin_bottom = ( isset( $woo_options['woo_shop_margin_bottom']) ) ? esc_attr( $woo_options['woo_shop_margin_bottom'] ) : '';
|
160 |
+
$woo_shop_margin_left = ( isset( $woo_options['woo_shop_margin_left']) ) ? esc_attr( $woo_options['woo_shop_margin_left'] ) : '';
|
161 |
+
$woo_shop_margin_unit = ( isset( $woo_options['woo_shop_margin_unit']) ) ? esc_attr( $woo_options['woo_shop_margin_unit'] ) : 'px';
|
162 |
+
|
163 |
+
|
164 |
?>
|
165 |
|
166 |
+
<ul class="collapsible ht_ctc_woo_1">
|
167 |
+
<li class="">
|
168 |
<div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'Single Product Pages', 'click-to-chat-for-whatsapp' ); ?></div>
|
169 |
<div class="collapsible-body">
|
170 |
|
171 |
<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>
|
|
|
172 |
<br>
|
173 |
|
174 |
<!-- prefilled message -->
|
176 |
<div class="input-field col s12">
|
177 |
<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>
|
178 |
<label for="woo_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
|
|
|
|
179 |
</div>
|
180 |
</div>
|
181 |
|
185 |
<div class="input-field col s12">
|
186 |
<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 ?>">
|
187 |
<label for="woo_call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
|
|
|
|
188 |
</div>
|
189 |
</div>
|
190 |
|
193 |
<!-- <p class="description">Change Values for WooCommerce Single Product pages - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/woocommerce-single-product-pages/"><?php _e( 'more info', 'click-to-chat-for-whatsapp' ); ?></a></p> -->
|
194 |
<p class="description">Leave blank to get value from main settings</p>
|
195 |
|
196 |
+
<br><hr style="max-width: 240px;"><br>
|
197 |
+
<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>
|
198 |
+
|
199 |
|
200 |
<!-- Add button/icon -->
|
201 |
+
<div class="row">
|
202 |
+
<div class="col s6" style="padding-top: 14px;">
|
203 |
+
<p><?php _e( 'Position', 'click-to-chat-for-whatsapp' ); ?></p>
|
204 |
+
</div>
|
205 |
+
<div class="input-field col s6">
|
206 |
+
<select name="<?php echo $dbrow ?>[woo_position]" class="woo_single_position_select">
|
207 |
+
<?php
|
208 |
+
foreach ($woo_places as $key => $value) {
|
209 |
+
?>
|
210 |
+
<option value="<?= $key ?>" <?php echo $woo_position == $key ? 'SELECTED' : ''; ?> ><?php _e( $value, 'click-to-chat-for-whatsapp' ); ?></option>
|
211 |
+
<?php
|
212 |
+
}
|
213 |
+
?>
|
214 |
+
</select>
|
215 |
+
<?php
|
216 |
+
if ( ! defined( 'HT_CTC_PRO_VERSION' ) ) {
|
217 |
+
?>
|
218 |
+
<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>
|
219 |
+
<?php
|
220 |
+
}
|
221 |
+
?>
|
222 |
+
|
223 |
+
</div>
|
224 |
+
</div>
|
225 |
+
|
226 |
+
<!-- style -->
|
227 |
+
<div class="row ctc_init_display_none woo_single_position_settings">
|
228 |
+
<div class="col s6" style="padding-top: 14px;">
|
229 |
+
<p><?php _e( 'Select Style', 'click-to-chat-for-whatsapp' ); ?></p>
|
230 |
+
</div>
|
231 |
+
<div class="input-field col s6">
|
232 |
+
<select name="<?= $dbrow; ?>[woo_style]" class="">
|
233 |
+
<option value="1" <?= $woo_style == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
|
234 |
+
<option value="2" <?= $woo_style == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
|
235 |
+
<option value="3" <?= $woo_style == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
|
236 |
+
<option value="3_1" <?= $woo_style == '3_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
237 |
+
<option value="4" <?= $woo_style == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
|
238 |
+
<option value="5" <?= $woo_style == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
|
239 |
+
<option value="7" <?= $woo_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
|
240 |
+
<option value="7_1" <?= $woo_style == '7_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
241 |
+
<option value="8" <?= $woo_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
242 |
+
<option value="99" <?= $woo_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
243 |
+
</select>
|
244 |
+
<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>
|
245 |
+
<p class="description">Recommended Styles: 1, 8</p>
|
246 |
+
</div>
|
247 |
+
</div>
|
248 |
+
|
249 |
+
<p class="description ctc_init_display_none woo_single_position_settings">The styles and its position appears based on how Theme is developed.</p>
|
250 |
+
<p class="description ctc_init_display_none woo_single_position_settings">This below settings are useful to adjust its appearance</p>
|
251 |
+
|
252 |
+
<p class="description ctc_init_display_none woo_single_position_settings" style="margin-top: 20px;"><strong>New Feature:</strong> We are planning to improve this feature. For any suggestions please <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/support/">contact us</a></p>
|
253 |
+
|
254 |
+
<!-- display - center -->
|
255 |
+
<div class="row woo_single_position_settings" style="display: none;">
|
256 |
<div class="col s6" style="padding-top: 14px;">
|
257 |
+
<p><?php _e( 'Display Center', 'click-to-chat-for-whatsapp' ); ?></p>
|
258 |
</div>
|
259 |
<div class="input-field col s6">
|
260 |
+
<label>
|
261 |
+
<input name="<?= $dbrow; ?>[woo_single_position_center]" type="checkbox" value="1" <?php checked( $woo_single_position_center, 1 ); ?> id="woo_single_position_center" />
|
262 |
+
<span><?php _e( 'Display center with in available space', 'click-to-chat-for-whatsapp' ); ?></span>
|
263 |
+
</label>
|
264 |
+
</div>
|
265 |
+
</div>
|
266 |
+
|
267 |
+
<!-- display: block, inline-block .. -->
|
268 |
+
<div class="row ctc_init_display_none woo_single_position_settings">
|
269 |
+
<div class="col s6" style="padding-top: 14px;">
|
270 |
+
<p><?php _e( 'Display Block Type', 'click-to-chat-for-whatsapp' ); ?></p>
|
271 |
+
</div>
|
272 |
+
<div class="input-field col s6">
|
273 |
+
<select name="<?= $dbrow; ?>[woo_single_block_type]" class="">
|
274 |
+
<option value="block" <?= $woo_single_block_type == 'block' ? 'SELECTED' : ''; ?> >block</option>
|
275 |
+
<option value="inline" <?= $woo_single_block_type == 'inline' ? 'SELECTED' : ''; ?> >inline</option>
|
276 |
+
<option value="inline-block" <?= $woo_single_block_type == 'inline-block' ? 'SELECTED' : ''; ?> >inline-block</option>
|
277 |
</select>
|
278 |
+
<p class="woo_single_position_center_checked_content" style="float: right; display: none;"><?php _e( "If 'Display Center' is checked, 'Display Block Type': 'block' works better", 'click-to-chat-for-whatsapp' ); ?></p>
|
279 |
</div>
|
280 |
+
</div>
|
281 |
+
|
282 |
+
<!-- margin -->
|
283 |
+
<div class="row ctc_init_display_none woo_single_position_settings">
|
284 |
+
<div class="col s6" style="padding-top: 14px;">
|
285 |
+
<p><?php _e( 'Spacing (Margin)', 'click-to-chat-for-whatsapp' ); ?></p>
|
286 |
+
</div>
|
287 |
+
<div class="input-field col s6" style="display: flex; margin-bottom: 1px;">
|
288 |
+
<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' ); ?>">
|
289 |
+
<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' ); ?>">
|
290 |
+
<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' ); ?>">
|
291 |
+
<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' ); ?>">
|
292 |
+
</div>
|
293 |
+
<span class="helper-text" style="float:right;">Top, Bottom, Left, Right <span> E.g. 10px, 50%</span> </span>
|
294 |
+
</div>
|
295 |
+
|
296 |
|
297 |
</div>
|
298 |
</div>
|
299 |
</li>
|
300 |
+
</ul>
|
301 |
+
|
302 |
|
303 |
+
<!-- woo shop page -->
|
304 |
+
<ul class="collapsible ht_ctc_woo_shop" style="margin-top: 40px;">
|
305 |
+
<li class="">
|
306 |
+
<div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'Shop Page', 'click-to-chat-for-whatsapp' ); ?></div>
|
307 |
+
<div class="collapsible-body">
|
308 |
+
|
309 |
+
<?php
|
310 |
+
if (function_exists( 'wc_get_page_id')) {
|
311 |
+
$shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );
|
312 |
+
?>
|
313 |
+
<!-- <a target="_blank" href="<?= $shop_page_url ?>">Shop Page</a> - Edit - at the right sidebar. -->
|
314 |
+
<?php
|
315 |
+
|
316 |
+
$admin_url = admin_url();
|
317 |
+
$shop_page_id = wc_get_page_id( 'shop' );
|
318 |
+
$shop_admin_url = "${admin_url}post.php?post=${shop_page_id}&action=edit";
|
319 |
+
?>
|
320 |
+
<p class="description">Shop Page <a target="_blank" href="<?= $shop_admin_url ?>">Edit </a> -> Settings Icon - At the right Sidebar 'Click to Chat' metabox - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a></p>
|
321 |
+
<br><br>
|
322 |
+
<?php
|
323 |
+
}
|
324 |
+
?>
|
325 |
+
|
326 |
+
<!-- At WooCommerce shop pages, loop.. -->
|
327 |
+
<div class="row">
|
328 |
+
<div class="col s6" style="padding-top: 14px;">
|
329 |
+
<p><?php _e( 'Add WhatsApp at Products Archive', 'click-to-chat-for-whatsapp' ); ?><br>(<?php _e( 'Shop page', 'click-to-chat-for-whatsapp' ); ?>)</p>
|
330 |
+
</div>
|
331 |
+
<div class="input-field col s6">
|
332 |
+
<label>
|
333 |
+
<input name="<?= $dbrow; ?>[woo_shop_add_whatsapp]" type="checkbox" value="1" <?php checked( $woo_shop_add_whatsapp, 1 ); ?> id="woo_shop_add_whatsapp" />
|
334 |
+
<span><?php _e( "Add at Products Archive, Shop Page", 'click-to-chat-for-whatsapp' ); ?></span>
|
335 |
+
<p class="description"><a target="_blank" href="https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/">more info</a></p>
|
336 |
+
</label>
|
337 |
+
</div>
|
338 |
+
</div>
|
339 |
+
|
340 |
+
<p class="description ctc_init_display_none woo_shop_add_whatsapp_settings" style="margin: 35px 0px;"><strong>New Feature:</strong> We are planning to improve this feature. For any suggestions please <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/support/">contact us</a></p>
|
341 |
+
|
342 |
+
<!-- prefilled message -->
|
343 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
344 |
+
<div class="input-field col s12">
|
345 |
+
<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>
|
346 |
+
<label for="woo_shop_pre_filled"><?php _e( 'Pre-filled message', 'click-to-chat-for-whatsapp' ); ?></label>
|
347 |
+
<p class="description">pre-filled, call-to-action: if blank, get values from page-level settings if not from the main settings</p>
|
348 |
+
</div>
|
349 |
+
</div>
|
350 |
+
|
351 |
+
|
352 |
+
<!-- Call to Action -->
|
353 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
354 |
+
<div class="input-field col s12">
|
355 |
+
<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 ?>">
|
356 |
+
<label for="woo_shop_call_to_action"><?php _e( 'Call to Action', 'click-to-chat-for-whatsapp' ); ?></label>
|
357 |
+
</div>
|
358 |
+
</div>
|
359 |
+
|
360 |
+
<!-- style -->
|
361 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
362 |
+
<div class="col s6" style="padding-top: 14px;">
|
363 |
+
<p><?php _e( 'Select Style', 'click-to-chat-for-whatsapp' ); ?></p>
|
364 |
+
</div>
|
365 |
+
<div class="input-field col s6">
|
366 |
+
<select name="<?= $dbrow; ?>[woo_shop_style]" class="">
|
367 |
+
<option value="1" <?= $woo_shop_style == 1 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-1', 'click-to-chat-for-whatsapp' ); ?></option>
|
368 |
+
<option value="2" <?= $woo_shop_style == 2 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-2', 'click-to-chat-for-whatsapp' ); ?></option>
|
369 |
+
<option value="3" <?= $woo_shop_style == 3 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-3', 'click-to-chat-for-whatsapp' ); ?></option>
|
370 |
+
<option value="3_1" <?= $woo_shop_style == '3_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-3 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
371 |
+
<option value="4" <?= $woo_shop_style == 4 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-4', 'click-to-chat-for-whatsapp' ); ?></option>
|
372 |
+
<option value="5" <?= $woo_shop_style == 5 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-5', 'click-to-chat-for-whatsapp' ); ?></option>
|
373 |
+
<option value="7" <?= $woo_shop_style == 7 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-7', 'click-to-chat-for-whatsapp' ); ?></option>
|
374 |
+
<option value="7_1" <?= $woo_shop_style == '7_1' ? 'SELECTED' : ''; ?> > <?php _e( 'Style-7 Extend', 'click-to-chat-for-whatsapp' ); ?></option>
|
375 |
+
<option value="8" <?= $woo_shop_style == 8 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-8', 'click-to-chat-for-whatsapp' ); ?></option>
|
376 |
+
<option value="99" <?= $woo_shop_style == 99 ? 'SELECTED' : ''; ?> ><?php _e( 'Style-99 (Add your own image / GIF)', 'click-to-chat-for-whatsapp' ); ?></option>
|
377 |
+
</select>
|
378 |
+
<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>
|
379 |
+
<p class="description">Recommended Styles: 1, 8</p>
|
380 |
+
</div>
|
381 |
+
</div>
|
382 |
+
|
383 |
+
<!-- margin -->
|
384 |
+
<div class="row ctc_init_display_none woo_shop_add_whatsapp_settings">
|
385 |
+
<div class="col s6" style="padding-top: 14px;">
|
386 |
+
<p><?php _e( 'Spacing (Margin)', 'click-to-chat-for-whatsapp' ); ?></p>
|
387 |
+
</div>
|
388 |
+
<div class="input-field col s6" style="display: flex; margin-bottom: 1px;">
|
389 |
+
<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' ); ?>">
|
390 |
+
<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' ); ?>">
|
391 |
+
<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' ); ?>">
|
392 |
+
<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' ); ?>">
|
393 |
+
</div>
|
394 |
+
<span class="helper-text" style="float:right;">Top, Bottom, Left, Right <span> E.g. 10px, 50%</span> </span>
|
395 |
+
</div>
|
396 |
+
|
397 |
+
</div>
|
398 |
+
</div>
|
399 |
+
</li>
|
400 |
+
</ul>
|
401 |
+
|
402 |
+
<!-- woo cart page -->
|
403 |
+
<ul class="collapsible ht_ctc_woo_cart" style="margin-top: 40px;">
|
404 |
+
<li class="">
|
405 |
+
<div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'Cart Page', 'click-to-chat-for-whatsapp' ); ?></div>
|
406 |
+
<div class="collapsible-body">
|
407 |
+
|
408 |
+
<?php
|
409 |
+
if (function_exists( 'wc_get_page_id')) {
|
410 |
+
$admin_url = admin_url();
|
411 |
+
$shop_page_id = wc_get_page_id( 'cart' );
|
412 |
+
$shop_admin_url = "${admin_url}post.php?post=${shop_page_id}&action=edit";
|
413 |
+
?>
|
414 |
+
<p class="description">Cart Page <a target="_blank" href="<?= $shop_admin_url ?>">Edit </a> -> Settings Icon - At the right Sidebar 'Click to Chat' metabox - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a></p>
|
415 |
+
<?php
|
416 |
+
}
|
417 |
+
?>
|
418 |
+
|
419 |
+
</div>
|
420 |
+
</div>
|
421 |
+
</li>
|
422 |
+
</ul>
|
423 |
+
|
424 |
+
<!-- woo checkout page -->
|
425 |
+
<ul class="collapsible ht_ctc_woo_checkout" style="margin-top: 40px;">
|
426 |
+
<li class="">
|
427 |
+
<div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'Checkout Page', 'click-to-chat-for-whatsapp' ); ?></div>
|
428 |
+
<div class="collapsible-body">
|
429 |
+
|
430 |
+
<?php
|
431 |
+
if (function_exists( 'wc_get_page_id')) {
|
432 |
+
$admin_url = admin_url();
|
433 |
+
$shop_page_id = wc_get_page_id( 'checkout' );
|
434 |
+
$shop_admin_url = "${admin_url}post.php?post=${shop_page_id}&action=edit";
|
435 |
+
?>
|
436 |
+
<p class="description">Checkout Page <a target="_blank" href="<?= $shop_admin_url ?>">Edit </a> -> Settings Icon - At the right Sidebar 'Click to Chat' metabox - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a></p>
|
437 |
+
<?php
|
438 |
+
}
|
439 |
+
?>
|
440 |
+
|
441 |
+
</div>
|
442 |
+
</div>
|
443 |
+
</li>
|
444 |
+
</ul>
|
445 |
+
|
446 |
+
|
447 |
+
<!-- woo My Account page -->
|
448 |
+
<ul class="collapsible ht_ctc_woo_myaccount" style="margin-top: 40px;">
|
449 |
+
<li class="">
|
450 |
+
<div class="collapsible-header"><?php _e( 'WooCommerce', 'click-to-chat-for-whatsapp' ); ?> - <?php _e( 'My Account Page', 'click-to-chat-for-whatsapp' ); ?></div>
|
451 |
+
<div class="collapsible-body">
|
452 |
+
|
453 |
+
<?php
|
454 |
+
if (function_exists( 'wc_get_page_id')) {
|
455 |
+
$admin_url = admin_url();
|
456 |
+
$shop_page_id = wc_get_page_id( 'myaccount' );
|
457 |
+
$shop_admin_url = "${admin_url}post.php?post=${shop_page_id}&action=edit";
|
458 |
+
?>
|
459 |
+
<p class="description">My Account Page <a target="_blank" href="<?= $shop_admin_url ?>">Edit </a> -> Settings Icon - At the right Sidebar 'Click to Chat' metabox - <a target="_blank" href="https://holithemes.com/plugins/click-to-chat/change-values-at-page-level/">Page Level Settings</a></p>
|
460 |
+
<?php
|
461 |
+
}
|
462 |
+
?>
|
463 |
+
|
464 |
+
</div>
|
465 |
+
</div>
|
466 |
+
</li>
|
467 |
+
</ul>
|
468 |
|
469 |
<?php
|
470 |
}
|
488 |
foreach ($input as $key => $value) {
|
489 |
if( isset( $input[$key] ) ) {
|
490 |
|
491 |
+
if ( 'woo_pre_filled' == $key || 'woo_shop_pre_filled' == $key ) {
|
492 |
$new_input[$key] = sanitize_textarea_field( $input[$key] );
|
493 |
+
} elseif ( '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 ) {
|
494 |
+
$input[$key] = str_replace( ' ', '', $input[$key] );
|
495 |
+
if ( is_numeric($input[$key]) ) {
|
496 |
+
$input[$key] = $input[$key] . 'px';
|
497 |
+
}
|
498 |
+
// if ( '' == $input[$key] ) {
|
499 |
+
// $input[$key] = '0px';
|
500 |
+
// }
|
501 |
+
$new_input[$key] = sanitize_text_field( $input[$key] );
|
502 |
} else {
|
503 |
$new_input[$key] = sanitize_text_field( $input[$key] );
|
504 |
}
|
507 |
|
508 |
// l10n
|
509 |
foreach ($input as $key => $value) {
|
510 |
+
if ( 'woo_pre_filled' == $key || 'woo_call_to_action' == $key || 'woo_shop_pre_filled' == $key || 'woo_shop_call_to_action' == $key) {
|
511 |
do_action( 'wpml_register_single_string', 'Click to Chat for WhatsApp', $key, $input[$key] );
|
512 |
}
|
513 |
}
|
prev/inc/commons/class-ht-ccw-ismobile.php
CHANGED
@@ -1,11 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
-
*
|
5 |
-
* @fix
|
6 |
-
* if error realted to wp_is_mobile then
|
7 |
-
* at construct - $this->is_mobile = $this->is_mobile();
|
8 |
-
* and uncomment - $this->is_mobile = $this->new_is_mobile();
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -24,27 +19,10 @@ class HT_CCW_IsMobile {
|
|
24 |
|
25 |
public function __construct() {
|
26 |
|
27 |
-
|
28 |
-
$this->is_mobile = $this->new_is_mobile();
|
29 |
|
30 |
}
|
31 |
|
32 |
-
|
33 |
-
/**
|
34 |
-
*
|
35 |
-
* Check is mobile device or not
|
36 |
-
* wp_is_mobile - if true then 1, else 2
|
37 |
-
*/
|
38 |
-
public function is_mobile() {
|
39 |
-
if ( wp_is_mobile() ) {
|
40 |
-
return $this->is_mobile = 1;
|
41 |
-
} else {
|
42 |
-
return $this->is_mobile = 2;
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
/**
|
49 |
* added this - an user mention that wp_is_mobile uncauched error
|
50 |
* so now it easy to fix incase more users repoted this issue
|
@@ -52,7 +30,7 @@ class HT_CCW_IsMobile {
|
|
52 |
* Check is mobile device or not
|
53 |
* wp_is_mobile - if true then 1, else 2
|
54 |
*/
|
55 |
-
public function
|
56 |
|
57 |
if ( function_exists( 'wp_is_mobile' ) ) {
|
58 |
if ( wp_is_mobile() ) {
|
@@ -72,13 +50,10 @@ class HT_CCW_IsMobile {
|
|
72 |
|
73 |
|
74 |
/**
|
75 |
-
* @uses $this ->
|
76 |
-
*
|
77 |
-
* fallback for wp_is_mobile
|
78 |
-
* php way of find is mobile - but not with wordpress defined wp_is_mobile
|
79 |
*
|
80 |
-
*
|
81 |
-
*
|
82 |
* @return boolean
|
83 |
*/
|
84 |
public function php_is_mobile() {
|
1 |
<?php
|
2 |
/**
|
3 |
+
* detect device - mobile or not
|
|
|
|
|
|
|
|
|
|
|
4 |
*
|
5 |
*/
|
6 |
|
19 |
|
20 |
public function __construct() {
|
21 |
|
22 |
+
$this->is_mobile = $this->is_mobile();
|
|
|
23 |
|
24 |
}
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
/**
|
27 |
* added this - an user mention that wp_is_mobile uncauched error
|
28 |
* so now it easy to fix incase more users repoted this issue
|
30 |
* Check is mobile device or not
|
31 |
* wp_is_mobile - if true then 1, else 2
|
32 |
*/
|
33 |
+
public function is_mobile() {
|
34 |
|
35 |
if ( function_exists( 'wp_is_mobile' ) ) {
|
36 |
if ( wp_is_mobile() ) {
|
50 |
|
51 |
|
52 |
/**
|
53 |
+
* @uses $this -> is_mobile
|
|
|
|
|
|
|
54 |
*
|
55 |
+
* php way of find is mobile
|
56 |
+
* fallback if wp_is_mobile is not defined
|
57 |
* @return boolean
|
58 |
*/
|
59 |
public function php_is_mobile() {
|
prev/inc/commons/styles-list-sc/sc-style-99.php
CHANGED
@@ -2,35 +2,35 @@
|
|
2 |
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
5 |
-
$
|
6 |
-
$
|
7 |
-
$
|
8 |
-
$
|
9 |
-
$
|
10 |
-
$
|
11 |
|
12 |
// img url
|
13 |
// image - width, height based on device
|
14 |
$img_css = "";
|
15 |
|
16 |
if( 1 == $is_mobile ) {
|
17 |
-
$own_image = $
|
18 |
|
19 |
-
if ( '' !== $
|
20 |
-
$img_css .= "height: $
|
21 |
}
|
22 |
-
if ( '' !== $
|
23 |
-
$img_css .= "width: $
|
24 |
}
|
25 |
} else {
|
26 |
-
$own_image = $
|
27 |
|
28 |
-
if ( '' !== $
|
29 |
-
$img_css .= "height: $
|
30 |
}
|
31 |
|
32 |
-
if ( '' !== $
|
33 |
-
$img_css .= "width: $
|
34 |
}
|
35 |
}
|
36 |
|
2 |
|
3 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
4 |
|
5 |
+
$s_99_img_height_desktop = $a['s99_img_height_desktop'];
|
6 |
+
$s_99_img_width_desktop = $a['s99_img_width_desktop'];
|
7 |
+
$s_99_img_height_mobile = $a['s99_img_height_mobile'];
|
8 |
+
$s_99_img_width_mobile = $a['s99_img_width_mobile'];
|
9 |
+
$s_99_desktop_img = $a['s99_desktop_img'];
|
10 |
+
$s_99_mobile_img = $a['s99_mobile_img'];
|
11 |
|
12 |
// img url
|
13 |
// image - width, height based on device
|
14 |
$img_css = "";
|
15 |
|
16 |
if( 1 == $is_mobile ) {
|
17 |
+
$own_image = $s_99_mobile_img;
|
18 |
|
19 |
+
if ( '' !== $s_99_img_height_mobile ) {
|
20 |
+
$img_css .= "height: $s_99_img_height_mobile; ";
|
21 |
}
|
22 |
+
if ( '' !== $s_99_img_width_mobile ) {
|
23 |
+
$img_css .= "width: $s_99_img_width_mobile; ";
|
24 |
}
|
25 |
} else {
|
26 |
+
$own_image = $s_99_desktop_img;
|
27 |
|
28 |
+
if ( '' !== $s_99_img_height_desktop ) {
|
29 |
+
$img_css .= "height: $s_99_img_height_desktop; ";
|
30 |
}
|
31 |
|
32 |
+
if ( '' !== $s_99_img_width_desktop ) {
|
33 |
+
$img_css .= "width: $s_99_img_width_desktop; ";
|
34 |
}
|
35 |
}
|
36 |
|
prev/inc/commons/styles-list/style-99.php
CHANGED
@@ -10,10 +10,10 @@
|
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
|
12 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
13 |
-
$
|
14 |
-
$
|
15 |
-
$
|
16 |
-
$
|
17 |
|
18 |
// img url
|
19 |
// image - width, height based on device
|
@@ -23,22 +23,22 @@ if( 1 == $is_mobile ) {
|
|
23 |
// $own_image = esc_attr( $ccw_options_cs['s99_mobile_img'] );
|
24 |
$own_image = esc_url( $ccw_options_cs['s99_mobile_img'] );
|
25 |
|
26 |
-
if ( '' !== $
|
27 |
-
$img_css .= "height: $
|
28 |
}
|
29 |
-
if ( '' !== $
|
30 |
-
$img_css .= "width: $
|
31 |
}
|
32 |
} else {
|
33 |
// $own_image = esc_attr( $ccw_options_cs['s99_desktop_img'] );
|
34 |
$own_image = esc_url( $ccw_options_cs['s99_desktop_img'] );
|
35 |
|
36 |
-
if ( '' !== $
|
37 |
-
$img_css .= "height: $
|
38 |
}
|
39 |
|
40 |
-
if ( '' !== $
|
41 |
-
$img_css .= "width: $
|
42 |
}
|
43 |
}
|
44 |
|
10 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
|
12 |
// $ccw_options_cs = get_option('ccw_options_cs');
|
13 |
+
$s_99_img_height_desktop = esc_attr( $ccw_options_cs['s99_img_height_desktop'] );
|
14 |
+
$s_99_img_width_desktop = esc_attr( $ccw_options_cs['s99_img_width_desktop'] );
|
15 |
+
$s_99_img_height_mobile = esc_attr( $ccw_options_cs['s99_img_height_mobile'] );
|
16 |
+
$s_99_img_width_mobile = esc_attr( $ccw_options_cs['s99_img_width_mobile'] );
|
17 |
|
18 |
// img url
|
19 |
// image - width, height based on device
|
23 |
// $own_image = esc_attr( $ccw_options_cs['s99_mobile_img'] );
|
24 |
$own_image = esc_url( $ccw_options_cs['s99_mobile_img'] );
|
25 |
|
26 |
+
if ( '' !== $s_99_img_height_mobile ) {
|
27 |
+
$img_css .= "height: $s_99_img_height_mobile; ";
|
28 |
}
|
29 |
+
if ( '' !== $s_99_img_width_mobile ) {
|
30 |
+
$img_css .= "width: $s_99_img_width_mobile; ";
|
31 |
}
|
32 |
} else {
|
33 |
// $own_image = esc_attr( $ccw_options_cs['s99_desktop_img'] );
|
34 |
$own_image = esc_url( $ccw_options_cs['s99_desktop_img'] );
|
35 |
|
36 |
+
if ( '' !== $s_99_img_height_desktop ) {
|
37 |
+
$img_css .= "height: $s_99_img_height_desktop; ";
|
38 |
}
|
39 |
|
40 |
+
if ( '' !== $s_99_img_width_desktop ) {
|
41 |
+
$img_css .= "width: $s_99_img_width_desktop; ";
|
42 |
}
|
43 |
}
|
44 |
|
prev/inc/commons/styles.php
CHANGED
@@ -89,20 +89,6 @@ if( 1 == $is_mobile ) {
|
|
89 |
|
90 |
}
|
91 |
|
92 |
-
|
93 |
-
// if ( isset ( $_POST['subject'] ) ) {
|
94 |
-
// $num = esc_attr( $values['number'] );
|
95 |
-
// $subject = sanitize_text_field( $_POST['subject'] );
|
96 |
-
// $url = "$redirect_a&text=$subject";
|
97 |
-
|
98 |
-
// if ( headers_sent() ) {
|
99 |
-
// die('<script type="text/javascript">window.location.href="' . $url . '";</script>');
|
100 |
-
// } else {
|
101 |
-
// header('Location: ' . $url);
|
102 |
-
// die();
|
103 |
-
// }
|
104 |
-
// }
|
105 |
-
|
106 |
// floating style template path
|
107 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'prev/inc/commons/styles-list/style-' . $style. '.php';
|
108 |
|
89 |
|
90 |
}
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
// floating style template path
|
93 |
$path = plugin_dir_path( HT_CTC_PLUGIN_FILE ) . 'prev/inc/commons/styles-list/style-' . $style. '.php';
|
94 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Click to Chat ===
|
2 |
Requires at least: 4.6
|
3 |
-
Tested up to: 5.8
|
4 |
Requires PHP: 5.6
|
5 |
Contributors: holithemes
|
6 |
-
Stable tag: 3.
|
7 |
-
Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message,
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -84,6 +84,8 @@ With these variables, we can understand from which page the user started WhatsAp
|
|
84 |
|
85 |
= 🎁 WooCommerce =
|
86 |
|
|
|
|
|
87 |
Separate 'pre-filled message', 'call to action' settings for WooCommerce Single product pages.
|
88 |
|
89 |
Additional variables, specific to WooCommerce single product page to change values dynamically
|
@@ -91,11 +93,33 @@ Additional variables, specific to WooCommerce single product page to change valu
|
|
91 |
**{product}** -> Product Name
|
92 |
**{price}** -> Product Price (current price)
|
93 |
**{regular_price}** -> Regular product price (with out any sale)
|
94 |
-
**{sku}** ->Stock keeping unit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
= 📒 Change Settings at page level =
|
97 |
|
98 |
-
At page level we can overwrite the settings. Each post we can add different Whatsapp Number,
|
99 |
(while editing the post, at the right side bar 'Click to Chat' metabox)
|
100 |
|
101 |
* WhatsApp Number
|
@@ -121,9 +145,34 @@ Connect other applications using Integarate, Automation tools like Zapier, IFTTT
|
|
121 |
|
122 |
[Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks)
|
123 |
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
|
128 |
Easy to setup different values for each language
|
129 |
|
@@ -166,7 +215,6 @@ To change the WhatsApp number use 'number' attribute
|
|
166 |
|
167 |
[Shortcodes for Chat](https://holithemes.com/plugins/click-to-chat/shortcodes-chat/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
|
168 |
|
169 |
-
|
170 |
== Group ==
|
171 |
|
172 |
Enable Group chat feature and add WhatsApp Group id in the plugin setting page.
|
@@ -185,14 +233,6 @@ Let users share your website with their WhatsApp contacts and get more leads.
|
|
185 |
|
186 |
Help by [Translating the plugin](https://translate.wordpress.org/projects/wp-plugins/click-to-chat-for-whatsapp/) to available in more languages
|
187 |
|
188 |
-
== 🔯 Addons ==
|
189 |
-
|
190 |
-
= Reverse position for RTL Pages =
|
191 |
-
|
192 |
-
Reverse position for RTL pages, if left then right, if right then left.
|
193 |
-
i.e. if position is set to right: 10px then plugin will display at left: 10px
|
194 |
-
|
195 |
-
[Reverse position for RTL Pages](https://github.com/holithemes/click-to-chat-addon-rtl)
|
196 |
|
197 |
== screenshots ==
|
198 |
|
@@ -274,7 +314,7 @@ E.g.
|
|
274 |
I like to buy this {product}, {url}
|
275 |
|
276 |
|
277 |
-
With this prefilled text, we can know from which page the user started the conversation,
|
278 |
|
279 |
= Call to Action =
|
280 |
|
@@ -398,7 +438,7 @@ For any issues with the plugin / suggestions:
|
|
398 |
|
399 |
* WordPress [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
|
400 |
|
401 |
-
*
|
402 |
|
403 |
= ⭐️ Give Support =
|
404 |
|
@@ -425,6 +465,42 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
|
|
425 |
|
426 |
== Changelog ==
|
427 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
= 3.3.4 =
|
429 |
* Display Settings for WooCommerce Cart, Checkout, Account, Shop page
|
430 |
* Enchantment: WhatsApp Number field
|
1 |
=== Click to Chat ===
|
2 |
Requires at least: 4.6
|
3 |
+
Tested up to: 5.8.1
|
4 |
Requires PHP: 5.6
|
5 |
Contributors: holithemes
|
6 |
+
Stable tag: 3.5
|
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
|
10 |
|
84 |
|
85 |
= 🎁 WooCommerce =
|
86 |
|
87 |
+
== WooCommerce Single product pages ==
|
88 |
+
|
89 |
Separate 'pre-filled message', 'call to action' settings for WooCommerce Single product pages.
|
90 |
|
91 |
Additional variables, specific to WooCommerce single product page to change values dynamically
|
93 |
**{product}** -> Product Name
|
94 |
**{price}** -> Product Price (current price)
|
95 |
**{regular_price}** -> Regular product price (with out any sale)
|
96 |
+
**{sku}** -> Stock keeping unit
|
97 |
+
|
98 |
+
[Add WhatsApp Icon/Button in WooCommerce Product pages](https://holithemes.com/plugins/click-to-chat/add-whatsapp-in-woocommerce-single-product-pages/)
|
99 |
+
|
100 |
+
* After product summary
|
101 |
+
|
102 |
+
In PRO: multiple positions are available
|
103 |
+
|
104 |
+
* Before Main Content
|
105 |
+
* Before Product
|
106 |
+
* Before Product Summary
|
107 |
+
* Product Summary
|
108 |
+
* Before Add to Cart Form
|
109 |
+
* Before Cart Button
|
110 |
+
* After Cart Button
|
111 |
+
* After Add to Cart Form
|
112 |
+
* After Product
|
113 |
+
|
114 |
+
== WooCommerce Shop Page ==
|
115 |
+
|
116 |
+
Add WhatsApp button/icon at WooCommerce Products list (shop page, related products list)
|
117 |
+
|
118 |
+
[Shop page](https://holithemes.com/plugins/click-to-chat/whatsapp-chat-in-woocommerce-shop-page/)
|
119 |
|
120 |
= 📒 Change Settings at page level =
|
121 |
|
122 |
+
At page level we can overwrite the settings. Each post we can add different Whatsapp Number, Prefilled Message, Call to Action.
|
123 |
(while editing the post, at the right side bar 'Click to Chat' metabox)
|
124 |
|
125 |
* WhatsApp Number
|
145 |
|
146 |
[Webhooks](https://holithemes.com/plugins/click-to-chat/webhooks)
|
147 |
|
148 |
+
== 🔆 PRO ==
|
149 |
+
|
150 |
+
* Random Numbers
|
151 |
+
* Business hours: Offline/Online Settings
|
152 |
+
* Change WhatsApp number When Offline
|
153 |
+
* Change call to Action When Offline
|
154 |
+
or
|
155 |
+
* Hide When Offline
|
156 |
+
* Show/Hide in selected time range in a day
|
157 |
+
* Show/Hide on selected days in a week
|
158 |
+
* Webhooks - Dynamic variables
|
159 |
+
* {url} - replace with current page url
|
160 |
+
* {time} - time the user interacted with WhatsApp Button/Icon
|
161 |
+
* {number} - WhatsApp Number for that icon/button
|
162 |
+
* Position to place
|
163 |
+
* Fixed: fixed position to the scren (default, available in Free version)
|
164 |
+
* Absolute: Fixed position to the body content. (Moves when user scrolls the page)
|
165 |
+
* Time Dealy - Display after some time dealy
|
166 |
+
* Scroll Action - Display after user scroll the page of given percentage
|
167 |
+
* Page level settings - Change styles.
|
168 |
+
* WooCommerce
|
169 |
+
* Mulitple position to add WhatsApp in product pages.
|
170 |
+
|
171 |
+
[PRO](https://holithemes.com/plugins/click-to-chat/pricing/)
|
172 |
+
|
173 |
+
= 🎯 Localization =
|
174 |
+
|
175 |
+
Click to Chat is Compatible with translate plugins. [WPML](https://wpml.org/), Polylang.
|
176 |
|
177 |
Easy to setup different values for each language
|
178 |
|
215 |
|
216 |
[Shortcodes for Chat](https://holithemes.com/plugins/click-to-chat/shortcodes-chat/?utm_source=wp&utm_medium=readme&utm_campaign=ht)
|
217 |
|
|
|
218 |
== Group ==
|
219 |
|
220 |
Enable Group chat feature and add WhatsApp Group id in the plugin setting page.
|
233 |
|
234 |
Help by [Translating the plugin](https://translate.wordpress.org/projects/wp-plugins/click-to-chat-for-whatsapp/) to available in more languages
|
235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
|
237 |
== screenshots ==
|
238 |
|
314 |
I like to buy this {product}, {url}
|
315 |
|
316 |
|
317 |
+
With this prefilled text, we can know from which page the user started the conversation, purpose of the contact, and their details
|
318 |
|
319 |
= Call to Action =
|
320 |
|
438 |
|
439 |
* WordPress [new topic](https://wordpress.org/support/plugin/click-to-chat-for-whatsapp/)
|
440 |
|
441 |
+
* HoliThemes - Click to Chat [Support Forum](https://holithemes.com/support/forum/click-to-chat/)
|
442 |
|
443 |
= ⭐️ Give Support =
|
444 |
|
465 |
|
466 |
== Changelog ==
|
467 |
|
468 |
+
= 3.5 =
|
469 |
+
* New: Add Styles at WooCommerce Shop page. (Products Archive)
|
470 |
+
* Enchantment: Style-7 font size settings.
|
471 |
+
* Enchantment: Custom Element (convert any element to navigate to WhatsApp Chat)
|
472 |
+
|
473 |
+
= 3.4 =
|
474 |
+
* New: Add Styles with in WooCommerce Product pages
|
475 |
+
|
476 |
+
= 3.3.11 =
|
477 |
+
* Fix: Dynamic Variables on archive pages getting the last value.
|
478 |
+
* Enchantment: Add own image Style
|
479 |
+
|
480 |
+
= 3.3.10 =
|
481 |
+
* Enchantment: Number field, added helper text
|
482 |
+
* Enchantment: Position Type
|
483 |
+
|
484 |
+
= 3.3.9 =
|
485 |
+
* Introducing PRO Version
|
486 |
+
* Enchantment: variable for prefilled, call to action for WooCommerce pages at page level settings
|
487 |
+
|
488 |
+
= 3.3.8 =
|
489 |
+
* Fix: syntax error while updating the plugin.
|
490 |
+
|
491 |
+
= 3.3.7 =
|
492 |
+
* Enchantment: Webhook feature
|
493 |
+
* Fix: admin menu icon issue
|
494 |
+
|
495 |
+
= 3.3.6 =
|
496 |
+
* Enchantment: Customize styles settings
|
497 |
+
|
498 |
+
= 3.3.5 =
|
499 |
+
* New: aria-hidden attribute settings for Accessibility API
|
500 |
+
* Enchantment: Call to Action, Pre-filled Message (supports emojis)
|
501 |
+
* Enchantment: User Interface
|
502 |
+
* Show effect is now called as Entery effects
|
503 |
+
|
504 |
= 3.3.4 =
|
505 |
* Display Settings for WooCommerce Cart, Checkout, Account, Shop page
|
506 |
* Enchantment: WhatsApp Number field
|