| 1 |
<?php |
| 2 |
$has_wc = spoki_has_woocommerce(); |
| 3 |
$has_elementor = spoki_has_elementor(); |
| 4 |
$sections = ['fab', 'single_product', 'product_item', 'cart', 'other_buttons', 'elementor', 'qr_code']; |
| 5 |
$current_section = isset($_GET['section']) && in_array($_GET['section'], $sections) ? $_GET['section'] : $sections[0]; |
| 6 |
$is_current_tab = $GLOBALS['current_tab'] == 'buttons'; |
| 7 |
if (false == $has_wc) : ?> |
| 8 |
<div class="notice notice-error"> |
| 9 |
<p> |
| 10 |
<?php _e("Install and activate the <strong>WooCommerce</strong> plugin to enable the Spoki features for WooCommerce.", "spoki") ?> |
| 11 |
</p> |
| 12 |
</div> |
| 13 |
<?php endif ?> |
| 14 |
|
| 15 |
<?php if ($current_section == 'elementor' && !$has_elementor): ?> |
| 16 |
<div class="notice notice-error"> |
| 17 |
<p> |
| 18 |
<?php _e("Install and activate the <strong>Elementor</strong> plugin to enable the Spoki features for Elementor.", "spoki") ?> |
| 19 |
</p> |
| 20 |
</div> |
| 21 |
<?php endif ?> |
| 22 |
|
| 23 |
|
| 24 |
<div <?php if (!$is_current_tab) echo 'style="display:none"' ?>> |
| 25 |
<ul class="subsubsub"> |
| 26 |
<li><a href="<?php echo "?page=" . urlencode(SPOKI_PLUGIN_NAME) . "&tab=" . urlencode($GLOBALS['current_tab']) ?>§ion=fab" <?php if ($current_section == 'fab') echo "class='current'" ?>><?php _e('Floating Button', "spoki") ?></a> |</li> |
| 27 |
<li><a href="<?php echo "?page=" . urlencode(SPOKI_PLUGIN_NAME) . "&tab=" . urlencode($GLOBALS['current_tab']) ?>§ion=other_buttons" <?php if ($current_section == 'other_buttons') echo "class='current'" ?>><?php _e('Shortcode Button', "spoki") ?></a> |</li> |
| 28 |
<li><a href="<?php echo "?page=" . urlencode(SPOKI_PLUGIN_NAME) . "&tab=" . urlencode($GLOBALS['current_tab']) ?>§ion=product_item" <?php if ($current_section == 'product_item') echo "class='current'" ?>><?php _e('Shop page', "spoki") ?></a> |</li> |
| 29 |
<li><a href="<?php echo "?page=" . urlencode(SPOKI_PLUGIN_NAME) . "&tab=" . urlencode($GLOBALS['current_tab']) ?>§ion=single_product" <?php if ($current_section == 'single_product') echo "class='current'" ?>><?php _e('Product page', "spoki") ?></a> |</li> |
| 30 |
<li><a href="<?php echo "?page=" . urlencode(SPOKI_PLUGIN_NAME) . "&tab=" . urlencode($GLOBALS['current_tab']) ?>§ion=cart" <?php if ($current_section == 'cart') echo "class='current'" ?>><?php _e('Cart page', "spoki") ?></a> |</li> |
| 31 |
<li><a href="<?php echo "?page=" . urlencode(SPOKI_PLUGIN_NAME) . "&tab=" . urlencode($GLOBALS['current_tab']) ?>§ion=qr_code" <?php if ($current_section == 'qr_code') echo "class='current'" ?>><?php _e('QR Code', "spoki") ?></a> |</li> |
| 32 |
<li><a href="<?php echo "?page=" . urlencode(SPOKI_PLUGIN_NAME) . "&tab=" . urlencode($GLOBALS['current_tab']) ?>§ion=elementor" <?php if ($current_section == 'elementor') echo "class='current'" ?>><?php _e('Elementor', "spoki") ?></a></li> |
| 33 |
</ul> |
| 34 |
<br/> |
| 35 |
<br/> |
| 36 |
<div <?php if ($current_section != 'fab') echo "style='display:none'" ?>> |
| 37 |
<h2 class="title"> |
| 38 |
<?php _e('Floating Button', "spoki") ?> |
| 39 |
<a href="#TB_inline?&width=300&inlineId=buttons-info-dialog" class="thickbox button-info">ℹ</a> |
| 40 |
</h2> |
| 41 |
<p class="description"> |
| 42 |
<?php _e("Insert the fixed WhatsApp chat button on your website and receive information requests from your customers, to your number.", "spoki") ?> |
| 43 |
</p> |
| 44 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/home-page-button.png' ?>"/> |
| 45 |
<table class="form-table" role="presentation"> |
| 46 |
<tr> |
| 47 |
<th scope="row"> |
| 48 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_check]"> |
| 49 |
<?php _e('Enable', "spoki") ?> |
| 50 |
</label> |
| 51 |
</th> |
| 52 |
<td> |
| 53 |
<input type="checkbox" id="fixed_support_button_check" |
| 54 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_check]" |
| 55 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_check'])) echo checked(1, $this->options['buttons']['fixed_support_button_check'], false) ?>> |
| 56 |
|
| 57 |
<label for="fixed_support_button_check"><?php _e('Enable the button', "spoki") ?></label> |
| 58 |
<p class="description"> |
| 59 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('If you enable the chat button you make it visible on all pages of the site', "spoki") ?> |
| 60 |
</p> |
| 61 |
</td> |
| 62 |
</tr> |
| 63 |
<tr> |
| 64 |
<th scope="row"> |
| 65 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_text]"> |
| 66 |
<?php _e('Customer Message', "spoki") ?> |
| 67 |
</label> |
| 68 |
</th> |
| 69 |
<td> |
| 70 |
<textarea class="regular-text" |
| 71 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_text]" |
| 72 |
cols="50" rows="5" |
| 73 |
placeholder="<?php _e('Hi, I would like to receive more information about your business', "spoki") ?>"><?php if (isset($this->options['buttons']['fixed_support_button_text']) && $this->options['buttons']['fixed_support_button_text'] !== '') echo $this->options['buttons']['fixed_support_button_text'] ?></textarea> |
| 74 |
<p class="description"> |
| 75 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Preset message in chat that the customer can send via button to start a conversation', "spoki") ?> |
| 76 |
</p> |
| 77 |
</td> |
| 78 |
</tr> |
| 79 |
<tr> |
| 80 |
<th scope="row"> |
| 81 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_text]"> |
| 82 |
<?php _e('Customer Message on non-working days and times', "spoki") ?> |
| 83 |
</label> |
| 84 |
</th> |
| 85 |
<td> |
| 86 |
<label> |
| 87 |
<input id="fixed-support-button-non-working-text-toggle" type="checkbox" name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_non_working_text_enabled]" |
| 88 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_non_working_text_enabled'])) echo checked(1, $this->options['buttons']['fixed_support_button_non_working_text_enabled'], false) ?>> |
| 89 |
<?php _e('Enable alternative message on non-working days and times', "spoki") ?> |
| 90 |
</label> |
| 91 |
<br/> |
| 92 |
<textarea |
| 93 |
id="fixed-support-button-non-working-text" |
| 94 |
class="regular-text" |
| 95 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_non_working_text]" |
| 96 |
cols="50" rows="5" |
| 97 |
placeholder="<?php _e('Hi, I would like to receive more information about your business', "spoki") ?>"><?php if (isset($this->options['buttons']['fixed_support_button_non_working_text']) && $this->options['buttons']['fixed_support_button_non_working_text'] !== '') echo $this->options['buttons']['fixed_support_button_non_working_text'] ?></textarea> |
| 98 |
<p class="description"> |
| 99 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The customer will send you this message only the non-working days and times.<br/>Set the working days and times in the settings panel.', "spoki") ?> |
| 100 |
</p> |
| 101 |
<script> |
| 102 |
(function () { |
| 103 |
function toggleNonWorkingText(enable) { |
| 104 |
const el = document.getElementById('fixed-support-button-non-working-text'); |
| 105 |
if (enable) { |
| 106 |
el.removeAttribute('disabled'); |
| 107 |
} else { |
| 108 |
el.setAttribute('disabled', true); |
| 109 |
} |
| 110 |
} |
| 111 |
|
| 112 |
const nonWorkingTextToggleEl = document.getElementById('fixed-support-button-non-working-text-toggle'); |
| 113 |
toggleNonWorkingText(nonWorkingTextToggleEl.getAttribute('checked')) |
| 114 |
nonWorkingTextToggleEl.addEventListener('click', e => toggleNonWorkingText(e.target.checked)); |
| 115 |
})(); |
| 116 |
</script> |
| 117 |
</td> |
| 118 |
</tr> |
| 119 |
<tr> |
| 120 |
<th scope="row"> |
| 121 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_position]"> |
| 122 |
<?php _e('Position', "spoki") ?> |
| 123 |
</label> |
| 124 |
</th> |
| 125 |
<td> |
| 126 |
<label class="checkbox" for="fixed_support_button_position_left" style="margin-right: 8px"> |
| 127 |
<input type="radio" id="fixed_support_button_position_left" name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_position]" |
| 128 |
value="Left" <?php if (isset($this->options['buttons']['fixed_support_button_position']) && $this->options['buttons']['fixed_support_button_position'] == 'Left') echo 'checked' ?> /> |
| 129 |
<span><?php _e('Left', "spoki"); ?></span> |
| 130 |
</label> |
| 131 |
<label class="checkbox" for="fixed_support_button_position_right"> |
| 132 |
<input type="radio" id="fixed_support_button_position_right" name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_position]" |
| 133 |
value="Right" <?php if (isset($this->options['buttons']['fixed_support_button_position']) && $this->options['buttons']['fixed_support_button_position'] == 'Right') echo 'checked' ?> /> |
| 134 |
<span><?php _e('Right', "spoki"); ?></span> |
| 135 |
</label> |
| 136 |
<p class="description"> |
| 137 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Select where to display the button on the screen', "spoki") ?> |
| 138 |
</p> |
| 139 |
</td> |
| 140 |
</tr> |
| 141 |
<tr> |
| 142 |
<th scope="row"> |
| 143 |
<label for="fixed_support_button_color"> |
| 144 |
<?php _e('Color', "spoki") ?> |
| 145 |
</label> |
| 146 |
</th> |
| 147 |
<td> |
| 148 |
<input type="color" |
| 149 |
id="fixed_support_button_color" |
| 150 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_color]" |
| 151 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_color']) && $this->options['buttons']['fixed_support_button_color'] !== '') ? $this->options['buttons']['fixed_support_button_color'] : '#23D366' ?>" |
| 152 |
> |
| 153 |
<p class="description"> |
| 154 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the background color of the button (Suggested: <i>#23D366</i> - <i>rgb(35, 211, 102)</i>)', "spoki") ?> |
| 155 |
</p> |
| 156 |
</td> |
| 157 |
</tr> |
| 158 |
<tr> |
| 159 |
<th> |
| 160 |
<label for="fixed_support_button_border"> |
| 161 |
<b><?php _e('Border type', "spoki") ?></b> |
| 162 |
</label> |
| 163 |
</th> |
| 164 |
<td> |
| 165 |
<?php $fixed_support_button_border = isset($this->options['buttons']['fixed_support_button_border']) ? $this->options['buttons']['fixed_support_button_border'] : 'circle' ?> |
| 166 |
<select name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_border]" id="fixed_support_button_border" class="regular-text"> |
| 167 |
<option value="circle" <?php echo $fixed_support_button_border == 'circle' ? 'selected' : '' ?>><?php echo __('Circle', "spoki") ?></option> |
| 168 |
<option value="squared" <?php echo $fixed_support_button_border == 'squared' ? 'selected' : '' ?>><?php echo __('Squared', "spoki") ?></option> |
| 169 |
<option value="rounded" <?php echo $fixed_support_button_border == 'rounded' ? 'selected' : '' ?>><?php echo __('Rounded', "spoki") ?></option> |
| 170 |
</select> |
| 171 |
<p class="description"> |
| 172 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Choose the button border type', "spoki"); ?> |
| 173 |
</p> |
| 174 |
</td> |
| 175 |
</tr> |
| 176 |
<tr> |
| 177 |
<th scope="row"> |
| 178 |
<label for="fixed_support_button_side_space"> |
| 179 |
<?php _e('Space from side', "spoki") ?> |
| 180 |
</label> |
| 181 |
</th> |
| 182 |
<td> |
| 183 |
<label> |
| 184 |
<input type="number" id="fixed_support_button_side_space" |
| 185 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_side_space]" |
| 186 |
placeholder="12" |
| 187 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_side_space']) && $this->options['buttons']['fixed_support_button_side_space'] !== '') ? $this->options['buttons']['fixed_support_button_side_space'] : '12' ?>"> |
| 188 |
px |
| 189 |
</label> |
| 190 |
<p class="description"> |
| 191 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the space from the left/right side of the screen', "spoki") ?> |
| 192 |
</p> |
| 193 |
</td> |
| 194 |
</tr> |
| 195 |
<tr> |
| 196 |
<th scope="row"> |
| 197 |
<label for="fixed_support_button_bottom_space"> |
| 198 |
<?php _e('Space from bottom', "spoki") ?> |
| 199 |
</label> |
| 200 |
</th> |
| 201 |
<td> |
| 202 |
<label> |
| 203 |
<input type="number" id="fixed_support_button_bottom_space" |
| 204 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_bottom_space]" |
| 205 |
placeholder="12" |
| 206 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_bottom_space']) && $this->options['buttons']['fixed_support_button_bottom_space'] !== '') ? $this->options['buttons']['fixed_support_button_bottom_space'] : '12' ?>"> |
| 207 |
px |
| 208 |
</label> |
| 209 |
<p class="description"> |
| 210 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the space from the bottom of the screen', "spoki") ?> |
| 211 |
</p> |
| 212 |
</td> |
| 213 |
</tr> |
| 214 |
<tr> |
| 215 |
<th scope="row"> |
| 216 |
<label for="fixed_support_button_size"> |
| 217 |
<?php _e('Size', "spoki") ?> |
| 218 |
</label> |
| 219 |
</th> |
| 220 |
<td> |
| 221 |
<label> |
| 222 |
<input type="number" id="fixed_support_button_size" |
| 223 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_size]" |
| 224 |
placeholder="50" |
| 225 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_size']) && $this->options['buttons']['fixed_support_button_size'] !== '') ? $this->options['buttons']['fixed_support_button_size'] : '50' ?>"> |
| 226 |
px |
| 227 |
</label> |
| 228 |
<p class="description"> |
| 229 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the size of the button', "spoki") ?> |
| 230 |
</p> |
| 231 |
</td> |
| 232 |
</tr> |
| 233 |
</table> |
| 234 |
<br/> |
| 235 |
<hr/> |
| 236 |
<h3><?php _e('Chat widget', "spoki") ?></h3> |
| 237 |
<p class="description"> |
| 238 |
<?php _e("The chat widget will be <b>shown on button click</b>.", "spoki") ?> |
| 239 |
</p> |
| 240 |
<img class="cover-image" style="max-height: 210px;margin-top: 10px;border-radius:4px;" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/fab-chat-widget.png' ?>"/> |
| 241 |
|
| 242 |
<table class="form-table" role="presentation"> |
| 243 |
<tr> |
| 244 |
<th scope="row"> |
| 245 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_chat_widget]"> |
| 246 |
<?php _e('Enable chat widget', "spoki") ?> |
| 247 |
</label> |
| 248 |
</th> |
| 249 |
<td> |
| 250 |
<input type="checkbox" id="fixed_support_button_show_chat_widget" |
| 251 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_chat_widget]" |
| 252 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_show_chat_widget'])) echo checked(1, $this->options['buttons']['fixed_support_button_show_chat_widget'], false) ?>> |
| 253 |
|
| 254 |
<label for="fixed_support_button_show_chat_widget"><?php _e('Show chat widget on button click', "spoki") ?></label> |
| 255 |
</td> |
| 256 |
</tr> |
| 257 |
<tr> |
| 258 |
<th scope="row"> |
| 259 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_chat_widget_message]"> |
| 260 |
<?php _e('Your Message', "spoki") ?> |
| 261 |
</label> |
| 262 |
</th> |
| 263 |
<td> |
| 264 |
<textarea class="regular-text" rows="1" |
| 265 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_chat_widget_message]" |
| 266 |
placeholder="<?php _e('Chat with us 👋', "spoki") ?>"><?php if (isset($this->options['buttons']['fixed_support_button_chat_widget_message']) && $this->options['buttons']['fixed_support_button_chat_widget_message'] !== '') echo $this->options['buttons']['fixed_support_button_chat_widget_message'] ?></textarea> |
| 267 |
<p class="description"> |
| 268 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Thi is the text of the message sent from you.', "spoki") ?> |
| 269 |
</p> |
| 270 |
</td> |
| 271 |
</tr> |
| 272 |
<tr> |
| 273 |
<th scope="row"> |
| 274 |
<label for="fixed_support_button_chat_widget_delay"> |
| 275 |
<?php _e('Delay', "spoki") ?> |
| 276 |
</label> |
| 277 |
</th> |
| 278 |
<td> |
| 279 |
<label> |
| 280 |
<input type="number" id="fixed_support_button_chat_widget_delay" |
| 281 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_chat_widget_delay]" |
| 282 |
min="0" |
| 283 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_chat_widget_delay']) && $this->options['buttons']['fixed_support_button_chat_widget_delay'] !== '') ? $this->options['buttons']['fixed_support_button_chat_widget_delay'] : '0' ?>"> |
| 284 |
<?php _e('seconds', "spoki") ?> |
| 285 |
</label> |
| 286 |
<p class="description"> |
| 287 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Show the chat widget after this delay (0 = delay disabled)', "spoki") ?> |
| 288 |
</p> |
| 289 |
</td> |
| 290 |
</tr> |
| 291 |
</table> |
| 292 |
<br/> |
| 293 |
<hr/> |
| 294 |
<h3><?php _e('Label', "spoki") ?></h3> |
| 295 |
<p class="description"> |
| 296 |
<?php _e("Display a label for your floating button to entice the user to click on the button.", "spoki") ?> |
| 297 |
</p> |
| 298 |
<img class="cover-image" style="max-height: 150px;margin-top: 10px;border-radius:4px;" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/fab-label.png' ?>"/> |
| 299 |
|
| 300 |
<table class="form-table" role="presentation"> |
| 301 |
<tr> |
| 302 |
<th scope="row"> |
| 303 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_label]"> |
| 304 |
<?php _e('Enable label', "spoki") ?> |
| 305 |
</label> |
| 306 |
</th> |
| 307 |
<td> |
| 308 |
<input type="checkbox" id="fixed_support_button_show_label" |
| 309 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_label]" |
| 310 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_show_label'])) echo checked(1, $this->options['buttons']['fixed_support_button_show_label'], false) ?>> |
| 311 |
|
| 312 |
<label for="fixed_support_button_show_label"><?php _e('Show label', "spoki") ?></label> |
| 313 |
</td> |
| 314 |
</tr> |
| 315 |
<tr> |
| 316 |
<th scope="row"> |
| 317 |
<label for="fixed_support_button_label_delay"> |
| 318 |
<?php _e('Delay', "spoki") ?> |
| 319 |
</label> |
| 320 |
</th> |
| 321 |
<td> |
| 322 |
<label> |
| 323 |
<input type="number" id="fixed_support_button_label_delay" |
| 324 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_label_delay]" |
| 325 |
min="0" |
| 326 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_label_delay']) && $this->options['buttons']['fixed_support_button_label_delay'] !== '') ? $this->options['buttons']['fixed_support_button_label_delay'] : '0' ?>"> |
| 327 |
<?php _e('seconds', "spoki") ?> |
| 328 |
</label> |
| 329 |
<p class="description"> |
| 330 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Show the label after this delay (0 = immediately)', "spoki") ?> |
| 331 |
</p> |
| 332 |
</td> |
| 333 |
</tr> |
| 334 |
<tr> |
| 335 |
<th scope="row"> |
| 336 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_label_on_hover]"> |
| 337 |
<?php _e('Show on hover', "spoki") ?> |
| 338 |
</label> |
| 339 |
</th> |
| 340 |
<td> |
| 341 |
<input type="checkbox" id="fixed_support_button_show_label_on_hover" |
| 342 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_label_on_hover]" |
| 343 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_show_label_on_hover'])) echo checked(1, $this->options['buttons']['fixed_support_button_show_label_on_hover'], false) ?>> |
| 344 |
|
| 345 |
<label for="fixed_support_button_show_label_on_hover"><?php _e('Show label only on button hover', "spoki") ?></label> |
| 346 |
</td> |
| 347 |
</tr> |
| 348 |
<tr> |
| 349 |
<th scope="row"> |
| 350 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_label_content]"> |
| 351 |
<?php _e('Label text', "spoki") ?> |
| 352 |
</label> |
| 353 |
</th> |
| 354 |
<td> |
| 355 |
<textarea class="regular-text" rows="1" |
| 356 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_label_content]" |
| 357 |
placeholder="<?php _e('Chat with us 👋', "spoki") ?>"><?php if (isset($this->options['buttons']['fixed_support_button_label_content']) && $this->options['buttons']['fixed_support_button_label_content'] !== '') echo $this->options['buttons']['fixed_support_button_label_content'] ?></textarea> |
| 358 |
</td> |
| 359 |
</tr> |
| 360 |
<tr> |
| 361 |
<th scope="row"> |
| 362 |
<label for="fixed_support_button_label_font_size"> |
| 363 |
<?php _e('Font size', "spoki") ?> (px) |
| 364 |
</label> |
| 365 |
</th> |
| 366 |
<td> |
| 367 |
<label> |
| 368 |
<input type="number" id="fixed_support_button_label_font_size" |
| 369 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_label_font_size]" |
| 370 |
placeholder="16" |
| 371 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_label_font_size']) && $this->options['buttons']['fixed_support_button_label_font_size'] !== '') ? $this->options['buttons']['fixed_support_button_label_font_size'] : '16' ?>"> |
| 372 |
</label> |
| 373 |
<p class="description"> |
| 374 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the font size of the label', "spoki") ?> |
| 375 |
</p> |
| 376 |
</td> |
| 377 |
</tr> |
| 378 |
<tr> |
| 379 |
<th scope="row"> |
| 380 |
<label for="fixed_support_button_label_text_color"> |
| 381 |
<?php _e('Color', "spoki") ?> |
| 382 |
</label> |
| 383 |
</th> |
| 384 |
<td> |
| 385 |
<input type="color" |
| 386 |
id="fixed_support_button_label_text_color" |
| 387 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_label_text_color]" |
| 388 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_label_text_color']) && $this->options['buttons']['fixed_support_button_label_text_color'] !== '') ? $this->options['buttons']['fixed_support_button_label_text_color'] : '#333333' ?>" |
| 389 |
> |
| 390 |
<p class="description"> |
| 391 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the color of the text of the label (Suggested: <i>#333333</i> - <i>rgb(51, 51, 51)</i>)', "spoki") ?> |
| 392 |
</p> |
| 393 |
</td> |
| 394 |
</tr> |
| 395 |
<tr> |
| 396 |
<th scope="row"> |
| 397 |
<label for="fixed_support_button_label_background_color"> |
| 398 |
<?php _e('Background Color', "spoki") ?> |
| 399 |
</label> |
| 400 |
</th> |
| 401 |
<td> |
| 402 |
<input type="color" |
| 403 |
id="fixed_support_button_label_background_color" |
| 404 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_label_background_color]" |
| 405 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_label_background_color']) && $this->options['buttons']['fixed_support_button_label_background_color'] !== '') ? $this->options['buttons']['fixed_support_button_label_background_color'] : '#FFFFFF' ?>" |
| 406 |
> |
| 407 |
<p class="description"> |
| 408 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the background color of the label (Suggested: <i>#FFFFFF</i> - <i>rgb(255, 255, 255)</i>)', "spoki") ?> |
| 409 |
</p> |
| 410 |
</td> |
| 411 |
</tr> |
| 412 |
</table> |
| 413 |
<br/> |
| 414 |
<hr/> |
| 415 |
<h3><?php _e('Badge', "spoki") ?></h3> |
| 416 |
<p class="description"> |
| 417 |
<?php _e("Show the unread message badge to entice the user to click on the button.", "spoki") ?> |
| 418 |
</p> |
| 419 |
<img class="cover-image" style="max-height: 100px;margin-top: 10px;border-radius:4px;" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/popup.png' ?>"/> |
| 420 |
<table class="form-table" role="presentation"> |
| 421 |
<tr> |
| 422 |
<th scope="row"> |
| 423 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_popup]"> |
| 424 |
<?php _e('Enable badge', "spoki") ?> |
| 425 |
</label> |
| 426 |
</th> |
| 427 |
<td> |
| 428 |
<input type="checkbox" id="fixed_support_button_show_popup" |
| 429 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_show_popup]" |
| 430 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_show_popup'])) echo checked(1, $this->options['buttons']['fixed_support_button_show_popup'], false) ?>> |
| 431 |
|
| 432 |
<label for="fixed_support_button_show_popup"><?php _e('Show badge', "spoki") ?></label> |
| 433 |
</td> |
| 434 |
</tr> |
| 435 |
<tr> |
| 436 |
<th scope="row"> |
| 437 |
<label for="fixed_support_button_popup_delay"> |
| 438 |
<?php _e('Delay', "spoki") ?> |
| 439 |
</label> |
| 440 |
</th> |
| 441 |
<td> |
| 442 |
<label> |
| 443 |
<input type="number" id="fixed_support_button_popup_delay" |
| 444 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_popup_delay]" |
| 445 |
min="0" |
| 446 |
value="<?php echo (isset($this->options['buttons']['fixed_support_button_popup_delay']) && $this->options['buttons']['fixed_support_button_popup_delay'] !== '') ? $this->options['buttons']['fixed_support_button_popup_delay'] : '0' ?>"> |
| 447 |
<?php _e('seconds', "spoki") ?> |
| 448 |
</label> |
| 449 |
<p class="description"> |
| 450 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Show the badge after this delay (0 = immediately)', "spoki") ?> |
| 451 |
</p> |
| 452 |
</td> |
| 453 |
</tr> |
| 454 |
</table> |
| 455 |
<br/> |
| 456 |
<hr/> |
| 457 |
<h3><?php _e('Visibility rules', "spoki") ?></h3> |
| 458 |
<p class="description"> |
| 459 |
<?php _e("Set custom visibility rules for the floating button.", "spoki") ?> |
| 460 |
</p> |
| 461 |
<table class="form-table" role="presentation"> |
| 462 |
<tr> |
| 463 |
<th scope="row"> |
| 464 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_non_working]"> |
| 465 |
<?php _e('Hide on non-working days and times', "spoki") ?> |
| 466 |
</label> |
| 467 |
</th> |
| 468 |
<td> |
| 469 |
<input type="checkbox" id="fixed_support_button_hide_non_working" |
| 470 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_non_working]" |
| 471 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_non_working'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_non_working'], false) ?>> |
| 472 |
|
| 473 |
<label for="fixed_support_button_hide_non_working"><?php _e('Hide the button on non-working days and times', "spoki") ?></label> |
| 474 |
<p class="description"> |
| 475 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the working days and times in the settings panel', "spoki") ?> |
| 476 |
</p> |
| 477 |
</td> |
| 478 |
</tr> |
| 479 |
<tr> |
| 480 |
<th scope="row"> |
| 481 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_mobile]"> |
| 482 |
<?php _e('Hide on Mobile', "spoki") ?> |
| 483 |
</label> |
| 484 |
</th> |
| 485 |
<td> |
| 486 |
<input type="checkbox" id="fixed_support_button_hide_mobile" |
| 487 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_mobile]" |
| 488 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_mobile'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_mobile'], false) ?>> |
| 489 |
|
| 490 |
<label for="fixed_support_button_hide_mobile"><?php _e('Hide Floating Button on Mobile', "spoki") ?></label> |
| 491 |
<p class="description"> |
| 492 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The floating button will be hidden on mobile resolutions', "spoki") ?> <i>(<576px)</i> |
| 493 |
</p> |
| 494 |
</td> |
| 495 |
</tr> |
| 496 |
<tr> |
| 497 |
<th scope="row"> |
| 498 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_tablet]"> |
| 499 |
<?php _e('Hide on Tablet', "spoki") ?> |
| 500 |
</label> |
| 501 |
</th> |
| 502 |
<td> |
| 503 |
<input type="checkbox" id="fixed_support_button_hide_tablet" |
| 504 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_tablet]" |
| 505 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_tablet'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_tablet'], false) ?>> |
| 506 |
|
| 507 |
<label for="fixed_support_button_hide_tablet"><?php _e('Hide Floating Button on Tablet', "spoki") ?></label> |
| 508 |
<p class="description"> |
| 509 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The floating button will be hidden on tablet resolutions', "spoki") ?> <i>(>575px & <992px)</i> |
| 510 |
</p> |
| 511 |
</td> |
| 512 |
</tr> |
| 513 |
<tr> |
| 514 |
<th scope="row"> |
| 515 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_desktop]"> |
| 516 |
<?php _e('Hide on Desktop', "spoki") ?> |
| 517 |
</label> |
| 518 |
</th> |
| 519 |
<td> |
| 520 |
<input type="checkbox" id="fixed_support_button_hide_desktop" |
| 521 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_desktop]" |
| 522 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_desktop'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_desktop'], false) ?>> |
| 523 |
|
| 524 |
<label for="fixed_support_button_hide_desktop"><?php _e('Hide Floating Button on Desktop', "spoki") ?></label> |
| 525 |
<p class="description"> |
| 526 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The floating button will be hidden on desktop resolutions', "spoki") ?> <i>(>991px)</i> |
| 527 |
</p> |
| 528 |
</td> |
| 529 |
</tr> |
| 530 |
<tr> |
| 531 |
<th scope="row"> |
| 532 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_post_page]"> |
| 533 |
<?php _e('Hide on Post Page', "spoki") ?> |
| 534 |
</label> |
| 535 |
</th> |
| 536 |
<td> |
| 537 |
<input type="checkbox" id="fixed_support_button_hide_post_page" |
| 538 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_post_page]" |
| 539 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_post_page'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_post_page'], false) ?>> |
| 540 |
<label for="fixed_support_button_hide_post_page"><?php _e('Hide Floating Button on all Single Post pages', "spoki") ?></label> |
| 541 |
</td> |
| 542 |
</tr> |
| 543 |
<tr> |
| 544 |
<th scope="row"> |
| 545 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_single_page]"> |
| 546 |
<?php _e('Hide on Single Page', "spoki") ?> |
| 547 |
</label> |
| 548 |
</th> |
| 549 |
<td> |
| 550 |
<input type="checkbox" id="fixed_support_button_hide_single_page" |
| 551 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_single_page]" |
| 552 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_single_page'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_single_page'], false) ?>> |
| 553 |
<label for="fixed_support_button_hide_single_page"><?php _e('Hide Floating Button on all Single pages', "spoki") ?></label> |
| 554 |
</td> |
| 555 |
</tr> |
| 556 |
<?php if ($has_wc): ?> |
| 557 |
<tr> |
| 558 |
<th scope="row"> |
| 559 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_shop_page]"> |
| 560 |
<?php _e('Hide on Shop Page', "spoki") ?> |
| 561 |
</label> |
| 562 |
</th> |
| 563 |
<td> |
| 564 |
<input type="checkbox" id="fixed_support_button_hide_shop_page" |
| 565 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_shop_page]" |
| 566 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_shop_page'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_shop_page'], false) ?>> |
| 567 |
<label for="fixed_support_button_hide_shop_page"><?php _e('Hide Floating Button on Shop page', "spoki") ?></label> |
| 568 |
</td> |
| 569 |
</tr> |
| 570 |
<tr> |
| 571 |
<th scope="row"> |
| 572 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_product_page]"> |
| 573 |
<?php _e('Hide on Product Page', "spoki") ?> |
| 574 |
</label> |
| 575 |
</th> |
| 576 |
<td> |
| 577 |
<input type="checkbox" id="fixed_support_button_hide_product_page" |
| 578 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_product_page]" |
| 579 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_product_page'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_product_page'], false) ?>> |
| 580 |
<label for="fixed_support_button_hide_product_page"><?php _e('Hide Floating Button on all Product Detail pages', "spoki") ?></label> |
| 581 |
</td> |
| 582 |
</tr> |
| 583 |
<tr> |
| 584 |
<th scope="row"> |
| 585 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_cart_page]"> |
| 586 |
<?php _e('Hide on Cart Page', "spoki") ?> |
| 587 |
</label> |
| 588 |
</th> |
| 589 |
<td> |
| 590 |
<input type="checkbox" id="fixed_support_button_hide_cart_page" |
| 591 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_cart_page]" |
| 592 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_cart_page'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_cart_page'], false) ?>> |
| 593 |
<label for="fixed_support_button_hide_cart_page"><?php _e('Hide Floating Button on Cart page', "spoki") ?></label> |
| 594 |
</td> |
| 595 |
</tr> |
| 596 |
<tr> |
| 597 |
<th scope="row"> |
| 598 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_checkout_page]"> |
| 599 |
<?php _e('Hide on Checkout', "spoki") ?> |
| 600 |
</label> |
| 601 |
</th> |
| 602 |
<td> |
| 603 |
<input type="checkbox" id="fixed_support_button_hide_checkout_page" |
| 604 |
name="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_checkout_page]" |
| 605 |
value="1" <?php if (isset($this->options['buttons']['fixed_support_button_hide_checkout_page'])) echo checked(1, $this->options['buttons']['fixed_support_button_hide_checkout_page'], false) ?>> |
| 606 |
<label for="fixed_support_button_hide_checkout_page"><?php _e('Hide Floating Button on Checkout pages', "spoki") ?></label> |
| 607 |
</td> |
| 608 |
</tr> |
| 609 |
<tr> |
| 610 |
<th scope="row"> |
| 611 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][fixed_support_button_hide_on_page]"> |
| 612 |
<?php _e('Hide on Page', "spoki") ?> |
| 613 |
</label> |
| 614 |
</th> |
| 615 |
<td> |
| 616 |
<label><?php _e('Hide Floating Button in a specific page', "spoki") ?></label> |
| 617 |
<ul> |
| 618 |
<li>• <?php _e('Copy the following snippet', "spoki") ?>: <code id="hide-fab-snippet"></code> <a id="copy-hide-fab-snippet" href="#"><?php _e('copy', "spoki") ?></a></li> |
| 619 |
<li>• <?php _e('Paste the snippet in an HTML block in the page where you want to hide the button', "spoki") ?></li> |
| 620 |
<li>• <?php _e('Enjoy', "spoki") ?></li> |
| 621 |
</ul> |
| 622 |
<script> |
| 623 |
const snippet = '<style>#spoki-shadowed-fixed-button{display:none!important;}</style>'; |
| 624 |
document.getElementById('hide-fab-snippet').innerText = snippet; |
| 625 |
document.getElementById('copy-hide-fab-snippet').addEventListener('click', function (e) { |
| 626 |
e.preventDefault(); |
| 627 |
const textField = document.createElement('textarea'); |
| 628 |
textField.innerText = snippet; |
| 629 |
document.body.appendChild(textField); |
| 630 |
textField.select(); |
| 631 |
document.execCommand('copy'); |
| 632 |
textField.remove(); |
| 633 |
}); |
| 634 |
</script> |
| 635 |
</td> |
| 636 |
</tr> |
| 637 |
<?php endif; ?> |
| 638 |
</table> |
| 639 |
<?php submit_button(); ?> |
| 640 |
</div> |
| 641 |
|
| 642 |
<div <?php if ($current_section != 'product_item') echo "style='display:none'" ?> > |
| 643 |
<h2> |
| 644 |
<?php _e('Shop page', "spoki") ?> |
| 645 |
<a href="#TB_inline?&width=300&inlineId=buttons-info-dialog" class="thickbox button-info">ℹ</a> |
| 646 |
</h2> |
| 647 |
<p><?php _e('Add a WhatsApp button for every product in the WooCommerce Shop Page.', "spoki") ?></p> |
| 648 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/shop-page-button.png' ?>"/> |
| 649 |
|
| 650 |
<fieldset <?php if (false == $has_wc) : ?>disabled<?php endif ?>> |
| 651 |
<table class="form-table"> |
| 652 |
<tr> |
| 653 |
<th> |
| 654 |
<label for="product_item_listing_button_check"> |
| 655 |
<b><?php _e('Enable', "spoki") ?></b> |
| 656 |
</label> |
| 657 |
</th> |
| 658 |
<td> |
| 659 |
<input type="checkbox" id="product_item_listing_button_check" |
| 660 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_check]" |
| 661 |
value="1" <?php if (isset($this->options['woocommerce']['product_item_listing_button_check'])) echo checked(1, $this->options['woocommerce']['product_item_listing_button_check'], false) ?> |
| 662 |
/> |
| 663 |
<label for="product_item_listing_button_check"> |
| 664 |
<?php _e('Enable the button', "spoki") ?> |
| 665 |
</label> |
| 666 |
<p class="description"> |
| 667 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('If you enable the chat button, you make it visible in the product list', "spoki") ?> |
| 668 |
</p> |
| 669 |
</td> |
| 670 |
</tr> |
| 671 |
<tr> |
| 672 |
<th> |
| 673 |
<label for="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_cta]"> |
| 674 |
<b><?php _e('Button text (CTA)', "spoki") ?></b> |
| 675 |
</label> |
| 676 |
</th> |
| 677 |
<td> |
| 678 |
<input type="text" |
| 679 |
id="product_item_listing_button_cta" |
| 680 |
class="regular-text" |
| 681 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_cta]" |
| 682 |
value="<?php if (isset($this->options['woocommerce']['product_item_listing_button_cta'])) echo $this->options['woocommerce']['product_item_listing_button_cta'] ?>" |
| 683 |
placeholder="<?php _e("Request support on WhatsApp", "spoki") ?>" |
| 684 |
/> |
| 685 |
<p class="description"> |
| 686 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Enter the text visible on the button', "spoki") ?> |
| 687 |
</p> |
| 688 |
</td> |
| 689 |
</tr> |
| 690 |
<tr> |
| 691 |
<th> |
| 692 |
<label for="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_text]"> |
| 693 |
<b><?php _e('Customer Message', "spoki") ?></b> |
| 694 |
</label> |
| 695 |
</th> |
| 696 |
<td> |
| 697 |
<textarea class="regular-text" |
| 698 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_text]" |
| 699 |
id="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_text]" |
| 700 |
rows="5" |
| 701 |
placeholder="<?php _e('Hi, I want to buy:', "spoki") ?>"><?php if (isset($this->options['woocommerce']['product_item_listing_button_text'])) echo $this->options['woocommerce']['product_item_listing_button_text'] ?></textarea> |
| 702 |
<p class="description"> |
| 703 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Preset message in chat that the customer can send via a button to request product information', "spoki") ?> |
| 704 |
</p> |
| 705 |
</td> |
| 706 |
</tr> |
| 707 |
<tr> |
| 708 |
<th scope="row"> |
| 709 |
<label for="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_non_working_text_enabled]"> |
| 710 |
<?php _e('Customer Message on non-working days and times', "spoki") ?> |
| 711 |
</label> |
| 712 |
</th> |
| 713 |
<td> |
| 714 |
<label> |
| 715 |
<input id="product-item-listing-button-non-working-text-toggle" type="checkbox" name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_non_working_text_enabled]" |
| 716 |
value="1" <?php if (isset($this->options['woocommerce']['product_item_listing_button_non_working_text_enabled'])) echo checked(1, $this->options['woocommerce']['product_item_listing_button_non_working_text_enabled'], false) ?>> |
| 717 |
<?php _e('Enable alternative message on non-working days and times', "spoki") ?> |
| 718 |
</label> |
| 719 |
<br/> |
| 720 |
<textarea |
| 721 |
id="product-item-listing-button-non-working-text" |
| 722 |
class="regular-text" |
| 723 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_non_working_text]" |
| 724 |
cols="50" rows="5" |
| 725 |
placeholder="<?php _e('Hi, I would like to receive more information about your business', "spoki") ?>"><?php if (isset($this->options['woocommerce']['product_item_listing_button_non_working_text']) && $this->options['woocommerce']['product_item_listing_button_non_working_text'] !== '') echo $this->options['woocommerce']['product_item_listing_button_non_working_text'] ?></textarea> |
| 726 |
<p class="description"> |
| 727 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The customer will send you this message only the non-working days and times.<br/>Set the working days and times in the settings panel.', "spoki") ?> |
| 728 |
</p> |
| 729 |
<script> |
| 730 |
(function () { |
| 731 |
function toggleNonWorkingText(enable) { |
| 732 |
const el = document.getElementById('product-item-listing-button-non-working-text'); |
| 733 |
if (enable) { |
| 734 |
el.removeAttribute('disabled'); |
| 735 |
} else { |
| 736 |
el.setAttribute('disabled', true); |
| 737 |
} |
| 738 |
} |
| 739 |
|
| 740 |
const nonWorkingTextToggleEl = document.getElementById('product-item-listing-button-non-working-text-toggle'); |
| 741 |
toggleNonWorkingText(nonWorkingTextToggleEl.getAttribute('checked')) |
| 742 |
nonWorkingTextToggleEl.addEventListener('click', e => toggleNonWorkingText(e.target.checked)); |
| 743 |
})(); |
| 744 |
</script> |
| 745 |
</td> |
| 746 |
</tr> |
| 747 |
<tr> |
| 748 |
<th scope="row"> |
| 749 |
<label for="product_item_listing_button_color"> |
| 750 |
<?php _e('Color', "spoki") ?> |
| 751 |
</label> |
| 752 |
</th> |
| 753 |
<td> |
| 754 |
<input type="color" |
| 755 |
id="product_item_listing_button_color" |
| 756 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_color]" |
| 757 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_color']) && $this->options['woocommerce']['product_item_listing_button_color'] !== '') ? $this->options['woocommerce']['product_item_listing_button_color'] : '#23D366' ?>" |
| 758 |
> |
| 759 |
<p class="description"> |
| 760 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the background color of the button (Suggested: <i>#23D366</i> - <i>rgb(35, 211, 102)</i>)', "spoki") ?> |
| 761 |
</p> |
| 762 |
</td> |
| 763 |
</tr> |
| 764 |
<tr> |
| 765 |
<th> |
| 766 |
<label for="product_item_listing_button_border"> |
| 767 |
<b><?php _e('Border type', "spoki") ?></b> |
| 768 |
</label> |
| 769 |
</th> |
| 770 |
<td> |
| 771 |
<?php $product_item_listing_button_border = isset($this->options['woocommerce']['product_item_listing_button_border']) ? $this->options['woocommerce']['product_item_listing_button_border'] : 'rounded' ?> |
| 772 |
<select name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_border]" id="product_item_listing_button_border" class="regular-text"> |
| 773 |
<option value="rounded" <?php echo $product_item_listing_button_border == 'rounded' ? 'selected' : '' ?>><?php echo __('Rounded', "spoki") ?></option> |
| 774 |
<option value="squared" <?php echo $product_item_listing_button_border == 'squared' ? 'selected' : '' ?>><?php echo __('Squared', "spoki") ?></option> |
| 775 |
</select> |
| 776 |
</td> |
| 777 |
</tr> |
| 778 |
<tr> |
| 779 |
<th scope="row"> |
| 780 |
<label for="product_item_listing_button_font_size"> |
| 781 |
<?php _e('Font size', "spoki") ?> (px) |
| 782 |
</label> |
| 783 |
</th> |
| 784 |
<td> |
| 785 |
<label> |
| 786 |
<input type="number" id="product_item_listing_button_font_size" |
| 787 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_font_size]" |
| 788 |
placeholder="12" |
| 789 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_font_size']) && $this->options['woocommerce']['product_item_listing_button_font_size'] !== '') ? $this->options['woocommerce']['product_item_listing_button_font_size'] : '12' ?>"> |
| 790 |
</label> |
| 791 |
</td> |
| 792 |
</tr> |
| 793 |
<tr> |
| 794 |
<th scope="row"> |
| 795 |
<label> |
| 796 |
<?php _e('Margin', "spoki") ?> (px) |
| 797 |
</label> |
| 798 |
</th> |
| 799 |
<td> |
| 800 |
<div class="spacing-items"> |
| 801 |
<label> |
| 802 |
<?php _e('Top', "spoki") ?> |
| 803 |
<input type="number" id="product_item_listing_button_margin_top" |
| 804 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_margin_top]" |
| 805 |
placeholder="4" |
| 806 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_margin_top']) && $this->options['woocommerce']['product_item_listing_button_margin_top'] !== '') ? $this->options['woocommerce']['product_item_listing_button_margin_top'] : '4' ?>"> |
| 807 |
</label> |
| 808 |
<label> |
| 809 |
<?php _e('Bottom', "spoki") ?> |
| 810 |
<input type="number" id="product_item_listing_button_margin_bottom" |
| 811 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_margin_bottom]" |
| 812 |
placeholder="4" |
| 813 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_margin_bottom']) && $this->options['woocommerce']['product_item_listing_button_margin_bottom'] !== '') ? $this->options['woocommerce']['product_item_listing_button_margin_bottom'] : '4' ?>"> |
| 814 |
</label> |
| 815 |
<label> |
| 816 |
<?php _e('Left', "spoki") ?> |
| 817 |
<input type="number" id="product_item_listing_button_margin_left" |
| 818 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_margin_left]" |
| 819 |
placeholder="0" |
| 820 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_margin_left']) && $this->options['woocommerce']['product_item_listing_button_margin_left'] !== '') ? $this->options['woocommerce']['product_item_listing_button_margin_left'] : '0' ?>"> |
| 821 |
</label> |
| 822 |
<label> |
| 823 |
<?php _e('Right', "spoki") ?> |
| 824 |
<input type="number" id="product_item_listing_button_margin_right" |
| 825 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_margin_right]" |
| 826 |
placeholder="0" |
| 827 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_margin_right']) && $this->options['woocommerce']['product_item_listing_button_margin_right'] !== '') ? $this->options['woocommerce']['product_item_listing_button_margin_right'] : '0' ?>"> |
| 828 |
</label> |
| 829 |
</div> |
| 830 |
</td> |
| 831 |
</tr> |
| 832 |
<tr> |
| 833 |
<th scope="row"> |
| 834 |
<label> |
| 835 |
<?php _e('Padding', "spoki") ?> (px) |
| 836 |
</label> |
| 837 |
</th> |
| 838 |
<td> |
| 839 |
<div class="spacing-items"> |
| 840 |
<label> |
| 841 |
<?php _e('Top', "spoki") ?> |
| 842 |
<input type="number" id="product_item_listing_button_padding_top" |
| 843 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_padding_top]" |
| 844 |
placeholder="8" |
| 845 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_padding_top']) && $this->options['woocommerce']['product_item_listing_button_padding_top'] !== '') ? $this->options['woocommerce']['product_item_listing_button_padding_top'] : '8' ?>"> |
| 846 |
</label> |
| 847 |
<label> |
| 848 |
<?php _e('Right', "spoki") ?> |
| 849 |
<input type="number" id="product_item_listing_button_padding_right" |
| 850 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_padding_right]" |
| 851 |
placeholder="14" |
| 852 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_padding_right']) && $this->options['woocommerce']['product_item_listing_button_padding_right'] !== '') ? $this->options['woocommerce']['product_item_listing_button_padding_right'] : '14' ?>"> |
| 853 |
</label> |
| 854 |
<label> |
| 855 |
<?php _e('Bottom', "spoki") ?> |
| 856 |
<input type="number" id="product_item_listing_button_padding_bottom" |
| 857 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_padding_bottom]" |
| 858 |
placeholder="8" |
| 859 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_padding_bottom']) && $this->options['woocommerce']['product_item_listing_button_padding_bottom'] !== '') ? $this->options['woocommerce']['product_item_listing_button_padding_bottom'] : '8' ?>"> |
| 860 |
</label> |
| 861 |
<label> |
| 862 |
<?php _e('Left', "spoki") ?> |
| 863 |
<input type="number" id="product_item_listing_button_padding_left" |
| 864 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_padding_left]" |
| 865 |
placeholder="14" |
| 866 |
value="<?php echo (isset($this->options['woocommerce']['product_item_listing_button_padding_left']) && $this->options['woocommerce']['product_item_listing_button_padding_left'] !== '') ? $this->options['woocommerce']['product_item_listing_button_padding_left'] : '14' ?>"> |
| 867 |
</label> |
| 868 |
</div> |
| 869 |
</td> |
| 870 |
</tr> |
| 871 |
<tr> |
| 872 |
<th scope="row"> |
| 873 |
<label><?php _e('Hide on non-working days and times', "spoki") ?></label> |
| 874 |
</th> |
| 875 |
<td> |
| 876 |
<input type="checkbox" id="product_item_listing_button_hide_non_working" |
| 877 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][product_item_listing_button_hide_non_working]" |
| 878 |
value="1" <?php if (isset($this->options['woocommerce']['product_item_listing_button_hide_non_working'])) echo checked(1, $this->options['woocommerce']['product_item_listing_button_hide_non_working'], false) ?>> |
| 879 |
|
| 880 |
<label for="product_item_listing_button_hide_non_working"><?php _e('Hide the button on non-working days and times', "spoki") ?></label> |
| 881 |
<p class="description"> |
| 882 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the working days and times in the settings panel', "spoki") ?> |
| 883 |
</p> |
| 884 |
</td> |
| 885 |
</tr> |
| 886 |
</table> |
| 887 |
</fieldset> |
| 888 |
</div> |
| 889 |
|
| 890 |
<div <?php if ($current_section != 'single_product') echo "style='display:none'" ?>> |
| 891 |
<h2> |
| 892 |
<?php _e('Product page', "spoki") ?> |
| 893 |
<a href="#TB_inline?&width=300&inlineId=buttons-info-dialog" class="thickbox button-info">ℹ</a> |
| 894 |
</h2> |
| 895 |
<p><?php _e('Add the WhatsApp button on the WooCommerce Product Detail Page.', "spoki") ?></p> |
| 896 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/product-page-button.png' ?>"/> |
| 897 |
|
| 898 |
<fieldset <?php if (false == $has_wc) : ?>disabled<?php endif ?>> |
| 899 |
<table class="form-table"> |
| 900 |
<tr> |
| 901 |
<th> |
| 902 |
<label for="single_product_button_check"> |
| 903 |
<b><?php _e('Enable', "spoki") ?></b> |
| 904 |
</label> |
| 905 |
</th> |
| 906 |
<td> |
| 907 |
<input type="checkbox" id="single_product_button_check" |
| 908 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_check]" |
| 909 |
value="1" <?php if (isset($this->options['woocommerce']['single_product_button_check'])) echo checked(1, $this->options['woocommerce']['single_product_button_check'], false) ?> |
| 910 |
/> |
| 911 |
<label for="single_product_button_check"> |
| 912 |
<?php _e('Enable the button', "spoki") ?> |
| 913 |
</label> |
| 914 |
<p class="description"> |
| 915 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('If you enable the chat button you make it visible in the product detail', "spoki") ?> |
| 916 |
</p> |
| 917 |
</td> |
| 918 |
</tr> |
| 919 |
<tr> |
| 920 |
<th> |
| 921 |
<label for="single_product_button_position"> |
| 922 |
<b><?php _e('Button position', "spoki") ?></b> |
| 923 |
</label> |
| 924 |
</th> |
| 925 |
<td> |
| 926 |
<?php $single_product_button_position = isset($this->options['woocommerce']['single_product_button_position']) ? $this->options['woocommerce']['single_product_button_position'] : 'after_atc' ?> |
| 927 |
<select name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_position]" id="single_product_button_position" class="regular-text"> |
| 928 |
<option value="after_atc" <?php echo $single_product_button_position == 'after_atc' ? 'selected' : '' ?>><?php echo __('After Add to Cart Button', "spoki") ?></option> |
| 929 |
<option value="after_shortdesc" <?php echo $single_product_button_position == 'after_shortdesc' ? 'selected' : '' ?>><?php echo __('After Short Description', "spoki") ?></option> |
| 930 |
</select> |
| 931 |
<p class="description"> |
| 932 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Choose where to insert the chat button', "spoki"); ?> |
| 933 |
</p> |
| 934 |
</td> |
| 935 |
</tr> |
| 936 |
<tr> |
| 937 |
<th> |
| 938 |
<label for="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_cta]"> |
| 939 |
<b><?php _e('Button text (CTA)', "spoki") ?></b> |
| 940 |
</label> |
| 941 |
</th> |
| 942 |
<td> |
| 943 |
<input type="text" |
| 944 |
id="single_product_button_cta" |
| 945 |
class="regular-text" |
| 946 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_cta]" |
| 947 |
value="<?php if (isset($this->options['woocommerce']['single_product_button_cta'])) echo $this->options['woocommerce']['single_product_button_cta'] ?>" |
| 948 |
placeholder="<?php _e("Request support on WhatsApp", "spoki") ?>" |
| 949 |
/> |
| 950 |
<p class="description"> |
| 951 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Enter the text visible on the button', "spoki") ?> |
| 952 |
</p> |
| 953 |
</td> |
| 954 |
</tr> |
| 955 |
<tr> |
| 956 |
<th> |
| 957 |
<label for="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_text]"> |
| 958 |
<b><?php _e('Customer Message', "spoki") ?></b> |
| 959 |
</label> |
| 960 |
</th> |
| 961 |
<td> |
| 962 |
<textarea class="regular-text" |
| 963 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_text]" |
| 964 |
id="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_text]" |
| 965 |
rows="5" |
| 966 |
placeholder="<?php _e('Hi, I want to buy:', "spoki") ?>" |
| 967 |
><?php if (isset($this->options['woocommerce']['single_product_button_text'])) echo $this->options['woocommerce']['single_product_button_text'] ?></textarea> |
| 968 |
<p class="description"> |
| 969 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The customer will send you the following message via WhatsApp whenever press on this button', "spoki") ?> |
| 970 |
</p> |
| 971 |
</td> |
| 972 |
</tr> |
| 973 |
<tr> |
| 974 |
<th scope="row"> |
| 975 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][single_product_button_text]"> |
| 976 |
<?php _e('Customer Message on non-working days and times', "spoki") ?> |
| 977 |
</label> |
| 978 |
</th> |
| 979 |
<td> |
| 980 |
<label> |
| 981 |
<input id="single-product-button-non-working-text-toggle" type="checkbox" name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_non_working_text_enabled]" |
| 982 |
value="1" <?php if (isset($this->options['woocommerce']['single_product_button_non_working_text_enabled'])) echo checked(1, $this->options['woocommerce']['single_product_button_non_working_text_enabled'], false) ?>> |
| 983 |
<?php _e('Enable alternative message on non-working days and times', "spoki") ?> |
| 984 |
</label> |
| 985 |
<br/> |
| 986 |
<textarea |
| 987 |
id="single-product-button-non-working-text" |
| 988 |
class="regular-text" |
| 989 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_non_working_text]" |
| 990 |
cols="50" rows="5" |
| 991 |
placeholder="<?php _e('Hi, I would like to receive more information about your business', "spoki") ?>"><?php if (isset($this->options['woocommerce']['single_product_button_non_working_text']) && $this->options['woocommerce']['single_product_button_non_working_text'] !== '') echo $this->options['woocommerce']['single_product_button_non_working_text'] ?></textarea> |
| 992 |
<p class="description"> |
| 993 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The customer will send you this message only the non-working days and times.<br/>Set the working days and times in the settings panel.', "spoki") ?> |
| 994 |
</p> |
| 995 |
<script> |
| 996 |
(function () { |
| 997 |
function toggleNonWorkingText(enable) { |
| 998 |
const el = document.getElementById('single-product-button-non-working-text'); |
| 999 |
if (enable) { |
| 1000 |
el.removeAttribute('disabled'); |
| 1001 |
} else { |
| 1002 |
el.setAttribute('disabled', true); |
| 1003 |
} |
| 1004 |
} |
| 1005 |
|
| 1006 |
const nonWorkingTextToggleEl = document.getElementById('single-product-button-non-working-text-toggle'); |
| 1007 |
toggleNonWorkingText(nonWorkingTextToggleEl.getAttribute('checked')) |
| 1008 |
nonWorkingTextToggleEl.addEventListener('click', e => toggleNonWorkingText(e.target.checked)); |
| 1009 |
})(); |
| 1010 |
</script> |
| 1011 |
</td> |
| 1012 |
</tr> |
| 1013 |
<tr> |
| 1014 |
<th scope="row"> |
| 1015 |
<label for="single_product_button_color"> |
| 1016 |
<?php _e('Color', "spoki") ?> |
| 1017 |
</label> |
| 1018 |
</th> |
| 1019 |
<td> |
| 1020 |
<input type="color" |
| 1021 |
id="single_product_button_color" |
| 1022 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_color]" |
| 1023 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_color']) && $this->options['woocommerce']['single_product_button_color'] !== '') ? $this->options['woocommerce']['single_product_button_color'] : '#23D366' ?>" |
| 1024 |
> |
| 1025 |
<p class="description"> |
| 1026 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the background color of the button (Suggested: <i>#23D366</i> - <i>rgb(35, 211, 102)</i>)', "spoki") ?> |
| 1027 |
</p> |
| 1028 |
</td> |
| 1029 |
</tr> |
| 1030 |
<tr> |
| 1031 |
<th> |
| 1032 |
<label for="single_product_button_border"> |
| 1033 |
<b><?php _e('Border type', "spoki") ?></b> |
| 1034 |
</label> |
| 1035 |
</th> |
| 1036 |
<td> |
| 1037 |
<?php $single_product_button_border = isset($this->options['woocommerce']['single_product_button_border']) ? $this->options['woocommerce']['single_product_button_border'] : 'rounded' ?> |
| 1038 |
<select name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_border]" id="single_product_button_border" class="regular-text"> |
| 1039 |
<option value="rounded" <?php echo $single_product_button_border == 'rounded' ? 'selected' : '' ?>><?php echo __('Rounded', "spoki") ?></option> |
| 1040 |
<option value="squared" <?php echo $single_product_button_border == 'squared' ? 'selected' : '' ?>><?php echo __('Squared', "spoki") ?></option> |
| 1041 |
</select> |
| 1042 |
</td> |
| 1043 |
</tr> |
| 1044 |
<tr> |
| 1045 |
<th scope="row"> |
| 1046 |
<label for="single_product_button_font_size"> |
| 1047 |
<?php _e('Font size', "spoki") ?> (px) |
| 1048 |
</label> |
| 1049 |
</th> |
| 1050 |
<td> |
| 1051 |
<label> |
| 1052 |
<input type="number" id="single_product_button_font_size" |
| 1053 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_font_size]" |
| 1054 |
placeholder="12" |
| 1055 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_font_size']) && $this->options['woocommerce']['single_product_button_font_size'] !== '') ? $this->options['woocommerce']['single_product_button_font_size'] : '12' ?>"> |
| 1056 |
</label> |
| 1057 |
</td> |
| 1058 |
</tr> |
| 1059 |
<tr> |
| 1060 |
<th scope="row"> |
| 1061 |
<label> |
| 1062 |
<?php _e('Margin', "spoki") ?> (px) |
| 1063 |
</label> |
| 1064 |
</th> |
| 1065 |
<td> |
| 1066 |
<div class="spacing-items"> |
| 1067 |
<label> |
| 1068 |
<?php _e('Top', "spoki") ?> |
| 1069 |
<input type="number" id="single_product_button_margin_top" |
| 1070 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_margin_top]" |
| 1071 |
placeholder="4" |
| 1072 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_margin_top']) && $this->options['woocommerce']['single_product_button_margin_top'] !== '') ? $this->options['woocommerce']['single_product_button_margin_top'] : '4' ?>"> |
| 1073 |
</label> |
| 1074 |
<label> |
| 1075 |
<?php _e('Right', "spoki") ?> |
| 1076 |
<input type="number" id="single_product_button_margin_right" |
| 1077 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_margin_right]" |
| 1078 |
placeholder="0" |
| 1079 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_margin_right']) && $this->options['woocommerce']['single_product_button_margin_right'] !== '') ? $this->options['woocommerce']['single_product_button_margin_right'] : '0' ?>"> |
| 1080 |
</label> |
| 1081 |
<label> |
| 1082 |
<?php _e('Bottom', "spoki") ?> |
| 1083 |
<input type="number" id="single_product_button_margin_bottom" |
| 1084 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_margin_bottom]" |
| 1085 |
placeholder="4" |
| 1086 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_margin_bottom']) && $this->options['woocommerce']['single_product_button_margin_bottom'] !== '') ? $this->options['woocommerce']['single_product_button_margin_bottom'] : '4' ?>"> |
| 1087 |
</label> |
| 1088 |
<label> |
| 1089 |
<?php _e('Left', "spoki") ?> |
| 1090 |
<input type="number" id="single_product_button_margin_left" |
| 1091 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_margin_left]" |
| 1092 |
placeholder="0" |
| 1093 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_margin_left']) && $this->options['woocommerce']['single_product_button_margin_left'] !== '') ? $this->options['woocommerce']['single_product_button_margin_left'] : '0' ?>"> |
| 1094 |
</label> |
| 1095 |
</div> |
| 1096 |
</td> |
| 1097 |
</tr> |
| 1098 |
<tr> |
| 1099 |
<th scope="row"> |
| 1100 |
<label> |
| 1101 |
<?php _e('Padding', "spoki") ?> (px) |
| 1102 |
</label> |
| 1103 |
</th> |
| 1104 |
<td> |
| 1105 |
<div class="spacing-items"> |
| 1106 |
<label> |
| 1107 |
<?php _e('Top', "spoki") ?> |
| 1108 |
<input type="number" id="single_product_button_padding_top" |
| 1109 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_padding_top]" |
| 1110 |
placeholder="8" |
| 1111 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_padding_top']) && $this->options['woocommerce']['single_product_button_padding_top'] !== '') ? $this->options['woocommerce']['single_product_button_padding_top'] : '8' ?>"> |
| 1112 |
</label> |
| 1113 |
<label> |
| 1114 |
<?php _e('Right', "spoki") ?> |
| 1115 |
<input type="number" id="single_product_button_padding_right" |
| 1116 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_padding_right]" |
| 1117 |
placeholder="14" |
| 1118 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_padding_right']) && $this->options['woocommerce']['single_product_button_padding_right'] !== '') ? $this->options['woocommerce']['single_product_button_padding_right'] : '14' ?>"> |
| 1119 |
</label> |
| 1120 |
<label> |
| 1121 |
<?php _e('Bottom', "spoki") ?> |
| 1122 |
<input type="number" id="single_product_button_padding_bottom" |
| 1123 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_padding_bottom]" |
| 1124 |
placeholder="8" |
| 1125 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_padding_bottom']) && $this->options['woocommerce']['single_product_button_padding_bottom'] !== '') ? $this->options['woocommerce']['single_product_button_padding_bottom'] : '8' ?>"> |
| 1126 |
</label> |
| 1127 |
<label> |
| 1128 |
<?php _e('Left', "spoki") ?> |
| 1129 |
<input type="number" id="single_product_button_padding_left" |
| 1130 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_padding_left]" |
| 1131 |
placeholder="14" |
| 1132 |
value="<?php echo (isset($this->options['woocommerce']['single_product_button_padding_left']) && $this->options['woocommerce']['single_product_button_padding_left'] !== '') ? $this->options['woocommerce']['single_product_button_padding_left'] : '14' ?>"> |
| 1133 |
</label> |
| 1134 |
</div> |
| 1135 |
</td> |
| 1136 |
</tr> |
| 1137 |
<tr> |
| 1138 |
<th scope="row"> |
| 1139 |
<label><?php _e('Hide on non-working days and times', "spoki") ?></label> |
| 1140 |
</th> |
| 1141 |
<td> |
| 1142 |
<input type="checkbox" id="single_product_button_hide_non_working" |
| 1143 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][single_product_button_hide_non_working]" |
| 1144 |
value="1" <?php if (isset($this->options['woocommerce']['single_product_button_hide_non_working'])) echo checked(1, $this->options['woocommerce']['single_product_button_hide_non_working'], false) ?>> |
| 1145 |
|
| 1146 |
<label for="single_product_button_hide_non_working"><?php _e('Hide the button on non-working days and times', "spoki") ?></label> |
| 1147 |
<p class="description"> |
| 1148 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the working days and times in the settings panel', "spoki") ?> |
| 1149 |
</p> |
| 1150 |
</td> |
| 1151 |
</tr> |
| 1152 |
</table> |
| 1153 |
</fieldset> |
| 1154 |
</div> |
| 1155 |
|
| 1156 |
<div <?php if ($current_section != 'cart') echo "style='display:none'" ?> > |
| 1157 |
<h2> |
| 1158 |
<?php _e('Cart page', "spoki") ?> |
| 1159 |
<a href="#TB_inline?&width=300&inlineId=buttons-info-dialog" class="thickbox button-info">ℹ</a> |
| 1160 |
</h2> |
| 1161 |
<p><?php _e('Add a WhatsApp button in the WooCommerce Cart Page.', "spoki") ?></p> |
| 1162 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/cart-page-button.png' ?>"/> |
| 1163 |
|
| 1164 |
<fieldset <?php if (false == $has_wc) : ?>disabled<?php endif ?>> |
| 1165 |
<table class="form-table"> |
| 1166 |
<tr> |
| 1167 |
<th> |
| 1168 |
<label for="cart_button_check"> |
| 1169 |
<b><?php _e('Enable', "spoki") ?></b> |
| 1170 |
</label> |
| 1171 |
</th> |
| 1172 |
<td> |
| 1173 |
<input type="checkbox" id="cart_button_check" |
| 1174 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_check]" |
| 1175 |
value="1" <?php if (isset($this->options['woocommerce']['cart_button_check'])) echo checked(1, $this->options['woocommerce']['cart_button_check'], false) ?> |
| 1176 |
/> |
| 1177 |
<label for="cart_button_check"> |
| 1178 |
<?php _e('Enable the button', "spoki") ?> |
| 1179 |
</label> |
| 1180 |
<p class="description"> |
| 1181 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('If you enable the chat button you make it visible in the cart page', "spoki") ?> |
| 1182 |
</p> |
| 1183 |
</td> |
| 1184 |
</tr> |
| 1185 |
<tr> |
| 1186 |
<th> |
| 1187 |
<label for="cart_button_hide_checkout_button_check"> |
| 1188 |
<b><?php _e('Hide "Proceed to Checkout" button', "spoki") ?></b> |
| 1189 |
</label> |
| 1190 |
</th> |
| 1191 |
<td> |
| 1192 |
<input type="checkbox" id="cart_button_hide_checkout_button_check" |
| 1193 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_hide_checkout_button_check]" |
| 1194 |
value="1" <?php if (isset($this->options['woocommerce']['cart_button_hide_checkout_button_check'])) echo checked(1, $this->options['woocommerce']['cart_button_hide_checkout_button_check'], false) ?> |
| 1195 |
/> |
| 1196 |
<label for="cart_button_hide_checkout_button_check"> |
| 1197 |
<?php _e('Hide "Proceed to Checkout" button and show the WhatsApp button only in the cart page', "spoki") ?> |
| 1198 |
</label> |
| 1199 |
</td> |
| 1200 |
</tr> |
| 1201 |
<tr> |
| 1202 |
<th> |
| 1203 |
<label for="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_cta]"> |
| 1204 |
<b><?php _e('Button text (CTA)', "spoki") ?></b> |
| 1205 |
</label> |
| 1206 |
</th> |
| 1207 |
<td> |
| 1208 |
<input type="text" |
| 1209 |
id="cart_button_cta" |
| 1210 |
class="regular-text" |
| 1211 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_cta]" |
| 1212 |
value="<?php if (isset($this->options['woocommerce']['cart_button_cta'])) echo $this->options['woocommerce']['cart_button_cta'] ?>" |
| 1213 |
placeholder="<?php _e("Order via WhatsApp", "spoki") ?>" |
| 1214 |
/> |
| 1215 |
<p class="description"> |
| 1216 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Enter the text visible on the button', "spoki") ?> |
| 1217 |
</p> |
| 1218 |
</td> |
| 1219 |
</tr> |
| 1220 |
<tr> |
| 1221 |
<th> |
| 1222 |
<label for="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_text]"> |
| 1223 |
<b><?php _e('Customer Message', "spoki") ?></b> |
| 1224 |
</label> |
| 1225 |
</th> |
| 1226 |
<td> |
| 1227 |
<textarea class="regular-text" |
| 1228 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_text]" |
| 1229 |
id="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_text]" |
| 1230 |
rows="5" |
| 1231 |
placeholder="<?php _e('Hi, I want to buy:', "spoki") ?>"><?php if (isset($this->options['woocommerce']['cart_button_text'])) echo $this->options['woocommerce']['cart_button_text'] ?></textarea> |
| 1232 |
<p class="description"> |
| 1233 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The customer will send you the following message via WhatsApp whenever press on this button', "spoki") ?> |
| 1234 |
</p> |
| 1235 |
</td> |
| 1236 |
</tr> |
| 1237 |
<tr> |
| 1238 |
<th scope="row"> |
| 1239 |
<label for="<?php echo SPOKI_OPTIONS ?>[buttons][cart_button_text]"> |
| 1240 |
<?php _e('Customer Message on non-working days and times', "spoki") ?> |
| 1241 |
</label> |
| 1242 |
</th> |
| 1243 |
<td> |
| 1244 |
<label> |
| 1245 |
<input id="cart-button-non-working-text-toggle" type="checkbox" name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_non_working_text_enabled]" |
| 1246 |
value="1" <?php if (isset($this->options['woocommerce']['cart_button_non_working_text_enabled'])) echo checked(1, $this->options['woocommerce']['cart_button_non_working_text_enabled'], false) ?>> |
| 1247 |
<?php _e('Enable alternative message on non-working days and times', "spoki") ?> |
| 1248 |
</label> |
| 1249 |
<br/> |
| 1250 |
<textarea |
| 1251 |
id="cart-button-non-working-text" |
| 1252 |
class="regular-text" |
| 1253 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_non_working_text]" |
| 1254 |
cols="50" rows="5" |
| 1255 |
placeholder="<?php _e('Hi, I would like to receive more information about your business', "spoki") ?>"><?php if (isset($this->options['woocommerce']['cart_button_non_working_text']) && $this->options['woocommerce']['cart_button_non_working_text'] !== '') echo $this->options['woocommerce']['cart_button_non_working_text'] ?></textarea> |
| 1256 |
<p class="description"> |
| 1257 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('The customer will send you this message only the non-working days and times.<br/>Set the working days and times in the settings panel.', "spoki") ?> |
| 1258 |
</p> |
| 1259 |
<script> |
| 1260 |
(function () { |
| 1261 |
function toggleNonWorkingText(enable) { |
| 1262 |
const el = document.getElementById('cart-button-non-working-text'); |
| 1263 |
if (enable) { |
| 1264 |
el.removeAttribute('disabled'); |
| 1265 |
} else { |
| 1266 |
el.setAttribute('disabled', true); |
| 1267 |
} |
| 1268 |
} |
| 1269 |
|
| 1270 |
const nonWorkingTextToggleEl = document.getElementById('cart-button-non-working-text-toggle'); |
| 1271 |
toggleNonWorkingText(nonWorkingTextToggleEl.getAttribute('checked')) |
| 1272 |
nonWorkingTextToggleEl.addEventListener('click', e => toggleNonWorkingText(e.target.checked)); |
| 1273 |
})(); |
| 1274 |
</script> |
| 1275 |
</td> |
| 1276 |
</tr> |
| 1277 |
<tr> |
| 1278 |
<th scope="row"> |
| 1279 |
<label for="cart_button_color"> |
| 1280 |
<?php _e('Color', "spoki") ?> |
| 1281 |
</label> |
| 1282 |
</th> |
| 1283 |
<td> |
| 1284 |
<input type="color" |
| 1285 |
id="cart_button_color" |
| 1286 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_color]" |
| 1287 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_color']) && $this->options['woocommerce']['cart_button_color'] !== '') ? $this->options['woocommerce']['cart_button_color'] : '#23D366' ?>" |
| 1288 |
> |
| 1289 |
<p class="description"> |
| 1290 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the background color of the button (Suggested: <i>#23D366</i> - <i>rgb(35, 211, 102)</i>)', "spoki") ?> |
| 1291 |
</p> |
| 1292 |
</td> |
| 1293 |
</tr> |
| 1294 |
<tr> |
| 1295 |
<th> |
| 1296 |
<label for="cart_button_border"> |
| 1297 |
<b><?php _e('Border type', "spoki") ?></b> |
| 1298 |
</label> |
| 1299 |
</th> |
| 1300 |
<td> |
| 1301 |
<?php $cart_button_border = isset($this->options['woocommerce']['cart_button_border']) ? $this->options['woocommerce']['cart_button_border'] : 'rounded' ?> |
| 1302 |
<select name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_border]" id="cart_button_border" class="regular-text"> |
| 1303 |
<option value="rounded" <?php echo $cart_button_border == 'rounded' ? 'selected' : '' ?>><?php echo __('Rounded', "spoki") ?></option> |
| 1304 |
<option value="squared" <?php echo $cart_button_border == 'squared' ? 'selected' : '' ?>><?php echo __('Squared', "spoki") ?></option> |
| 1305 |
</select> |
| 1306 |
</td> |
| 1307 |
</tr> |
| 1308 |
<tr> |
| 1309 |
<th scope="row"> |
| 1310 |
<label for="cart_button_font_size"> |
| 1311 |
<?php _e('Font size', "spoki") ?> (px) |
| 1312 |
</label> |
| 1313 |
</th> |
| 1314 |
<td> |
| 1315 |
<label> |
| 1316 |
<input type="number" id="cart_button_font_size" |
| 1317 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_font_size]" |
| 1318 |
placeholder="12" |
| 1319 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_font_size']) && $this->options['woocommerce']['cart_button_font_size'] !== '') ? $this->options['woocommerce']['cart_button_font_size'] : '12' ?>"> |
| 1320 |
</label> |
| 1321 |
</td> |
| 1322 |
</tr> |
| 1323 |
<tr> |
| 1324 |
<th scope="row"> |
| 1325 |
<label> |
| 1326 |
<?php _e('Margin', "spoki") ?> (px) |
| 1327 |
</label> |
| 1328 |
</th> |
| 1329 |
<td> |
| 1330 |
<div class="spacing-items"> |
| 1331 |
<label> |
| 1332 |
<?php _e('Top', "spoki") ?> |
| 1333 |
<input type="number" id="cart_button_margin_top" |
| 1334 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_margin_top]" |
| 1335 |
placeholder="4" |
| 1336 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_margin_top']) && $this->options['woocommerce']['cart_button_margin_top'] !== '') ? $this->options['woocommerce']['cart_button_margin_top'] : '4' ?>"> |
| 1337 |
</label> |
| 1338 |
<label> |
| 1339 |
<?php _e('Right', "spoki") ?> |
| 1340 |
<input type="number" id="cart_button_margin_right" |
| 1341 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_margin_right]" |
| 1342 |
placeholder="0" |
| 1343 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_margin_right']) && $this->options['woocommerce']['cart_button_margin_right'] !== '') ? $this->options['woocommerce']['cart_button_margin_right'] : '0' ?>"> |
| 1344 |
</label> |
| 1345 |
<label> |
| 1346 |
<?php _e('Bottom', "spoki") ?> |
| 1347 |
<input type="number" id="cart_button_margin_bottom" |
| 1348 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_margin_bottom]" |
| 1349 |
placeholder="4" |
| 1350 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_margin_bottom']) && $this->options['woocommerce']['cart_button_margin_bottom'] !== '') ? $this->options['woocommerce']['cart_button_margin_bottom'] : '4' ?>"> |
| 1351 |
</label> |
| 1352 |
<label> |
| 1353 |
<?php _e('Left', "spoki") ?> |
| 1354 |
<input type="number" id="cart_button_margin_left" |
| 1355 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_margin_left]" |
| 1356 |
placeholder="0" |
| 1357 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_margin_left']) && $this->options['woocommerce']['cart_button_margin_left'] !== '') ? $this->options['woocommerce']['cart_button_margin_left'] : '0' ?>"> |
| 1358 |
</label> |
| 1359 |
</div> |
| 1360 |
</td> |
| 1361 |
</tr> |
| 1362 |
<tr> |
| 1363 |
<th scope="row"> |
| 1364 |
<label> |
| 1365 |
<?php _e('Padding', "spoki") ?> (px) |
| 1366 |
</label> |
| 1367 |
</th> |
| 1368 |
<td> |
| 1369 |
<div class="spacing-items"> |
| 1370 |
<label> |
| 1371 |
<?php _e('Top', "spoki") ?> |
| 1372 |
<input type="number" id="cart_button_padding_top" |
| 1373 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_padding_top]" |
| 1374 |
placeholder="8" |
| 1375 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_padding_top']) && $this->options['woocommerce']['cart_button_padding_top'] !== '') ? $this->options['woocommerce']['cart_button_padding_top'] : '8' ?>"> |
| 1376 |
</label> |
| 1377 |
<label> |
| 1378 |
<?php _e('Right', "spoki") ?> |
| 1379 |
<input type="number" id="cart_button_padding_right" |
| 1380 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_padding_right]" |
| 1381 |
placeholder="14" |
| 1382 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_padding_right']) && $this->options['woocommerce']['cart_button_padding_right'] !== '') ? $this->options['woocommerce']['cart_button_padding_right'] : '14' ?>"> |
| 1383 |
</label> |
| 1384 |
<label> |
| 1385 |
<?php _e('Bottom', "spoki") ?> |
| 1386 |
<input type="number" id="cart_button_padding_bottom" |
| 1387 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_padding_bottom]" |
| 1388 |
placeholder="8" |
| 1389 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_padding_bottom']) && $this->options['woocommerce']['cart_button_padding_bottom'] !== '') ? $this->options['woocommerce']['cart_button_padding_bottom'] : '8' ?>"> |
| 1390 |
</label> |
| 1391 |
<label> |
| 1392 |
<?php _e('Left', "spoki") ?> |
| 1393 |
<input type="number" id="cart_button_padding_left" |
| 1394 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_padding_left]" |
| 1395 |
placeholder="14" |
| 1396 |
value="<?php echo (isset($this->options['woocommerce']['cart_button_padding_left']) && $this->options['woocommerce']['cart_button_padding_left'] !== '') ? $this->options['woocommerce']['cart_button_padding_left'] : '14' ?>"> |
| 1397 |
</label> |
| 1398 |
</div> |
| 1399 |
</td> |
| 1400 |
</tr> |
| 1401 |
<tr> |
| 1402 |
<th scope="row"> |
| 1403 |
<label><?php _e('Hide on non-working days and times', "spoki") ?></label> |
| 1404 |
</th> |
| 1405 |
<td> |
| 1406 |
<input type="checkbox" id="cart_button_hide_non_working" |
| 1407 |
name="<?php echo SPOKI_OPTIONS ?>[woocommerce][cart_button_hide_non_working]" |
| 1408 |
value="1" <?php if (isset($this->options['woocommerce']['cart_button_hide_non_working'])) echo checked(1, $this->options['woocommerce']['cart_button_hide_non_working'], false) ?>> |
| 1409 |
|
| 1410 |
<label for="cart_button_hide_non_working"><?php _e('Hide the button on non-working days and times', "spoki") ?></label> |
| 1411 |
<p class="description"> |
| 1412 |
<b><?php _e("Note", "spoki") ?></b>: <?php _e('Set the working days and times in the settings panel', "spoki") ?> |
| 1413 |
</p> |
| 1414 |
</td> |
| 1415 |
</tr> |
| 1416 |
</table> |
| 1417 |
</fieldset> |
| 1418 |
</div> |
| 1419 |
|
| 1420 |
<div <?php if ($current_section != 'other_buttons') echo "style='display:none'" ?> > |
| 1421 |
<h2> |
| 1422 |
<?php _e('Shortcode Button', "spoki") ?> |
| 1423 |
<a href="#TB_inline?&width=300&inlineId=buttons-info-dialog" class="thickbox button-info">ℹ</a> |
| 1424 |
</h2> |
| 1425 |
<p><?php _e('Put WhatsApp Buttons anywhere using the shortcode.', "spoki") ?></p> |
| 1426 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/spoki-buttons.png' ?>"/> |
| 1427 |
<h4><?php _e('How to use shortcodes', "spoki") ?></h4> |
| 1428 |
<p> |
| 1429 |
<?php _e('Shortcodes can be used on pages and posts in WordPress.', "spoki") ?> |
| 1430 |
</p> |
| 1431 |
<ul> |
| 1432 |
<li>• <?php _e('If you are using the block editor, there is a shortcode block you can use to <b>paste the shortcode</b> in.', "spoki") ?></li> |
| 1433 |
<li>• <?php _e('If you are using the classic editor, you can paste the shortcode on the page or post.', "spoki") ?></li> |
| 1434 |
</ul> |
| 1435 |
<h4><?php _e('Shortcode', "spoki") ?></h4> |
| 1436 |
<p> |
| 1437 |
<code>[spoki_button]</code>: <?php _e('use this shortcode to render the WhatsApp button in WordPress.', "spoki") ?> |
| 1438 |
</p> |
| 1439 |
<h4><?php _e('Args (or Arguments)', "spoki") ?></h4> |
| 1440 |
<p> |
| 1441 |
<?php _e('“Args” are ways to make the shortcode more specific. For example, by adding <code>cta="contact us"</code> to the <code>[spoki_button]</code> shortcode, it will create a WhatsApp button with the cta "contact us".', "spoki") ?> |
| 1442 |
</p> |
| 1443 |
<ul> |
| 1444 |
<li>• <code style="color: black">cta</code>: <?php _e('The text inside the button.', "spoki") ?></li> |
| 1445 |
<li>• <code style="color: black">message</code>: <?php _e('The text of the message the customer will send to phone via WhatsApp on button click. <i>Default value: ""</i>.', "spoki") ?></li> |
| 1446 |
<li>• <code>phone</code>: <?php /* translators: %1$s: Telephone. */ |
| 1447 |
printf(__('The WhatsApp telephone that will receive the message. <i>Default value: "%1$s" <small>(Your WhatsApp Telephone)</small></i>.', "spoki"), Spoki()->shop['telephone']) ?></li> |
| 1448 |
<li>• <code>color</code>: <?php _e('The background color of the button. <i>Default value: "#23D366"</i>.', "spoki") ?></li> |
| 1449 |
<li>• <code>border_type</code>: <?php _e('"rounded" | "squared". <i>Default value: "rounded"</i>.', "spoki") ?></li> |
| 1450 |
<li>• <code>margin_top</code>: <?php _e('<i>Default value: "4"</i> px.', "spoki") ?></li> |
| 1451 |
<li>• <code>margin_bottom</code>: <?php _e('<i>Default value: "4"</i> px.', "spoki") ?></li> |
| 1452 |
<li>• <code>margin_left</code>: <?php _e('<i>Default value: "0"</i> px.', "spoki") ?></li> |
| 1453 |
<li>• <code>margin_right</code>: <?php _e('<i>Default value: "0"</i> px.', "spoki") ?></li> |
| 1454 |
<li>• <code>padding_top</code>: <?php _e('<i>Default value: "8"</i> px.', "spoki") ?></li> |
| 1455 |
<li>• <code>padding_bottom</code>: <?php _e('<i>Default value: "8"</i> px.', "spoki") ?></li> |
| 1456 |
<li>• <code>padding_left</code>: <?php _e('<i>Default value: "14"</i> px.', "spoki") ?></li> |
| 1457 |
<li>• <code>padding_right</code>: <?php _e('<i>Default value: "14"</i> px.', "spoki") ?></li> |
| 1458 |
<li>• <code>font_size</code>: <?php _e('<i>Default value: "12"</i> px.', "spoki") ?></li> |
| 1459 |
<li>• <code>id</code>: <?php _e('The id selector of the button.', "spoki") ?></li> |
| 1460 |
<li>• <code>class_names</code>: <?php _e('The additional classes of the button.', "spoki") ?></li> |
| 1461 |
<li>• <code>custom_css</code>: <?php _e('insert the custom css code for the button there.', "spoki") ?></li> |
| 1462 |
<li>• <code>title</code>: <?php _e('The html title attr of the link of the button.', "spoki") ?></li> |
| 1463 |
<li>• <code>hide_non_working</code>: <?php _e('Hide the button on non-working days and times. <i>To enable set value = "1"</i>.', "spoki") ?></li> |
| 1464 |
<li>• <code>enable_non_working_message</code>: <?php _e('Enable alternative message on non-working days and times. <i>To enable set value = "1"</i>.', "spoki") ?></li> |
| 1465 |
<li>• <code>non_working_message</code>: <?php _e('The customer will send you this message only the non-working days and times.', "spoki") ?></li> |
| 1466 |
</ul> |
| 1467 |
<h4 style="margin-bottom: 0"><?php _e('Example', "spoki") ?> 1</h4> |
| 1468 |
<p class="description"><?php _e('Button with cta only.', "spoki") ?></p> |
| 1469 |
<p> |
| 1470 |
<code>[spoki_button cta="contact us"]</code> |
| 1471 |
<?php do_shortcode('[spoki_button cta="contact us"]') ?> |
| 1472 |
</p> |
| 1473 |
<h4 style="margin-bottom: 0"><?php _e('Example', "spoki") ?> 2</h4> |
| 1474 |
<p class="description"><?php _e('Button with cta & message.', "spoki") ?></p> |
| 1475 |
<p> |
| 1476 |
<code>[spoki_button cta="contact us" message="Hi, I need more info about your company"]</code> |
| 1477 |
<?php do_shortcode('[spoki_button cta="contact us" message="Hi, I need more info about your company"]') ?> |
| 1478 |
</p> |
| 1479 |
<h4 style="margin-bottom: 0"><?php _e('Example', "spoki") ?> 3</h4> |
| 1480 |
<p class="description"><?php _e('Customized button with custom phone.', "spoki") ?></p> |
| 1481 |
<p> |
| 1482 |
<code>[spoki_button phone="+393331234567" cta="contact us" message="Hi, I need more info about your company" border_type="squared" color="#34B7F1" font_size="18"]</code> |
| 1483 |
<?php do_shortcode('[spoki_button phone="+393331234567" cta="contact us" message="Hi, I need more info about your company" border_type="squared" color="#34B7F1" font_size="18"]') ?> |
| 1484 |
</p> |
| 1485 |
<h4 style="margin-bottom: 0"><?php _e('Example', "spoki") ?> 4</h4> |
| 1486 |
<p class="description"><?php _e('Custom css with custom class_names.', "spoki") ?></p> |
| 1487 |
<p> |
| 1488 |
<code>[spoki_button cta="contact us" message="Hi, I need more info about your company" class_names="dark" custom_css=".dark .spoki-button{background:black!important}"]</code> |
| 1489 |
<?php do_shortcode('[spoki_button cta="contact us" message="Hi, I need more info about your company" class_names="dark" custom_css=".dark .spoki-button{background:black!important}"]') ?> |
| 1490 |
</p> |
| 1491 |
</div> |
| 1492 |
|
| 1493 |
<div <?php if ($current_section != 'elementor') echo "style='display:none'" ?> > |
| 1494 |
<h2> |
| 1495 |
<?php _e('Elementor Button', "spoki") ?> |
| 1496 |
<a href="#TB_inline?&width=300&inlineId=buttons-info-dialog" class="thickbox button-info">ℹ</a> |
| 1497 |
</h2> |
| 1498 |
<p><?php _e('Spoki WhatsApp Button basic element for Elementor.', "spoki") ?></p> |
| 1499 |
<a href="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/elementor-sections.png' ?>" target="_blank"> |
| 1500 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/elementor-sections.png' ?>"/> |
| 1501 |
</a> |
| 1502 |
<a href="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/elementor-button.png' ?>" target="_blank"> |
| 1503 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/elementor-button.png' ?>"/> |
| 1504 |
</a> |
| 1505 |
<a href="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/elementor-button-2.png' ?>" target="_blank"> |
| 1506 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/elementor-button-2.png' ?>"/> |
| 1507 |
</a> |
| 1508 |
<p> |
| 1509 |
<ol> |
| 1510 |
<li> <?php _e('Customize the page with Elementor', "spoki") ?></li> |
| 1511 |
<li> <?php _e('Select the "<b>Spoki WhatsApp Button</b>" from the "BASIC" section', "spoki") ?></li> |
| 1512 |
<li> <?php _e('Drag & Drop the element where you want', "spoki") ?></li> |
| 1513 |
<li> <?php _e('Customize the button', "spoki") ?></li> |
| 1514 |
<li> <?php _e('Enjoy', "spoki") ?> 🎉</li> |
| 1515 |
</ol> |
| 1516 |
</p> |
| 1517 |
</div> |
| 1518 |
|
| 1519 |
<div <?php if ($current_section != 'qr_code') echo "style='display:none'" ?> > |
| 1520 |
<h2> |
| 1521 |
<?php _e('QR Code', "spoki") ?> |
| 1522 |
<a href="#TB_inline?&width=300&inlineId=buttons-info-dialog" class="thickbox button-info">ℹ</a> |
| 1523 |
</h2> |
| 1524 |
<p><?php _e('Generate WhatsApp QR Code.', "spoki") ?></p> |
| 1525 |
<img class="cover-image" src="<?php echo plugins_url() . '/' . SPOKI_PLUGIN_NAME . '/assets/images/spoki-qr-code.png' ?>"/> |
| 1526 |
<p> |
| 1527 |
<ol> |
| 1528 |
<li> <?php _e('Create the WhatsApp Qr Code', "spoki") ?></li> |
| 1529 |
<li> <?php _e('Print or insert the snippet where you want', "spoki") ?></li> |
| 1530 |
<li> <?php _e('Enjoy', "spoki") ?> 🎉</li> |
| 1531 |
</ol> |
| 1532 |
</p> |
| 1533 |
<a href="https://spoki.app/widget-builder?ref=plugin" target="_blank"> |
| 1534 |
<button type="button" class="button button-primary"> |
| 1535 |
<?php _e('Create QR Code', "spoki") ?> |
| 1536 |
</button> |
| 1537 |
</a> |
| 1538 |
</div> |
| 1539 |
|
| 1540 |
<?php |
| 1541 |
if ($current_section != 'fab' && $current_section != 'other_buttons' && $current_section != 'elementor' && $current_section != 'qr_code'): |
| 1542 |
if ($has_wc) : submit_button(null, 'primary', 'submit-templates'); |
| 1543 |
else : ?> |
| 1544 |
<p> |
| 1545 |
<?php _e("Install and activate the <strong>WooCommerce</strong> plugin to enable the Spoki features for WooCommerce.", "spoki") ?> |
| 1546 |
</p> |
| 1547 |
<?php |
| 1548 |
endif; |
| 1549 |
endif; |
| 1550 |
?> |
| 1551 |
</div> |
| 1552 |
|