| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Product Swatches Options. |
| 5 |
* |
| 6 |
* @package Merchant |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly |
| 11 |
} |
| 12 |
|
| 13 |
/** |
| 14 |
* Settings |
| 15 |
*/ |
| 16 |
Merchant_Admin_Options::create( array( |
| 17 |
'title' => esc_html__( 'Settings', 'merchant' ), |
| 18 |
'module' => Merchant_Product_Swatches::MODULE_ID, |
| 19 |
'fields' => array( |
| 20 |
|
| 21 |
// Enable shop catalog |
| 22 |
array( |
| 23 |
'id' => 'on_shop_catalog', |
| 24 |
'type' => 'switcher', |
| 25 |
'title' => __( 'Enable on shop catalog', 'merchant' ), |
| 26 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['on_shop_catalog'] |
| 27 |
), |
| 28 |
|
| 29 |
// Enable mouseover |
| 30 |
array( |
| 31 |
'id' => 'mouseover', |
| 32 |
'type' => 'switcher', |
| 33 |
'title' => __( 'Enable mouseover', 'merchant' ), |
| 34 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['mouseover'] |
| 35 |
), |
| 36 |
|
| 37 |
// Enable tooltip |
| 38 |
array( |
| 39 |
'id' => 'tooltip', |
| 40 |
'type' => 'switcher', |
| 41 |
'title' => __( 'Enable tooltip', 'merchant' ), |
| 42 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['tooltip'] |
| 43 |
), |
| 44 |
|
| 45 |
// Variation name on product title |
| 46 |
array( |
| 47 |
'id' => 'display_variation_name_on_product_title', |
| 48 |
'type' => 'switcher', |
| 49 |
'title' => __( 'Variation name on product title', 'merchant' ), |
| 50 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['display_variation_name_on_product_title'] |
| 51 |
), |
| 52 |
), |
| 53 |
) ); |
| 54 |
|
| 55 |
/** |
| 56 |
* Select swatch settings |
| 57 |
*/ |
| 58 |
Merchant_Admin_Options::create( array( |
| 59 |
'title' => esc_html__( "'Select' Swatch Style", 'merchant' ), |
| 60 |
'module' => Merchant_Product_Swatches::MODULE_ID, |
| 61 |
'fields' => array( |
| 62 |
|
| 63 |
/** |
| 64 |
* Single product |
| 65 |
*/ |
| 66 |
|
| 67 |
array( |
| 68 |
'type' => 'divider', |
| 69 |
'title' => esc_html__( 'Single product', 'merchant' ), |
| 70 |
), |
| 71 |
|
| 72 |
// Text color. |
| 73 |
array( |
| 74 |
'id' => 'select_text_color', |
| 75 |
'type' => 'color', |
| 76 |
'title' => esc_html__( 'Text color', 'merchant' ), |
| 77 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_text_color'] |
| 78 |
), |
| 79 |
|
| 80 |
// Border color |
| 81 |
array( |
| 82 |
'id' => 'select_border_color', |
| 83 |
'type' => 'color', |
| 84 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 85 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_border_color'] |
| 86 |
), |
| 87 |
|
| 88 |
// Background color |
| 89 |
array( |
| 90 |
'id' => 'select_background_color', |
| 91 |
'type' => 'color', |
| 92 |
'title' => esc_html__( 'Background color', 'merchant' ), |
| 93 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_background_color'] |
| 94 |
), |
| 95 |
|
| 96 |
// Padding |
| 97 |
array( |
| 98 |
'id' => 'select_padding', |
| 99 |
'type' => 'responsive_dimensions', |
| 100 |
'title' => esc_html__( 'Padding', 'merchant' ), |
| 101 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_padding'] |
| 102 |
), |
| 103 |
|
| 104 |
// Border radius |
| 105 |
array( |
| 106 |
'id' => 'select_border_radius', |
| 107 |
'type' => 'dimensions', |
| 108 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 109 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_border_radius'] |
| 110 |
), |
| 111 |
|
| 112 |
/** |
| 113 |
* Shop archive |
| 114 |
*/ |
| 115 |
|
| 116 |
array( |
| 117 |
'type' => 'divider', |
| 118 |
'title' => esc_html__( 'Shop archive', 'merchant' ), |
| 119 |
), |
| 120 |
|
| 121 |
// Inherit style from single product |
| 122 |
array( |
| 123 |
'id' => 'select_custom_style_shop_archive', |
| 124 |
'type' => 'switcher', |
| 125 |
'title' => __( 'Don\'t inherit style from single product ', 'merchant' ), |
| 126 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_custom_style_shop_archive'] |
| 127 |
), |
| 128 |
|
| 129 |
// Shop archive text color. |
| 130 |
array( |
| 131 |
'id' => 'select_text_color_shop_archive', |
| 132 |
'type' => 'color', |
| 133 |
'title' => esc_html__( 'Text color', 'merchant' ), |
| 134 |
'condition' => array( 'select_custom_style_shop_archive', '==', true ), |
| 135 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_text_color_shop_archive'] |
| 136 |
), |
| 137 |
|
| 138 |
// Shop archive border color |
| 139 |
array( |
| 140 |
'id' => 'select_border_color_shop_archive', |
| 141 |
'type' => 'color', |
| 142 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 143 |
'condition' => array( 'select_custom_style_shop_archive', '==', true ), |
| 144 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_border_color_shop_archive'] |
| 145 |
), |
| 146 |
|
| 147 |
// Shop archive background color |
| 148 |
array( |
| 149 |
'id' => 'select_background_color_shop_archive', |
| 150 |
'type' => 'color', |
| 151 |
'title' => esc_html__( 'Background color', 'merchant' ), |
| 152 |
'condition' => array( 'select_custom_style_shop_archive', '==', true ), |
| 153 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_background_color_shop_archive'] |
| 154 |
), |
| 155 |
|
| 156 |
// Shop archive padding |
| 157 |
array( |
| 158 |
'id' => 'select_padding_shop_archive', |
| 159 |
'type' => 'responsive_dimensions', |
| 160 |
'title' => esc_html__( 'Padding', 'merchant' ), |
| 161 |
'condition' => array( 'select_custom_style_shop_archive', '==', true ), |
| 162 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_padding_shop_archive'] |
| 163 |
), |
| 164 |
|
| 165 |
// Shop archive border radius |
| 166 |
array( |
| 167 |
'id' => 'select_border_radius_shop_archive', |
| 168 |
'type' => 'dimensions', |
| 169 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 170 |
'condition' => array( 'select_custom_style_shop_archive', '==', true ), |
| 171 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['select_border_radius_shop_archive'] |
| 172 |
), |
| 173 |
|
| 174 |
), |
| 175 |
) ); |
| 176 |
|
| 177 |
/** |
| 178 |
* Color swatch settings |
| 179 |
*/ |
| 180 |
Merchant_Admin_Options::create( array( |
| 181 |
'title' => esc_html__( "'Color' Swatch Style", 'merchant' ), |
| 182 |
'module' => Merchant_Product_Swatches::MODULE_ID, |
| 183 |
'fields' => array( |
| 184 |
|
| 185 |
/** |
| 186 |
* Single product |
| 187 |
*/ |
| 188 |
|
| 189 |
array( |
| 190 |
'type' => 'divider', |
| 191 |
'title' => esc_html__( 'Single product', 'merchant' ), |
| 192 |
), |
| 193 |
|
| 194 |
// Color width |
| 195 |
array( |
| 196 |
'id' => 'color_width', |
| 197 |
'type' => 'range', |
| 198 |
'title' => __( 'Width', 'merchant' ), |
| 199 |
'min' => 1, |
| 200 |
'max' => 250, |
| 201 |
'step' => 1, |
| 202 |
'unit' => '', |
| 203 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_width'] |
| 204 |
), |
| 205 |
|
| 206 |
// Color height |
| 207 |
array( |
| 208 |
'id' => 'color_height', |
| 209 |
'type' => 'range', |
| 210 |
'title' => __( 'Height', 'merchant' ), |
| 211 |
'min' => 1, |
| 212 |
'max' => 250, |
| 213 |
'step' => 1, |
| 214 |
'unit' => '', |
| 215 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_height'] |
| 216 |
), |
| 217 |
|
| 218 |
// Spacing |
| 219 |
array( |
| 220 |
'id' => 'color_spacing', |
| 221 |
'type' => 'range', |
| 222 |
'title' => __( 'Spacing', 'merchant' ), |
| 223 |
'min' => 1, |
| 224 |
'max' => 100, |
| 225 |
'step' => 1, |
| 226 |
'unit' => '', |
| 227 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_spacing'] |
| 228 |
), |
| 229 |
|
| 230 |
// Border color |
| 231 |
array( |
| 232 |
'id' => 'color_border_color', |
| 233 |
'type' => 'color', |
| 234 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 235 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_color'] |
| 236 |
), |
| 237 |
|
| 238 |
// Border hover color |
| 239 |
array( |
| 240 |
'id' => 'color_border_hover_color', |
| 241 |
'type' => 'color', |
| 242 |
'title' => esc_html__( 'Border Hover Color', 'merchant' ), |
| 243 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_hover_color'] |
| 244 |
), |
| 245 |
|
| 246 |
// Border width |
| 247 |
array( |
| 248 |
'id' => 'color_border_width', |
| 249 |
'type' => 'responsive_dimensions', |
| 250 |
'title' => esc_html__( 'Border width', 'merchant' ), |
| 251 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_width'] |
| 252 |
), |
| 253 |
|
| 254 |
// Border radius |
| 255 |
array( |
| 256 |
'id' => 'color_border_radius', |
| 257 |
'type' => 'dimensions', |
| 258 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 259 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_radius'] |
| 260 |
), |
| 261 |
|
| 262 |
/** |
| 263 |
* Shop archive |
| 264 |
*/ |
| 265 |
|
| 266 |
array( |
| 267 |
'type' => 'divider', |
| 268 |
'title' => esc_html__( 'Shop archive', 'merchant' ), |
| 269 |
), |
| 270 |
|
| 271 |
// Inherit style from single product |
| 272 |
array( |
| 273 |
'id' => 'color_custom_style_shop_archive', |
| 274 |
'type' => 'switcher', |
| 275 |
'title' => __( 'Don\'t inherit style from single product ', 'merchant' ), |
| 276 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_custom_style_shop_archive'] |
| 277 |
), |
| 278 |
|
| 279 |
// Color width |
| 280 |
array( |
| 281 |
'id' => 'color_width_shop_archive', |
| 282 |
'type' => 'range', |
| 283 |
'title' => __( 'Width', 'merchant' ), |
| 284 |
'min' => 1, |
| 285 |
'max' => 250, |
| 286 |
'step' => 1, |
| 287 |
'unit' => '', |
| 288 |
'condition' => array( 'color_custom_style_shop_archive', '==', true ), |
| 289 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_width_shop_archive'] |
| 290 |
), |
| 291 |
|
| 292 |
// Color height |
| 293 |
array( |
| 294 |
'id' => 'color_height_shop_archive', |
| 295 |
'type' => 'range', |
| 296 |
'title' => __( 'Height', 'merchant' ), |
| 297 |
'min' => 1, |
| 298 |
'max' => 250, |
| 299 |
'step' => 1, |
| 300 |
'unit' => '', |
| 301 |
'condition' => array( 'color_custom_style_shop_archive', '==', true ), |
| 302 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_height_shop_archive'] |
| 303 |
), |
| 304 |
|
| 305 |
// Spacing |
| 306 |
array( |
| 307 |
'id' => 'color_spacing_shop_archive', |
| 308 |
'type' => 'range', |
| 309 |
'title' => __( 'Spacing', 'merchant' ), |
| 310 |
'min' => 1, |
| 311 |
'max' => 100, |
| 312 |
'step' => 1, |
| 313 |
'unit' => '', |
| 314 |
'condition' => array( 'color_custom_style_shop_archive', '==', true ), |
| 315 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_spacing_shop_archive'] |
| 316 |
), |
| 317 |
|
| 318 |
// Border color |
| 319 |
array( |
| 320 |
'id' => 'color_border_color_shop_archive', |
| 321 |
'type' => 'color', |
| 322 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 323 |
'condition' => array( 'color_custom_style_shop_archive', '==', true ), |
| 324 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_color_shop_archive'] |
| 325 |
), |
| 326 |
|
| 327 |
// Border hover color |
| 328 |
array( |
| 329 |
'id' => 'color_border_hover_color_shop_archive', |
| 330 |
'type' => 'color', |
| 331 |
'title' => esc_html__( 'Border Hover Color', 'merchant' ), |
| 332 |
'condition' => array( 'color_custom_style_shop_archive', '==', true ), |
| 333 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_hover_color_shop_archive'] |
| 334 |
), |
| 335 |
|
| 336 |
// Border radius |
| 337 |
array( |
| 338 |
'id' => 'color_border_width_shop_archive', |
| 339 |
'type' => 'responsive_dimensions', |
| 340 |
'title' => esc_html__( 'Border width', 'merchant' ), |
| 341 |
'condition' => array( 'color_custom_style_shop_archive', '==', true ), |
| 342 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_width_shop_archive'] |
| 343 |
), |
| 344 |
|
| 345 |
// Border radius |
| 346 |
array( |
| 347 |
'id' => 'color_border_radius_shop_archive', |
| 348 |
'type' => 'dimensions', |
| 349 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 350 |
'condition' => array( 'color_custom_style_shop_archive', '==', true ), |
| 351 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['color_border_radius_shop_archive'] |
| 352 |
), |
| 353 |
), |
| 354 |
) ); |
| 355 |
|
| 356 |
/** |
| 357 |
* Button swatch settings |
| 358 |
*/ |
| 359 |
Merchant_Admin_Options::create( array( |
| 360 |
'title' => esc_html__( "'Button' Swatch Style", 'merchant' ), |
| 361 |
'module' => Merchant_Product_Swatches::MODULE_ID, |
| 362 |
'fields' => array( |
| 363 |
|
| 364 |
/** |
| 365 |
* Single product |
| 366 |
*/ |
| 367 |
|
| 368 |
array( |
| 369 |
'type' => 'divider', |
| 370 |
'title' => esc_html__( 'Single product', 'merchant' ), |
| 371 |
), |
| 372 |
|
| 373 |
// Text color. |
| 374 |
array( |
| 375 |
'id' => 'button_text_color', |
| 376 |
'type' => 'color', |
| 377 |
'title' => esc_html__( 'Text color', 'merchant' ), |
| 378 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_text_color'] |
| 379 |
), |
| 380 |
|
| 381 |
// Text hover color. |
| 382 |
array( |
| 383 |
'id' => 'button_text_hover_color', |
| 384 |
'type' => 'color', |
| 385 |
'title' => esc_html__( 'Text hover color', 'merchant' ), |
| 386 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_text_hover_color'] |
| 387 |
), |
| 388 |
|
| 389 |
// Border color |
| 390 |
array( |
| 391 |
'id' => 'button_border_color', |
| 392 |
'type' => 'color', |
| 393 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 394 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_color'] |
| 395 |
), |
| 396 |
|
| 397 |
// Border hover color |
| 398 |
array( |
| 399 |
'id' => 'button_border_hover_color', |
| 400 |
'type' => 'color', |
| 401 |
'title' => esc_html__( 'Border hover color', 'merchant' ), |
| 402 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_hover_color'] |
| 403 |
), |
| 404 |
|
| 405 |
// Background color |
| 406 |
array( |
| 407 |
'id' => 'button_background_color', |
| 408 |
'type' => 'color', |
| 409 |
'title' => esc_html__( 'Background color', 'merchant' ), |
| 410 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_background_color'] |
| 411 |
), |
| 412 |
|
| 413 |
// Background color |
| 414 |
array( |
| 415 |
'id' => 'button_background_hover_color', |
| 416 |
'type' => 'color', |
| 417 |
'title' => esc_html__( 'Background hover color', 'merchant' ), |
| 418 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_background_hover_color'] |
| 419 |
), |
| 420 |
|
| 421 |
// Padding |
| 422 |
array( |
| 423 |
'id' => 'button_padding', |
| 424 |
'type' => 'responsive_dimensions', |
| 425 |
'title' => esc_html__( 'Padding', 'merchant' ), |
| 426 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_padding'] |
| 427 |
), |
| 428 |
|
| 429 |
// Spacing |
| 430 |
array( |
| 431 |
'id' => 'button_spacing', |
| 432 |
'type' => 'range', |
| 433 |
'title' => __( 'Spacing', 'merchant' ), |
| 434 |
'min' => 1, |
| 435 |
'max' => 100, |
| 436 |
'step' => 1, |
| 437 |
'unit' => '', |
| 438 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_spacing'] |
| 439 |
), |
| 440 |
|
| 441 |
// Border width |
| 442 |
array( |
| 443 |
'id' => 'button_border_width', |
| 444 |
'type' => 'responsive_dimensions', |
| 445 |
'title' => esc_html__( 'Border width', 'merchant' ), |
| 446 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_width'] |
| 447 |
), |
| 448 |
|
| 449 |
// Border radius |
| 450 |
array( |
| 451 |
'id' => 'button_border_radius', |
| 452 |
'type' => 'dimensions', |
| 453 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 454 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_radius'] |
| 455 |
), |
| 456 |
|
| 457 |
/** |
| 458 |
* Shop archive |
| 459 |
*/ |
| 460 |
|
| 461 |
array( |
| 462 |
'type' => 'divider', |
| 463 |
'title' => esc_html__( 'Shop archive', 'merchant' ), |
| 464 |
), |
| 465 |
|
| 466 |
// Inherit style from single product |
| 467 |
array( |
| 468 |
'id' => 'button_custom_style_shop_archive', |
| 469 |
'type' => 'switcher', |
| 470 |
'title' => __( 'Don\'t inherit style from single product ', 'merchant' ), |
| 471 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_custom_style_shop_archive'] |
| 472 |
), |
| 473 |
|
| 474 |
// Text color. |
| 475 |
array( |
| 476 |
'id' => 'button_text_color_shop_archive', |
| 477 |
'type' => 'color', |
| 478 |
'title' => esc_html__( 'Text color', 'merchant' ), |
| 479 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 480 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_text_color_shop_archive'] |
| 481 |
), |
| 482 |
|
| 483 |
// Text hover color. |
| 484 |
array( |
| 485 |
'id' => 'button_text_hover_color_shop_archive', |
| 486 |
'type' => 'color', |
| 487 |
'title' => esc_html__( 'Text hover color', 'merchant' ), |
| 488 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 489 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_text_hover_color_shop_archive'] |
| 490 |
), |
| 491 |
|
| 492 |
// Border color |
| 493 |
array( |
| 494 |
'id' => 'button_border_color_shop_archive', |
| 495 |
'type' => 'color', |
| 496 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 497 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 498 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_color_shop_archive'] |
| 499 |
), |
| 500 |
|
| 501 |
// Border hover color |
| 502 |
array( |
| 503 |
'id' => 'button_border_hover_color_shop_archive', |
| 504 |
'type' => 'color', |
| 505 |
'title' => esc_html__( 'Border hover color', 'merchant' ), |
| 506 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 507 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_hover_color_shop_archive'] |
| 508 |
), |
| 509 |
|
| 510 |
// Background color |
| 511 |
array( |
| 512 |
'id' => 'button_background_color_shop_archive', |
| 513 |
'type' => 'color', |
| 514 |
'title' => esc_html__( 'Background color', 'merchant' ), |
| 515 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 516 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_background_color_shop_archive'] |
| 517 |
), |
| 518 |
|
| 519 |
// Background color |
| 520 |
array( |
| 521 |
'id' => 'button_background_hover_color_shop_archie', |
| 522 |
'type' => 'color', |
| 523 |
'title' => esc_html__( 'Background hover color', 'merchant' ), |
| 524 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 525 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_background_hover_color_shop_archive'] |
| 526 |
), |
| 527 |
|
| 528 |
|
| 529 |
// Padding |
| 530 |
array( |
| 531 |
'id' => 'button_padding_shop_archive', |
| 532 |
'type' => 'responsive_dimensions', |
| 533 |
'title' => esc_html__( 'Padding', 'merchant' ), |
| 534 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 535 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_padding_shop_archive'] |
| 536 |
), |
| 537 |
|
| 538 |
// Spacing |
| 539 |
array( |
| 540 |
'id' => 'button_spacing_shop_archive', |
| 541 |
'type' => 'range', |
| 542 |
'title' => __( 'Spacing', 'merchant' ), |
| 543 |
'min' => 1, |
| 544 |
'max' => 100, |
| 545 |
'step' => 1, |
| 546 |
'unit' => '', |
| 547 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 548 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_spacing_shop_archive'] |
| 549 |
), |
| 550 |
|
| 551 |
// Border width |
| 552 |
array( |
| 553 |
'id' => 'button_border_width_shop_archive', |
| 554 |
'type' => 'responsive_dimensions', |
| 555 |
'title' => esc_html__( 'Border width', 'merchant' ), |
| 556 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 557 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_width_shop_archive'] |
| 558 |
), |
| 559 |
|
| 560 |
// Border radius |
| 561 |
array( |
| 562 |
'id' => 'button_border_radius_shop_archive', |
| 563 |
'type' => 'dimensions', |
| 564 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 565 |
'condition' => array( 'button_custom_style_shop_archive', '==', true ), |
| 566 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['button_border_radius_shop_archive'] |
| 567 |
), |
| 568 |
), |
| 569 |
) ); |
| 570 |
|
| 571 |
|
| 572 |
/** |
| 573 |
* Image swatch settings |
| 574 |
*/ |
| 575 |
Merchant_Admin_Options::create( array( |
| 576 |
'title' => esc_html__( "'Image' Swatch Style", 'merchant' ), |
| 577 |
'module' => Merchant_Product_Swatches::MODULE_ID, |
| 578 |
'fields' => array( |
| 579 |
|
| 580 |
/** |
| 581 |
* Single product |
| 582 |
*/ |
| 583 |
|
| 584 |
array( |
| 585 |
'type' => 'divider', |
| 586 |
'title' => esc_html__( 'Single product', 'merchant' ), |
| 587 |
), |
| 588 |
|
| 589 |
// Width |
| 590 |
array( |
| 591 |
'id' => 'image_width', |
| 592 |
'type' => 'range', |
| 593 |
'title' => __( 'Width', 'merchant' ), |
| 594 |
'min' => 1, |
| 595 |
'max' => 250, |
| 596 |
'step' => 1, |
| 597 |
'unit' => '', |
| 598 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_width'] |
| 599 |
), |
| 600 |
|
| 601 |
// Height |
| 602 |
array( |
| 603 |
'id' => 'image_height', |
| 604 |
'type' => 'range', |
| 605 |
'title' => __( 'Height', 'merchant' ), |
| 606 |
'min' => 1, |
| 607 |
'max' => 250, |
| 608 |
'step' => 1, |
| 609 |
'unit' => '', |
| 610 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_height'] |
| 611 |
), |
| 612 |
|
| 613 |
// Spacing |
| 614 |
array( |
| 615 |
'id' => 'image_spacing', |
| 616 |
'type' => 'range', |
| 617 |
'title' => __( 'Spacing', 'merchant' ), |
| 618 |
'min' => 1, |
| 619 |
'max' => 100, |
| 620 |
'step' => 1, |
| 621 |
'unit' => '', |
| 622 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_spacing'] |
| 623 |
), |
| 624 |
|
| 625 |
// Border color |
| 626 |
array( |
| 627 |
'id' => 'image_border_color', |
| 628 |
'type' => 'color', |
| 629 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 630 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_color'] |
| 631 |
), |
| 632 |
|
| 633 |
// Border hover color |
| 634 |
array( |
| 635 |
'id' => 'image_border_hover_color', |
| 636 |
'type' => 'color', |
| 637 |
'title' => esc_html__( 'Border hover color', 'merchant' ), |
| 638 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_hover_color'] |
| 639 |
), |
| 640 |
|
| 641 |
// Border width |
| 642 |
array( |
| 643 |
'id' => 'image_border_width', |
| 644 |
'type' => 'responsive_dimensions', |
| 645 |
'title' => esc_html__( 'Border width', 'merchant' ), |
| 646 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_width'] |
| 647 |
), |
| 648 |
|
| 649 |
// Border radius |
| 650 |
array( |
| 651 |
'id' => 'image_border_radius', |
| 652 |
'type' => 'dimensions', |
| 653 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 654 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_radius'] |
| 655 |
), |
| 656 |
|
| 657 |
/** |
| 658 |
* Shop archive |
| 659 |
*/ |
| 660 |
|
| 661 |
array( |
| 662 |
'type' => 'divider', |
| 663 |
'title' => esc_html__( 'Shop archive', 'merchant' ), |
| 664 |
), |
| 665 |
|
| 666 |
// Inherit style from single product |
| 667 |
array( |
| 668 |
'id' => 'image_custom_style_shop_archive', |
| 669 |
'type' => 'switcher', |
| 670 |
'title' => __( 'Don\'t inherit style from single product ', 'merchant' ), |
| 671 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_custom_style_shop_archive'] |
| 672 |
), |
| 673 |
|
| 674 |
// Width |
| 675 |
array( |
| 676 |
'id' => 'image_width_shop_archive', |
| 677 |
'type' => 'range', |
| 678 |
'title' => __( 'Width', 'merchant' ), |
| 679 |
'min' => 1, |
| 680 |
'max' => 250, |
| 681 |
'step' => 1, |
| 682 |
'unit' => '', |
| 683 |
'condition' => array( 'image_custom_style_shop_archive', '==', true ), |
| 684 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_width_shop_archive'] |
| 685 |
), |
| 686 |
|
| 687 |
// Height |
| 688 |
array( |
| 689 |
'id' => 'image_height_shop_archive', |
| 690 |
'type' => 'range', |
| 691 |
'title' => __( 'Height', 'merchant' ), |
| 692 |
'min' => 1, |
| 693 |
'max' => 250, |
| 694 |
'step' => 1, |
| 695 |
'unit' => '', |
| 696 |
'condition' => array( 'image_custom_style_shop_archive', '==', true ), |
| 697 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_height_shop_archive'] |
| 698 |
), |
| 699 |
|
| 700 |
// Spacing |
| 701 |
array( |
| 702 |
'id' => 'image_spacing_shop_archive', |
| 703 |
'type' => 'range', |
| 704 |
'title' => __( 'Spacing', 'merchant' ), |
| 705 |
'min' => 1, |
| 706 |
'max' => 100, |
| 707 |
'step' => 1, |
| 708 |
'unit' => '', |
| 709 |
'condition' => array( 'image_custom_style_shop_archive', '==', true ), |
| 710 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_spacing_shop_archive'] |
| 711 |
), |
| 712 |
|
| 713 |
// Border color |
| 714 |
array( |
| 715 |
'id' => 'image_border_color_shop_archive', |
| 716 |
'type' => 'color', |
| 717 |
'title' => esc_html__( 'Border color', 'merchant' ), |
| 718 |
'condition' => array( 'image_custom_style_shop_archive', '==', true ), |
| 719 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_color_shop_archive'] |
| 720 |
), |
| 721 |
|
| 722 |
// Border hover color |
| 723 |
array( |
| 724 |
'id' => 'image_border_hover_color_shop_archive', |
| 725 |
'type' => 'color', |
| 726 |
'title' => esc_html__( 'Border hover color', 'merchant' ), |
| 727 |
'condition' => array( 'image_custom_style_shop_archive', '==', true ), |
| 728 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_hover_color_shop_archive'] |
| 729 |
), |
| 730 |
|
| 731 |
// Border width |
| 732 |
array( |
| 733 |
'id' => 'image_border_width_shop_archive', |
| 734 |
'type' => 'responsive_dimensions', |
| 735 |
'title' => esc_html__( 'Border width', 'merchant' ), |
| 736 |
'condition' => array( 'image_custom_style_shop_archive', '==', true ), |
| 737 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_width_shop_archive'] |
| 738 |
), |
| 739 |
|
| 740 |
// Border radius |
| 741 |
array( |
| 742 |
'id' => 'image_border_radius_shop_archive', |
| 743 |
'type' => 'dimensions', |
| 744 |
'title' => esc_html__( 'Border radius', 'merchant' ), |
| 745 |
'condition' => array( 'image_custom_style_shop_archive', '==', true ), |
| 746 |
'default' => Merchant_Product_Swatches::MODULE_DEFAULT_SETTINGS['image_border_radius_shop_archive'] |
| 747 |
), |
| 748 |
), |
| 749 |
) ); |
| 750 |
|
| 751 |
|