| 1 |
<?php |
| 2 |
|
| 3 |
namespace UltimateStoreKit\Modules\ImageHotspot\Widgets; |
| 4 |
|
| 5 |
use Elementor\Controls_Manager; |
| 6 |
use Elementor\Group_Control_Background; |
| 7 |
use Elementor\Group_Control_Border; |
| 8 |
use Elementor\Group_Control_Box_Shadow; |
| 9 |
use Elementor\Group_Control_Css_Filter; |
| 10 |
use Elementor\Group_Control_Image_Size; |
| 11 |
use Elementor\Group_Control_Text_Shadow; |
| 12 |
use Elementor\Group_Control_Text_Stroke; |
| 13 |
use Elementor\Group_Control_Typography; |
| 14 |
use Elementor\Icons_Manager; |
| 15 |
use Elementor\Repeater; |
| 16 |
// phpcs:disable WordPressVIPMinimum.Performance.WPQueryParams -- WordPressVIPMinimum targets the VIP platform, not the plugin directory. These exclusionary parameters come from a widget's own "exclude" control: the list is whatever the site owner picked in Elementor, applied to a bounded result set, not an unbounded catalogue scan. |
| 17 |
|
| 18 |
// use Elementor\Utils;] |
| 19 |
use UltimateStoreKit\Base\Module_Base; |
| 20 |
use UltimateStoreKit\Includes\Controls\GroupQuery\Group_Control_Query; |
| 21 |
use UltimateStoreKit\traits\Global_Widget_Controls; |
| 22 |
use UltimateStoreKit\traits\Global_Widget_Template; |
| 23 |
use UltimateStoreKit\Classes\Utils; |
| 24 |
use WP_Query; |
| 25 |
|
| 26 |
if (!defined('ABSPATH')) { |
| 27 |
exit; |
| 28 |
} |
| 29 |
|
| 30 |
// Exit if accessed directly |
| 31 |
|
| 32 |
class Image_Hotspot extends Module_Base { |
| 33 |
use Global_Widget_Controls; |
| 34 |
use Global_Widget_Template; |
| 35 |
use Group_Control_Query; |
| 36 |
|
| 37 |
/** |
| 38 |
* @var \WP_Query |
| 39 |
*/ |
| 40 |
private $_query = null; |
| 41 |
public function get_name() { |
| 42 |
return 'usk-image-hotspot'; |
| 43 |
} |
| 44 |
|
| 45 |
public function get_title() { |
| 46 |
return esc_html__('Image Hotspot', 'ultimate-store-kit'); |
| 47 |
} |
| 48 |
|
| 49 |
public function get_icon() { |
| 50 |
return 'usk-widget-icon usk-icon-image-hotspot usk-new'; |
| 51 |
} |
| 52 |
|
| 53 |
public function get_categories() { |
| 54 |
return ['ultimate-store-kit']; |
| 55 |
} |
| 56 |
|
| 57 |
public function get_keywords() { |
| 58 |
return ['product', 'image hotspot', 'hotspot', 'wc', 'carousel', 'slider']; |
| 59 |
} |
| 60 |
|
| 61 |
public function get_style_depends() { |
| 62 |
if ($this->usk_is_edit_mode()) { |
| 63 |
return ['swiper', 'usk-all-styles']; |
| 64 |
} else { |
| 65 |
return ['swiper', 'usk-font', 'usk-image-hotspot', 'ultimate-store-kit-tippy']; |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
public function get_script_depends() { |
| 70 |
if ($this->usk_is_edit_mode()) { |
| 71 |
return ['swiper', 'ultimate-store-kit-micromodal', 'ultimate-store-kit-popper', 'ultimate-store-kit-tippyjs', 'usk-site']; |
| 72 |
} else { |
| 73 |
return ['swiper', 'ultimate-store-kit-micromodal', 'ultimate-store-kit-popper', 'ultimate-store-kit-tippyjs', 'usk-image-hotspot']; |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
public function get_custom_help_url() { |
| 78 |
return 'https://youtu.be/7vrY1aY5mMw'; |
| 79 |
} |
| 80 |
|
| 81 |
public function get_query() { |
| 82 |
return $this->_query; |
| 83 |
} |
| 84 |
public function has_widget_inner_wrapper(): bool { |
| 85 |
return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup'); |
| 86 |
} |
| 87 |
protected function register_controls() { |
| 88 |
$this->start_controls_section( |
| 89 |
'section_woocommerce_layout', |
| 90 |
[ |
| 91 |
'label' => esc_html__('Image Hotspot', 'ultimate-store-kit'), |
| 92 |
] |
| 93 |
); |
| 94 |
|
| 95 |
$this->add_control( |
| 96 |
'image_hotspot_layout', |
| 97 |
[ |
| 98 |
'label' => esc_html__('Layout', 'ultimate-store-kit') . BDTUSK_PC, |
| 99 |
'type' => Controls_Manager::SELECT, |
| 100 |
'default' => 'tooltip', |
| 101 |
'options' => [ |
| 102 |
'slider' => esc_html__('Slider', 'ultimate-store-kit'), |
| 103 |
'tooltip' => esc_html__('Tooltip', 'ultimate-store-kit'), |
| 104 |
], |
| 105 |
'classes' => BDTUSK_IS_PC, |
| 106 |
] |
| 107 |
); |
| 108 |
|
| 109 |
$this->add_control( |
| 110 |
'hotspot_image', |
| 111 |
[ |
| 112 |
'label' => __('Image', 'ultimate-store-kit'), |
| 113 |
'type' => Controls_Manager::MEDIA, |
| 114 |
'dynamic' => ['active' => true], |
| 115 |
'default' => [ |
| 116 |
'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 117 |
], |
| 118 |
] |
| 119 |
); |
| 120 |
$this->add_group_control( |
| 121 |
Group_Control_Image_Size::get_type(), |
| 122 |
[ |
| 123 |
'name' => 'image_resolution', |
| 124 |
'default' => 'full', |
| 125 |
] |
| 126 |
); |
| 127 |
$this->add_control( |
| 128 |
'hotspot_type', |
| 129 |
[ |
| 130 |
'label' => __('Hotspot Type', 'ultimate-store-kit'), |
| 131 |
'type' => Controls_Manager::CHOOSE, |
| 132 |
'default' => 'image', |
| 133 |
'options' => [ |
| 134 |
'image' => [ |
| 135 |
'title' => __('Image', 'ultimate-store-kit'), |
| 136 |
'icon' => 'eicon-image', |
| 137 |
], |
| 138 |
'icon' => [ |
| 139 |
'title' => __('Icon', 'ultimate-store-kit'), |
| 140 |
'icon' => 'eicon-plus', |
| 141 |
], |
| 142 |
], |
| 143 |
'toggle' => false, |
| 144 |
] |
| 145 |
); |
| 146 |
$this->add_control( |
| 147 |
'hotspot_icon', |
| 148 |
[ |
| 149 |
'label' => __('Icon', 'ultimate-store-kit'), |
| 150 |
'type' => Controls_Manager::ICONS, |
| 151 |
'condition' => [ |
| 152 |
'hotspot_type' => 'icon', |
| 153 |
], |
| 154 |
'skin' => 'inline', |
| 155 |
'label_block' => false, |
| 156 |
] |
| 157 |
); |
| 158 |
|
| 159 |
$this->add_control( |
| 160 |
'slider_position', |
| 161 |
[ |
| 162 |
'label' => esc_html__('Slider Position', 'ultimate-store-kit'), |
| 163 |
'type' => Controls_Manager::CHOOSE, |
| 164 |
'options' => [ |
| 165 |
'left' => [ |
| 166 |
'title' => esc_html__('Left', 'ultimate-store-kit'), |
| 167 |
'icon' => 'eicon-h-align-left', |
| 168 |
], |
| 169 |
'right' => [ |
| 170 |
'title' => esc_html__('Right', 'ultimate-store-kit'), |
| 171 |
'icon' => 'eicon-h-align-right', |
| 172 |
], |
| 173 |
], |
| 174 |
'default' => 'right', |
| 175 |
'toggle' => false, |
| 176 |
'condition' => [ |
| 177 |
'image_hotspot_layout' => 'slider', |
| 178 |
], |
| 179 |
'prefix_class' => 'usk-image-hotspot-slider-', |
| 180 |
'render_type' => 'template', |
| 181 |
] |
| 182 |
); |
| 183 |
|
| 184 |
/** |
| 185 |
* Swiper Effects |
| 186 |
*/ |
| 187 |
$this->add_control( |
| 188 |
'swiper_effect', |
| 189 |
[ |
| 190 |
'label' => esc_html__('Slider Effect', 'ultimate-store-kit'), |
| 191 |
'type' => Controls_Manager::SELECT, |
| 192 |
'default' => 'slide', |
| 193 |
'options' => [ |
| 194 |
'slide' => esc_html__('Slide', 'ultimate-store-kit'), |
| 195 |
'fade' => esc_html__('Fade', 'ultimate-store-kit'), |
| 196 |
'cube' => esc_html__('Cube', 'ultimate-store-kit'), |
| 197 |
'flip' => esc_html__('Flip', 'ultimate-store-kit'), |
| 198 |
], |
| 199 |
'condition' => [ |
| 200 |
'image_hotspot_layout' => 'slider', |
| 201 |
], |
| 202 |
] |
| 203 |
); |
| 204 |
|
| 205 |
/** |
| 206 |
* Product Item Text Alignment |
| 207 |
*/ |
| 208 |
$this->add_responsive_control( |
| 209 |
'product_item_text_align', |
| 210 |
[ |
| 211 |
'label' => esc_html__('Text Alignment', 'ultimate-store-kit') . BDTUSK_NC, |
| 212 |
'type' => Controls_Manager::CHOOSE, |
| 213 |
'options' => [ |
| 214 |
'left' => [ |
| 215 |
'title' => esc_html__('Left', 'ultimate-store-kit'), |
| 216 |
'icon' => 'eicon-text-align-left', |
| 217 |
], |
| 218 |
'center' => [ |
| 219 |
'title' => esc_html__('Center', 'ultimate-store-kit'), |
| 220 |
'icon' => 'eicon-text-align-center', |
| 221 |
], |
| 222 |
'right' => [ |
| 223 |
'title' => esc_html__('Right', 'ultimate-store-kit'), |
| 224 |
'icon' => 'eicon-text-align-right', |
| 225 |
], |
| 226 |
], |
| 227 |
'selectors' => [ |
| 228 |
'.tippy-box[data-theme^=bdt-tippy-image-hotspot-] .usk-content-inner, {{WRAPPER}} .usk-grid-carousel .usk-content-inner' => 'text-align: {{VALUE}};', |
| 229 |
'.tippy-box[data-theme^=bdt-tippy-image-hotspot-] .usk-rating, {{WRAPPER}} .usk-grid-carousel .usk-rating' => 'justify-content: {{VALUE}};', |
| 230 |
], |
| 231 |
] |
| 232 |
); |
| 233 |
|
| 234 |
$this->end_controls_section(); |
| 235 |
|
| 236 |
//Query |
| 237 |
$this->start_controls_section( |
| 238 |
'section_post_query_builder', |
| 239 |
[ |
| 240 |
'label' => __('Query', 'ultimate-store-kit'), |
| 241 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 242 |
] |
| 243 |
); |
| 244 |
$this->register_query_builder_controls(); |
| 245 |
$this->update_control( |
| 246 |
'product_limit', |
| 247 |
[ |
| 248 |
'default' => 3, |
| 249 |
] |
| 250 |
); |
| 251 |
$this->end_controls_section(); |
| 252 |
|
| 253 |
$this->register_global_controls_additional(); |
| 254 |
|
| 255 |
$this->start_controls_section( |
| 256 |
'section_marker_image', |
| 257 |
[ |
| 258 |
'label' => __('Hotspot Settings', 'ultimate-store-kit'), |
| 259 |
] |
| 260 |
); |
| 261 |
|
| 262 |
$repeater = new Repeater(); |
| 263 |
|
| 264 |
$repeater->add_responsive_control( |
| 265 |
'marker_x_position', |
| 266 |
[ |
| 267 |
'label' => esc_html__('X Postion', 'ultimate-store-kit'), |
| 268 |
'type' => Controls_Manager::SLIDER, |
| 269 |
'range' => [ |
| 270 |
'%' => [ |
| 271 |
'min' => 0, |
| 272 |
'max' => 100, |
| 273 |
], |
| 274 |
], |
| 275 |
'selectors' => [ |
| 276 |
'{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}}.usk-thumbs-item' => 'left: {{SIZE}}%;', |
| 277 |
], |
| 278 |
] |
| 279 |
); |
| 280 |
|
| 281 |
$repeater->add_responsive_control( |
| 282 |
'marker_y_position', |
| 283 |
[ |
| 284 |
'label' => esc_html__('Y Postion', 'ultimate-store-kit'), |
| 285 |
'type' => Controls_Manager::SLIDER, |
| 286 |
'range' => [ |
| 287 |
'%' => [ |
| 288 |
'min' => 0, |
| 289 |
'max' => 100, |
| 290 |
], |
| 291 |
], |
| 292 |
'selectors' => [ |
| 293 |
'{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}}.usk-thumbs-item' => 'top: {{SIZE}}%;', |
| 294 |
], |
| 295 |
] |
| 296 |
); |
| 297 |
|
| 298 |
$repeater->add_control( |
| 299 |
'advanced_option_toggle', |
| 300 |
[ |
| 301 |
'label' => __('Hotspot Style', 'ultimate-store-kit'), |
| 302 |
'type' => Controls_Manager::POPOVER_TOGGLE, |
| 303 |
'label_off' => __('None', 'ultimate-store-kit'), |
| 304 |
'label_on' => __('Custom', 'ultimate-store-kit'), |
| 305 |
'return_value' => 'yes', |
| 306 |
] |
| 307 |
); |
| 308 |
|
| 309 |
$repeater->start_popover(); |
| 310 |
|
| 311 |
$repeater->add_control( |
| 312 |
'repeater_marker_color', |
| 313 |
[ |
| 314 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 315 |
'type' => Controls_Manager::COLOR, |
| 316 |
'selectors' => [ |
| 317 |
'{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}} .usk-thumbs-box i' => 'color: {{VALUE}};', |
| 318 |
'{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}} .usk-thumbs-box svg' => 'fill: {{VALUE}};', |
| 319 |
], |
| 320 |
'render_type' => 'ui', |
| 321 |
'condition' => [ |
| 322 |
'advanced_option_toggle' => 'yes', |
| 323 |
], |
| 324 |
] |
| 325 |
); |
| 326 |
|
| 327 |
$repeater->add_group_control( |
| 328 |
Group_Control_Background::get_type(), |
| 329 |
[ |
| 330 |
'name' => 'repeater_marker_background', |
| 331 |
'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs {{CURRENT_ITEM}} .usk-thumbs-box', |
| 332 |
'render_type' => 'ui', |
| 333 |
'condition' => [ |
| 334 |
'advanced_option_toggle' => 'yes', |
| 335 |
], |
| 336 |
] |
| 337 |
); |
| 338 |
|
| 339 |
$repeater->end_popover(); |
| 340 |
|
| 341 |
$this->add_control( |
| 342 |
'markers', |
| 343 |
[ |
| 344 |
'label' => esc_html__('Hotspot Items', 'ultimate-store-kit'), |
| 345 |
'type' => Controls_Manager::REPEATER, |
| 346 |
'fields' => $repeater->get_controls(), |
| 347 |
'default' => [ |
| 348 |
[ |
| 349 |
'marker_x_position' => [ |
| 350 |
'size' => 50, |
| 351 |
'unit' => '%', |
| 352 |
], |
| 353 |
'marker_y_position' => [ |
| 354 |
'size' => 75, |
| 355 |
'unit' => '%', |
| 356 |
], |
| 357 |
], |
| 358 |
[ |
| 359 |
'marker_x_position' => [ |
| 360 |
'size' => 20, |
| 361 |
'unit' => '%', |
| 362 |
], |
| 363 |
'marker_y_position' => [ |
| 364 |
'size' => 30, |
| 365 |
'unit' => '%', |
| 366 |
], |
| 367 |
], |
| 368 |
[ |
| 369 |
'marker_x_position' => [ |
| 370 |
'size' => 65, |
| 371 |
'unit' => '%', |
| 372 |
], |
| 373 |
'marker_y_position' => [ |
| 374 |
'size' => 20, |
| 375 |
'unit' => '%', |
| 376 |
], |
| 377 |
], |
| 378 |
], |
| 379 |
] |
| 380 |
); |
| 381 |
|
| 382 |
$this->end_controls_section(); |
| 383 |
|
| 384 |
$this->start_controls_section( |
| 385 |
'section_tooltip_settings', |
| 386 |
[ |
| 387 |
'label' => __('Tooltip Settings', 'ultimate-store-kit'), |
| 388 |
'condition' => [ |
| 389 |
'image_hotspot_layout' => 'tooltip', |
| 390 |
], |
| 391 |
] |
| 392 |
); |
| 393 |
|
| 394 |
$this->add_control( |
| 395 |
'marker_tooltip_animation', |
| 396 |
[ |
| 397 |
'label' => esc_html__('Animation', 'ultimate-store-kit'), |
| 398 |
'type' => Controls_Manager::SELECT, |
| 399 |
'default' => 'shift-toward', |
| 400 |
'options' => [ |
| 401 |
'shift-away' => esc_html__('Shift-Away', 'ultimate-store-kit'), |
| 402 |
'shift-toward' => esc_html__('Shift-Toward', 'ultimate-store-kit'), |
| 403 |
'fade' => esc_html__('Fade', 'ultimate-store-kit'), |
| 404 |
'scale' => esc_html__('Scale', 'ultimate-store-kit'), |
| 405 |
'perspective' => esc_html__('Perspective', 'ultimate-store-kit'), |
| 406 |
], |
| 407 |
'render_type' => 'template', |
| 408 |
] |
| 409 |
); |
| 410 |
$this->add_control( |
| 411 |
'marker_tooltip_placement', |
| 412 |
[ |
| 413 |
'label' => esc_html__('Placement', 'ultimate-store-kit'), |
| 414 |
'type' => Controls_Manager::SELECT, |
| 415 |
'default' => 'top', |
| 416 |
'options' => [ |
| 417 |
'top-start' => esc_html__('Top Left', 'ultimate-store-kit'), |
| 418 |
'top' => esc_html__('Top', 'ultimate-store-kit'), |
| 419 |
'top-end' => esc_html__('Top Right', 'ultimate-store-kit'), |
| 420 |
'bottom-start' => esc_html__('Bottom Left', 'ultimate-store-kit'), |
| 421 |
'bottom' => esc_html__('Bottom', 'ultimate-store-kit'), |
| 422 |
'bottom-end' => esc_html__('Bottom Right', 'ultimate-store-kit'), |
| 423 |
'left' => esc_html__('Left', 'ultimate-store-kit'), |
| 424 |
'right' => esc_html__('Right', 'ultimate-store-kit'), |
| 425 |
], |
| 426 |
'render_type' => 'template', |
| 427 |
] |
| 428 |
); |
| 429 |
|
| 430 |
$this->add_control( |
| 431 |
'marker_tooltip_x_offset', |
| 432 |
[ |
| 433 |
'label' => esc_html__('Offset', 'ultimate-store-kit'), |
| 434 |
'type' => Controls_Manager::SLIDER, |
| 435 |
'default' => [ |
| 436 |
'size' => 0, |
| 437 |
], |
| 438 |
] |
| 439 |
); |
| 440 |
|
| 441 |
$this->add_control( |
| 442 |
'marker_tooltip_y_offset', |
| 443 |
[ |
| 444 |
'label' => esc_html__('Distance', 'ultimate-store-kit'), |
| 445 |
'type' => Controls_Manager::SLIDER, |
| 446 |
'default' => [ |
| 447 |
'size' => 0, |
| 448 |
], |
| 449 |
] |
| 450 |
); |
| 451 |
|
| 452 |
$this->add_control( |
| 453 |
'marker_tooltip_arrow', |
| 454 |
[ |
| 455 |
'label' => esc_html__('Arrow', 'ultimate-store-kit'), |
| 456 |
'type' => Controls_Manager::SWITCHER, |
| 457 |
] |
| 458 |
); |
| 459 |
|
| 460 |
$this->add_control( |
| 461 |
'marker_tooltip_trigger', |
| 462 |
[ |
| 463 |
'label' => __('Trigger on Click', 'ultimate-store-kit'), |
| 464 |
'description' => __('Don\'t set yes when you set lightbox image with marker.', 'ultimate-store-kit'), |
| 465 |
'type' => Controls_Manager::SWITCHER, |
| 466 |
] |
| 467 |
); |
| 468 |
|
| 469 |
$this->end_controls_section(); |
| 470 |
|
| 471 |
/** |
| 472 |
* Style |
| 473 |
*/ |
| 474 |
$this->start_controls_section( |
| 475 |
'section_style_image_hotspot', |
| 476 |
[ |
| 477 |
'label' => esc_html__('Image Hotspot', 'ultimate-store-kit'), |
| 478 |
'tab' => Controls_Manager::TAB_STYLE, |
| 479 |
] |
| 480 |
); |
| 481 |
$this->start_controls_tabs('tabs_image_hotspot_style'); |
| 482 |
$this->start_controls_tab( |
| 483 |
'tab_image_hotspot_normal', |
| 484 |
[ |
| 485 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 486 |
] |
| 487 |
); |
| 488 |
$this->add_control( |
| 489 |
'hotspot_icon_color', |
| 490 |
[ |
| 491 |
'label' => esc_html__('Icon Color', 'ultimate-store-kit'), |
| 492 |
'type' => Controls_Manager::COLOR, |
| 493 |
'selectors' => [ |
| 494 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box i' => 'color: {{VALUE}};', |
| 495 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box svg' => 'fill: {{VALUE}};', |
| 496 |
], |
| 497 |
'condition' => [ |
| 498 |
'hotspot_type' => 'icon', |
| 499 |
], |
| 500 |
] |
| 501 |
); |
| 502 |
$this->add_group_control( |
| 503 |
Group_Control_Background::get_type(), |
| 504 |
[ |
| 505 |
'name' => 'hotspot_background', |
| 506 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 507 |
'types' => ['classic', 'gradient'], |
| 508 |
'exclude' => [ |
| 509 |
'image', |
| 510 |
], |
| 511 |
'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box', |
| 512 |
] |
| 513 |
); |
| 514 |
$this->add_group_control( |
| 515 |
Group_Control_Border::get_type(), |
| 516 |
[ |
| 517 |
'name' => 'hotspot_border', |
| 518 |
'label' => esc_html__('Border', 'ultimate-store-kit'), |
| 519 |
'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box', |
| 520 |
'separator' => 'before', |
| 521 |
] |
| 522 |
); |
| 523 |
$this->add_responsive_control( |
| 524 |
'hotspot_border_radius', |
| 525 |
[ |
| 526 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 527 |
'type' => Controls_Manager::DIMENSIONS, |
| 528 |
'size_units' => ['px', '%'], |
| 529 |
'selectors' => [ |
| 530 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 531 |
], |
| 532 |
] |
| 533 |
); |
| 534 |
$this->add_responsive_control( |
| 535 |
'hotspot_size', |
| 536 |
[ |
| 537 |
'label' => esc_html__('Size', 'ultimate-store-kit'), |
| 538 |
'type' => Controls_Manager::SLIDER, |
| 539 |
'size_units' => ['px', '%'], |
| 540 |
'selectors' => [ |
| 541 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;', |
| 542 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:after' => 'width: calc(24px + {{SIZE}}{{UNIT}}); height: calc(24px + {{SIZE}}{{UNIT}});', |
| 543 |
], |
| 544 |
] |
| 545 |
); |
| 546 |
$this->add_responsive_control( |
| 547 |
'hotspot_icon_size', |
| 548 |
[ |
| 549 |
'label' => esc_html__('Icon Size', 'ultimate-store-kit'), |
| 550 |
'type' => Controls_Manager::SLIDER, |
| 551 |
'size_units' => ['px'], |
| 552 |
'range' => [ |
| 553 |
'px' => [ |
| 554 |
'min' => 0, |
| 555 |
'max' => 50, |
| 556 |
], |
| 557 |
], |
| 558 |
'selectors' => [ |
| 559 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box' => 'font-size: {{SIZE}}px;', |
| 560 |
], |
| 561 |
'condition' => [ |
| 562 |
'hotspot_type' => 'icon', |
| 563 |
], |
| 564 |
] |
| 565 |
); |
| 566 |
$this->add_control( |
| 567 |
'hotspot_pulse_color', |
| 568 |
[ |
| 569 |
'label' => esc_html__('Shadow Pulse Color', 'ultimate-store-kit'), |
| 570 |
'type' => Controls_Manager::COLOR, |
| 571 |
'selectors' => [ |
| 572 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:after' => 'background-color: {{VALUE}};', |
| 573 |
], |
| 574 |
'separator' => 'before', |
| 575 |
] |
| 576 |
); |
| 577 |
$this->add_responsive_control( |
| 578 |
'hotspot_pulse_size', |
| 579 |
[ |
| 580 |
'label' => esc_html__('Shadow Pulse Size', 'ultimate-store-kit'), |
| 581 |
'type' => Controls_Manager::SLIDER, |
| 582 |
'size_units' => ['px'], |
| 583 |
'range' => [ |
| 584 |
'px' => [ |
| 585 |
'min' => 30, |
| 586 |
'max' => 100, |
| 587 |
], |
| 588 |
], |
| 589 |
'selectors' => [ |
| 590 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:after' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;', |
| 591 |
], |
| 592 |
] |
| 593 |
); |
| 594 |
$this->end_controls_tab(); |
| 595 |
$this->start_controls_tab( |
| 596 |
'tab_image_hotspot_hover', |
| 597 |
[ |
| 598 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 599 |
] |
| 600 |
); |
| 601 |
$this->add_control( |
| 602 |
'hotspot_icon_color_hover', |
| 603 |
[ |
| 604 |
'label' => esc_html__('Icon Color', 'ultimate-store-kit'), |
| 605 |
'type' => Controls_Manager::COLOR, |
| 606 |
'selectors' => [ |
| 607 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover i' => 'color: {{VALUE}};', |
| 608 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover svg' => 'fill: {{VALUE}};', |
| 609 |
], |
| 610 |
'condition' => [ |
| 611 |
'hotspot_type' => 'icon', |
| 612 |
], |
| 613 |
] |
| 614 |
); |
| 615 |
$this->add_group_control( |
| 616 |
Group_Control_Background::get_type(), |
| 617 |
[ |
| 618 |
'name' => 'hotspot_background_hover', |
| 619 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 620 |
'types' => ['classic', 'gradient'], |
| 621 |
'exclude' => [ |
| 622 |
'image', |
| 623 |
], |
| 624 |
'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover', |
| 625 |
] |
| 626 |
); |
| 627 |
$this->add_control( |
| 628 |
'hotspot_border_color_hover', |
| 629 |
[ |
| 630 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 631 |
'type' => Controls_Manager::COLOR, |
| 632 |
'selectors' => [ |
| 633 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-box:hover' => 'border-color: {{VALUE}};', |
| 634 |
], |
| 635 |
'condition' => [ |
| 636 |
'hotspot_border_border!' => '', |
| 637 |
], |
| 638 |
] |
| 639 |
); |
| 640 |
$this->add_control( |
| 641 |
'hotspot_pulse_color_hover', |
| 642 |
[ |
| 643 |
'label' => esc_html__('Shadow Pulse Color', 'ultimate-store-kit'), |
| 644 |
'type' => Controls_Manager::COLOR, |
| 645 |
'selectors' => [ |
| 646 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item:hover:after' => 'background-color: {{VALUE}};', |
| 647 |
], |
| 648 |
'separator' => 'before', |
| 649 |
] |
| 650 |
); |
| 651 |
$this->end_controls_tab(); |
| 652 |
$this->start_controls_tab( |
| 653 |
'tab_image_hotspot_active', |
| 654 |
[ |
| 655 |
'label' => esc_html__('Active', 'ultimate-store-kit'), |
| 656 |
'condition' => [ |
| 657 |
'image_hotspot_layout' => 'slider', |
| 658 |
], |
| 659 |
] |
| 660 |
); |
| 661 |
$this->add_control( |
| 662 |
'hotspot_icon_color_active', |
| 663 |
[ |
| 664 |
'label' => esc_html__('Icon Color', 'ultimate-store-kit'), |
| 665 |
'type' => Controls_Manager::COLOR, |
| 666 |
'selectors' => [ |
| 667 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box i' => 'color: {{VALUE}};', |
| 668 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box svg' => 'fill: {{VALUE}};', |
| 669 |
], |
| 670 |
'condition' => [ |
| 671 |
'hotspot_type' => 'icon', |
| 672 |
'image_hotspot_layout' => 'slider', |
| 673 |
], |
| 674 |
] |
| 675 |
); |
| 676 |
$this->add_group_control( |
| 677 |
Group_Control_Background::get_type(), |
| 678 |
[ |
| 679 |
'name' => 'hotspot_background_active', |
| 680 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 681 |
'types' => ['classic', 'gradient'], |
| 682 |
'exclude' => [ |
| 683 |
'image', |
| 684 |
], |
| 685 |
'selector' => '{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box', |
| 686 |
'condition' => [ |
| 687 |
'image_hotspot_layout' => 'slider', |
| 688 |
], |
| 689 |
] |
| 690 |
); |
| 691 |
$this->add_control( |
| 692 |
'hotspot_border_color_active', |
| 693 |
[ |
| 694 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 695 |
'type' => Controls_Manager::COLOR, |
| 696 |
'selectors' => [ |
| 697 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active .usk-thumbs-box' => 'border-color: {{VALUE}};', |
| 698 |
], |
| 699 |
'condition' => [ |
| 700 |
'hotspot_border_border!' => '', |
| 701 |
'image_hotspot_layout' => 'slider', |
| 702 |
], |
| 703 |
] |
| 704 |
); |
| 705 |
$this->add_control( |
| 706 |
'hotspot_pulse_color_active', |
| 707 |
[ |
| 708 |
'label' => esc_html__('Shadow Pulse Color', 'ultimate-store-kit'), |
| 709 |
'type' => Controls_Manager::COLOR, |
| 710 |
'selectors' => [ |
| 711 |
'{{WRAPPER}} .usk-image-hotspot-thumbs .usk-thumbs-item.swiper-slide-thumb-active:after' => 'background-color: {{VALUE}};', |
| 712 |
], |
| 713 |
'separator' => 'before', |
| 714 |
'condition' => [ |
| 715 |
'image_hotspot_layout' => 'slider', |
| 716 |
], |
| 717 |
] |
| 718 |
); |
| 719 |
$this->end_controls_tab(); |
| 720 |
$this->end_controls_tabs(); |
| 721 |
$this->end_controls_section(); |
| 722 |
|
| 723 |
/** |
| 724 |
* Layout Slider Style Start |
| 725 |
*/ |
| 726 |
$this->start_controls_section( |
| 727 |
'section_style_item', |
| 728 |
[ |
| 729 |
'label' => esc_html__('Product Items', 'ultimate-store-kit'), |
| 730 |
'tab' => Controls_Manager::TAB_STYLE, |
| 731 |
] |
| 732 |
); |
| 733 |
|
| 734 |
$this->add_responsive_control( |
| 735 |
'hotspot_gap', |
| 736 |
[ |
| 737 |
'label' => esc_html__('Gap', 'ultimate-store-kit'), |
| 738 |
'type' => Controls_Manager::SLIDER, |
| 739 |
'selectors' => [ |
| 740 |
'{{WRAPPER}} .usk-image-hotspot' => 'gap: {{SIZE}}{{UNIT}};', |
| 741 |
'(desktop){{WRAPPER}}.usk-image-hotspot-slider-left .usk-image-hotspot-main' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 742 |
'(desktop){{WRAPPER}}.usk-image-hotspot-slider-right .usk-image-hotspot-main' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 743 |
'(mobile){{WRAPPER}}.usk-image-hotspot-slider-left .usk-image-hotspot-main' => 'margin-left: auto;', |
| 744 |
'(mobile){{WRAPPER}}.usk-image-hotspot-slider-right .usk-image-hotspot-main' => 'margin-right: auto;', |
| 745 |
], |
| 746 |
'condition' => [ |
| 747 |
'image_hotspot_layout' => 'slider', |
| 748 |
], |
| 749 |
] |
| 750 |
); |
| 751 |
$this->start_controls_tabs('item_tabs'); |
| 752 |
$this->start_controls_tab( |
| 753 |
'item_tab_normal', |
| 754 |
[ |
| 755 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 756 |
] |
| 757 |
); |
| 758 |
$this->add_group_control( |
| 759 |
Group_Control_Background::get_type(), |
| 760 |
[ |
| 761 |
'name' => 'item_background', |
| 762 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item', |
| 763 |
] |
| 764 |
); |
| 765 |
|
| 766 |
$this->add_group_control( |
| 767 |
Group_Control_Border::get_type(), |
| 768 |
[ |
| 769 |
'name' => 'item_border', |
| 770 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item', |
| 771 |
'separator' => 'before', |
| 772 |
] |
| 773 |
); |
| 774 |
|
| 775 |
$this->add_responsive_control( |
| 776 |
'item_border_radius', |
| 777 |
[ |
| 778 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 779 |
'type' => Controls_Manager::DIMENSIONS, |
| 780 |
'size_units' => ['px', '%', 'em'], |
| 781 |
'selectors' => [ |
| 782 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 783 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 784 |
], |
| 785 |
] |
| 786 |
); |
| 787 |
|
| 788 |
$this->add_responsive_control( |
| 789 |
'item_padding', |
| 790 |
[ |
| 791 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 792 |
'type' => Controls_Manager::DIMENSIONS, |
| 793 |
'size_units' => ['px', '%', 'em'], |
| 794 |
'selectors' => [ |
| 795 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 796 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 797 |
], |
| 798 |
] |
| 799 |
); |
| 800 |
|
| 801 |
$this->add_responsive_control( |
| 802 |
'item_width', |
| 803 |
[ |
| 804 |
'label' => esc_html__('Width', 'ultimate-store-kit'), |
| 805 |
'type' => Controls_Manager::SLIDER, |
| 806 |
'size_units' => ['px', '%'], |
| 807 |
'range' => [ |
| 808 |
'%' => [ |
| 809 |
'min' => 10, |
| 810 |
'max' => 100, |
| 811 |
], |
| 812 |
'px' => [ |
| 813 |
'min' => 100, |
| 814 |
'max' => 500, |
| 815 |
], |
| 816 |
], |
| 817 |
'selectors' => [ |
| 818 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-image-hotspot-main' => 'width: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}};', |
| 819 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"]' => 'max-width: {{SIZE}}{{UNIT}} !important;', |
| 820 |
], |
| 821 |
] |
| 822 |
); |
| 823 |
|
| 824 |
$this->end_controls_tab(); |
| 825 |
|
| 826 |
$this->start_controls_tab( |
| 827 |
'item_tab_hover', |
| 828 |
[ |
| 829 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 830 |
] |
| 831 |
); |
| 832 |
|
| 833 |
$this->add_group_control( |
| 834 |
Group_Control_Background::get_type(), |
| 835 |
[ |
| 836 |
'name' => 'item_hover_background', |
| 837 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item:hover', |
| 838 |
] |
| 839 |
); |
| 840 |
|
| 841 |
$this->add_control( |
| 842 |
'item_hover_border_color', |
| 843 |
[ |
| 844 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 845 |
'type' => Controls_Manager::COLOR, |
| 846 |
'selectors' => [ |
| 847 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover' => 'border-color: {{VALUE}}', |
| 848 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .tippy-content .usk-item:hover' => 'border-color: {{VALUE}}', |
| 849 |
], |
| 850 |
'condition' => [ |
| 851 |
'item_border_border!' => '', |
| 852 |
], |
| 853 |
] |
| 854 |
); |
| 855 |
|
| 856 |
$this->end_controls_tab(); |
| 857 |
$this->end_controls_tabs(); |
| 858 |
$this->end_controls_section(); |
| 859 |
|
| 860 |
$this->start_controls_section( |
| 861 |
'section_style_image', |
| 862 |
[ |
| 863 |
'label' => esc_html__('Image', 'ultimate-store-kit'), |
| 864 |
'tab' => Controls_Manager::TAB_STYLE, |
| 865 |
] |
| 866 |
); |
| 867 |
$this->start_controls_tabs( |
| 868 |
'style_tabs_image' |
| 869 |
); |
| 870 |
$this->start_controls_tab( |
| 871 |
'image_normal', |
| 872 |
[ |
| 873 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 874 |
] |
| 875 |
); |
| 876 |
$this->add_group_control( |
| 877 |
Group_Control_Background::get_type(), |
| 878 |
[ |
| 879 |
'name' => 'image_background', |
| 880 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image', |
| 881 |
] |
| 882 |
); |
| 883 |
$this->add_group_control( |
| 884 |
Group_Control_Border::get_type(), |
| 885 |
[ |
| 886 |
'name' => 'image_border', |
| 887 |
'label' => esc_html__('Image Border', 'ultimate-store-kit'), |
| 888 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image', |
| 889 |
'separator' => 'before', |
| 890 |
] |
| 891 |
); |
| 892 |
|
| 893 |
$this->add_responsive_control( |
| 894 |
'image_border_radius', |
| 895 |
[ |
| 896 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 897 |
'type' => Controls_Manager::DIMENSIONS, |
| 898 |
'size_units' => ['px', '%'], |
| 899 |
'selectors' => [ |
| 900 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 901 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 902 |
], |
| 903 |
] |
| 904 |
); |
| 905 |
|
| 906 |
$this->add_responsive_control( |
| 907 |
'image_padding', |
| 908 |
[ |
| 909 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 910 |
'type' => Controls_Manager::DIMENSIONS, |
| 911 |
'size_units' => ['px', '%'], |
| 912 |
'selectors' => [ |
| 913 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-image' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 914 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-image' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 915 |
], |
| 916 |
] |
| 917 |
); |
| 918 |
|
| 919 |
$this->end_controls_tab(); |
| 920 |
$this->start_controls_tab( |
| 921 |
'image_hover', |
| 922 |
[ |
| 923 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 924 |
] |
| 925 |
); |
| 926 |
$this->add_group_control( |
| 927 |
Group_Control_Background::get_type(), |
| 928 |
[ |
| 929 |
'name' => 'image_hover_background', |
| 930 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-item:hover .usk-image', |
| 931 |
] |
| 932 |
); |
| 933 |
$this->add_group_control( |
| 934 |
Group_Control_Border::get_type(), |
| 935 |
[ |
| 936 |
'name' => 'image_hover_border', |
| 937 |
'label' => esc_html__('Image Border', 'ultimate-store-kit'), |
| 938 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-image, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-item:hover .usk-image', |
| 939 |
'separator' => 'before', |
| 940 |
] |
| 941 |
); |
| 942 |
$this->add_responsive_control( |
| 943 |
'image_hover_border_radius', |
| 944 |
[ |
| 945 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 946 |
'type' => Controls_Manager::DIMENSIONS, |
| 947 |
'size_units' => ['px', '%'], |
| 948 |
'selectors' => [ |
| 949 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 950 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-item:hover .usk-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 951 |
], |
| 952 |
] |
| 953 |
); |
| 954 |
$this->end_controls_tab(); |
| 955 |
$this->end_controls_tabs(); |
| 956 |
$this->end_controls_section(); |
| 957 |
|
| 958 |
$this->start_controls_section( |
| 959 |
'section_style_content', |
| 960 |
[ |
| 961 |
'label' => esc_html__('Content', 'ultimate-store-kit'), |
| 962 |
'tab' => Controls_Manager::TAB_STYLE, |
| 963 |
] |
| 964 |
); |
| 965 |
$this->start_controls_tabs('tabs_content_style'); |
| 966 |
$this->start_controls_tab( |
| 967 |
'tab_content_normal', |
| 968 |
[ |
| 969 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 970 |
] |
| 971 |
); |
| 972 |
$this->add_group_control( |
| 973 |
Group_Control_Background::get_type(), |
| 974 |
[ |
| 975 |
'name' => 'content_background', |
| 976 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 977 |
'types' => ['classic', 'gradient'], |
| 978 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-content, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content', |
| 979 |
] |
| 980 |
); |
| 981 |
|
| 982 |
$this->add_group_control( |
| 983 |
Group_Control_Border::get_type(), |
| 984 |
[ |
| 985 |
'name' => 'content_border', |
| 986 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 987 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-content, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content', |
| 988 |
'separator' => 'before', |
| 989 |
] |
| 990 |
); |
| 991 |
|
| 992 |
$this->add_responsive_control( |
| 993 |
'content_radius', |
| 994 |
[ |
| 995 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 996 |
'type' => Controls_Manager::DIMENSIONS, |
| 997 |
'size_units' => ['px', '%'], |
| 998 |
'selectors' => [ |
| 999 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 1000 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 1001 |
], |
| 1002 |
] |
| 1003 |
); |
| 1004 |
|
| 1005 |
$this->add_responsive_control( |
| 1006 |
'content_padding', |
| 1007 |
[ |
| 1008 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 1009 |
'type' => Controls_Manager::DIMENSIONS, |
| 1010 |
'size_units' => ['px', 'em', '%'], |
| 1011 |
'selectors' => [ |
| 1012 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1013 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1014 |
], |
| 1015 |
] |
| 1016 |
); |
| 1017 |
$this->end_controls_tab(); |
| 1018 |
$this->start_controls_tab( |
| 1019 |
'tab_content_hover', |
| 1020 |
[ |
| 1021 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1022 |
] |
| 1023 |
); |
| 1024 |
$this->add_group_control( |
| 1025 |
Group_Control_Background::get_type(), |
| 1026 |
[ |
| 1027 |
'name' => 'content_hover_background', |
| 1028 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1029 |
'types' => ['classic', 'gradient'], |
| 1030 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-content, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item:hover .usk-content', |
| 1031 |
] |
| 1032 |
); |
| 1033 |
$this->add_control( |
| 1034 |
'content_hover_border_color', |
| 1035 |
[ |
| 1036 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1037 |
'type' => Controls_Manager::COLOR, |
| 1038 |
'condition' => [ |
| 1039 |
'content_border_border!' => '', |
| 1040 |
], |
| 1041 |
'selectors' => [ |
| 1042 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-item:hover .usk-content' => 'border-color: {{VALUE}};', |
| 1043 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item:hover .usk-content' => 'border-color: {{VALUE}};', |
| 1044 |
], |
| 1045 |
] |
| 1046 |
); |
| 1047 |
$this->end_controls_tab(); |
| 1048 |
$this->end_controls_tabs(); |
| 1049 |
$this->end_controls_section(); |
| 1050 |
|
| 1051 |
$this->start_controls_section( |
| 1052 |
'section_style_title', |
| 1053 |
[ |
| 1054 |
'label' => esc_html__('Title', 'ultimate-store-kit'), |
| 1055 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1056 |
] |
| 1057 |
); |
| 1058 |
|
| 1059 |
$this->add_control( |
| 1060 |
'title_color', |
| 1061 |
[ |
| 1062 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1063 |
'type' => Controls_Manager::COLOR, |
| 1064 |
'selectors' => [ |
| 1065 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-title' => 'color: {{VALUE}}', |
| 1066 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title' => 'color: {{VALUE}}', |
| 1067 |
], |
| 1068 |
] |
| 1069 |
); |
| 1070 |
|
| 1071 |
$this->add_control( |
| 1072 |
'hover_title_color', |
| 1073 |
[ |
| 1074 |
'label' => esc_html__('Hover Color', 'ultimate-store-kit'), |
| 1075 |
'type' => Controls_Manager::COLOR, |
| 1076 |
'selectors' => [ |
| 1077 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-title:hover' => 'color: {{VALUE}};', |
| 1078 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title:hover' => 'color: {{VALUE}};', |
| 1079 |
], |
| 1080 |
] |
| 1081 |
); |
| 1082 |
|
| 1083 |
$this->add_responsive_control( |
| 1084 |
'title_margin', |
| 1085 |
[ |
| 1086 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 1087 |
'type' => Controls_Manager::DIMENSIONS, |
| 1088 |
'size_units' => ['px', '%'], |
| 1089 |
'selectors' => [ |
| 1090 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1091 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1092 |
], |
| 1093 |
] |
| 1094 |
); |
| 1095 |
|
| 1096 |
$this->add_group_control( |
| 1097 |
Group_Control_Typography::get_type(), |
| 1098 |
[ |
| 1099 |
'name' => 'title_typography', |
| 1100 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 1101 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-title .title, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-title .title', |
| 1102 |
] |
| 1103 |
); |
| 1104 |
|
| 1105 |
$this->end_controls_section(); |
| 1106 |
|
| 1107 |
$this->start_controls_section( |
| 1108 |
'section_style_category', |
| 1109 |
[ |
| 1110 |
'label' => esc_html__('Category', 'ultimate-store-kit'), |
| 1111 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1112 |
'condition' => [ |
| 1113 |
'show_category' => 'yes', |
| 1114 |
], |
| 1115 |
] |
| 1116 |
); |
| 1117 |
$this->start_controls_tabs( |
| 1118 |
'category_tabs' |
| 1119 |
); |
| 1120 |
$this->start_controls_tab( |
| 1121 |
'category_tab_normal', |
| 1122 |
[ |
| 1123 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 1124 |
] |
| 1125 |
); |
| 1126 |
$this->add_control( |
| 1127 |
'category_color', |
| 1128 |
[ |
| 1129 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1130 |
'type' => Controls_Manager::COLOR, |
| 1131 |
'selectors' => [ |
| 1132 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-category a' => 'color: {{VALUE}};', |
| 1133 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a' => 'color: {{VALUE}};', |
| 1134 |
], |
| 1135 |
] |
| 1136 |
); |
| 1137 |
$this->add_group_control( |
| 1138 |
Group_Control_Background::get_type(), |
| 1139 |
[ |
| 1140 |
'name' => 'category_bg_color', |
| 1141 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a', |
| 1142 |
] |
| 1143 |
); |
| 1144 |
$this->add_group_control( |
| 1145 |
Group_Control_Border::get_type(), |
| 1146 |
[ |
| 1147 |
'name' => 'category_border', |
| 1148 |
'label' => esc_html__('Border', 'ultimate-store-kit'), |
| 1149 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a', |
| 1150 |
'separator' => 'before' |
| 1151 |
] |
| 1152 |
); |
| 1153 |
$this->add_responsive_control( |
| 1154 |
'category_radius', |
| 1155 |
[ |
| 1156 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 1157 |
'type' => Controls_Manager::DIMENSIONS, |
| 1158 |
'size_units' => ['px', '%', 'em'], |
| 1159 |
'selectors' => [ |
| 1160 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1161 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1162 |
], |
| 1163 |
] |
| 1164 |
); |
| 1165 |
$this->add_responsive_control( |
| 1166 |
'category_padding', |
| 1167 |
[ |
| 1168 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 1169 |
'type' => Controls_Manager::DIMENSIONS, |
| 1170 |
'size_units' => ['px', '%'], |
| 1171 |
'selectors' => [ |
| 1172 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1173 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1174 |
], |
| 1175 |
] |
| 1176 |
); |
| 1177 |
$this->add_responsive_control( |
| 1178 |
'category_margin', |
| 1179 |
[ |
| 1180 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 1181 |
'type' => Controls_Manager::DIMENSIONS, |
| 1182 |
'size_units' => ['px', '%'], |
| 1183 |
'selectors' => [ |
| 1184 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1185 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1186 |
], |
| 1187 |
] |
| 1188 |
); |
| 1189 |
|
| 1190 |
$this->add_responsive_control( |
| 1191 |
'category_space_between', |
| 1192 |
[ |
| 1193 |
'label' => esc_html__('Space Between', 'ultimate-store-kit'), |
| 1194 |
'type' => Controls_Manager::SLIDER, |
| 1195 |
'size_units' => ['px', 'em', '%'], |
| 1196 |
'selectors' => [ |
| 1197 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-category' => 'gap: {{SIZE}}{{UNIT}};', |
| 1198 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category' => 'gap: {{SIZE}}{{UNIT}};', |
| 1199 |
], |
| 1200 |
] |
| 1201 |
); |
| 1202 |
$this->add_group_control( |
| 1203 |
Group_Control_Typography::get_type(), |
| 1204 |
[ |
| 1205 |
'name' => 'category_typography', |
| 1206 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 1207 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a', |
| 1208 |
] |
| 1209 |
); |
| 1210 |
$this->add_group_control( |
| 1211 |
Group_Control_Box_Shadow::get_type(), |
| 1212 |
[ |
| 1213 |
'name' => 'category_shadow', |
| 1214 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a', |
| 1215 |
] |
| 1216 |
); |
| 1217 |
$this->end_controls_tab(); |
| 1218 |
$this->start_controls_tab( |
| 1219 |
'category_tab_hover', |
| 1220 |
[ |
| 1221 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1222 |
] |
| 1223 |
); |
| 1224 |
$this->add_control( |
| 1225 |
'hover_category_color', |
| 1226 |
[ |
| 1227 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1228 |
'type' => Controls_Manager::COLOR, |
| 1229 |
'selectors' => [ |
| 1230 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-category a:hover' => 'color: {{VALUE}};', |
| 1231 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a:hover' => 'color: {{VALUE}};', |
| 1232 |
], |
| 1233 |
] |
| 1234 |
); |
| 1235 |
$this->add_group_control( |
| 1236 |
Group_Control_Background::get_type(), |
| 1237 |
[ |
| 1238 |
'name' => 'hover_category_bg_color', |
| 1239 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-category a:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a:hover', |
| 1240 |
] |
| 1241 |
); |
| 1242 |
$this->add_control( |
| 1243 |
'hover_category_border_color', |
| 1244 |
[ |
| 1245 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1246 |
'type' => Controls_Manager::COLOR, |
| 1247 |
'selectors' => [ |
| 1248 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-category a:hover' => 'border-color: {{VALUE}};', |
| 1249 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-category a:hover' => 'border-color: {{VALUE}};', |
| 1250 |
], |
| 1251 |
'condition' => [ |
| 1252 |
'category_border_border!' => '' |
| 1253 |
], |
| 1254 |
'separator' => 'before' |
| 1255 |
] |
| 1256 |
); |
| 1257 |
$this->end_controls_tab(); |
| 1258 |
$this->end_controls_tabs(); |
| 1259 |
$this->end_controls_section(); |
| 1260 |
|
| 1261 |
$this->start_controls_section( |
| 1262 |
'section_style_price', |
| 1263 |
[ |
| 1264 |
'label' => esc_html__('Price', 'ultimate-store-kit'), |
| 1265 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1266 |
'condition' => [ |
| 1267 |
'show_price' => 'yes', |
| 1268 |
], |
| 1269 |
] |
| 1270 |
); |
| 1271 |
$this->add_control( |
| 1272 |
'regular_price_color', |
| 1273 |
[ |
| 1274 |
'label' => esc_html__('Regular Color', 'ultimate-store-kit'), |
| 1275 |
'type' => Controls_Manager::COLOR, |
| 1276 |
'selectors' => [ |
| 1277 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price del .woocommerce-Price-amount.amount' => 'color: {{VALUE}};', |
| 1278 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price del' => 'color: {{VALUE}};', |
| 1279 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price del .woocommerce-Price-amount.amount' => 'color: {{VALUE}};', |
| 1280 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price del' => 'color: {{VALUE}};', |
| 1281 |
], |
| 1282 |
|
| 1283 |
] |
| 1284 |
); |
| 1285 |
$this->add_control( |
| 1286 |
'sale_price_color', |
| 1287 |
[ |
| 1288 |
'label' => esc_html__('Sale Color', 'ultimate-store-kit'), |
| 1289 |
'type' => Controls_Manager::COLOR, |
| 1290 |
'selectors' => [ |
| 1291 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price' => 'color: {{VALUE}}', |
| 1292 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price ins span' => 'color: {{VALUE}}', |
| 1293 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price .woocommerce-Price-amount.amount' => 'color: {{VALUE}}', |
| 1294 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price > .woocommerce-Price-amount.amount bdi' => 'color: {{VALUE}}', |
| 1295 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price' => 'color: {{VALUE}}', |
| 1296 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price ins span' => 'color: {{VALUE}}', |
| 1297 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price .woocommerce-Price-amount.amount' => 'color: {{VALUE}}', |
| 1298 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price > .woocommerce-Price-amount.amount bdi' => 'color: {{VALUE}}', |
| 1299 |
], |
| 1300 |
] |
| 1301 |
); |
| 1302 |
|
| 1303 |
$this->add_responsive_control( |
| 1304 |
'price_margin', |
| 1305 |
[ |
| 1306 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 1307 |
'type' => Controls_Manager::DIMENSIONS, |
| 1308 |
'size_units' => ['px', '%'], |
| 1309 |
'selectors' => [ |
| 1310 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1311 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1312 |
], |
| 1313 |
] |
| 1314 |
); |
| 1315 |
|
| 1316 |
$this->add_group_control( |
| 1317 |
Group_Control_Typography::get_type(), |
| 1318 |
[ |
| 1319 |
'name' => 'sale_price_typography', |
| 1320 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 1321 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-price, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-price', |
| 1322 |
] |
| 1323 |
); |
| 1324 |
|
| 1325 |
$this->end_controls_section(); |
| 1326 |
|
| 1327 |
$this->start_controls_section( |
| 1328 |
'section_style_rating', |
| 1329 |
[ |
| 1330 |
'label' => esc_html__('Rating', 'ultimate-store-kit'), |
| 1331 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1332 |
'condition' => [ |
| 1333 |
'show_rating' => 'yes', |
| 1334 |
], |
| 1335 |
] |
| 1336 |
); |
| 1337 |
$this->add_control( |
| 1338 |
'rating_color', |
| 1339 |
[ |
| 1340 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1341 |
'type' => Controls_Manager::COLOR, |
| 1342 |
'default' => '#e7e7e7', |
| 1343 |
'selectors' => [ |
| 1344 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating::before' => 'color: {{VALUE}};', |
| 1345 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-rating .star-rating::before' => 'color: {{VALUE}};', |
| 1346 |
], |
| 1347 |
] |
| 1348 |
); |
| 1349 |
|
| 1350 |
$this->add_control( |
| 1351 |
'active_rating_color', |
| 1352 |
[ |
| 1353 |
'label' => esc_html__('Active Color', 'ultimate-store-kit'), |
| 1354 |
'type' => Controls_Manager::COLOR, |
| 1355 |
'default' => '#FFCC00', |
| 1356 |
'selectors' => [ |
| 1357 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating span::before' => 'color: {{VALUE}};', |
| 1358 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-rating .star-rating span::before' => 'color: {{VALUE}};', |
| 1359 |
], |
| 1360 |
] |
| 1361 |
); |
| 1362 |
|
| 1363 |
$this->end_controls_section(); |
| 1364 |
|
| 1365 |
$this->start_controls_section( |
| 1366 |
'badge', |
| 1367 |
[ |
| 1368 |
'label' => esc_html__('Badge', 'ultimate-store-kit'), |
| 1369 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1370 |
'conditions' => [ |
| 1371 |
'relation' => 'or', |
| 1372 |
'terms' => [ |
| 1373 |
[ |
| 1374 |
'name' => 'show_sale_badge', |
| 1375 |
'value' => 'yes' |
| 1376 |
], |
| 1377 |
[ |
| 1378 |
'name' => 'show_discount_badge', |
| 1379 |
'value' => 'yes' |
| 1380 |
], |
| 1381 |
[ |
| 1382 |
'name' => 'show_stock_status', |
| 1383 |
'value' => 'yes' |
| 1384 |
], |
| 1385 |
[ |
| 1386 |
'name' => 'show_trending_badge', |
| 1387 |
'value' => 'yes' |
| 1388 |
], |
| 1389 |
[ |
| 1390 |
'name' => 'show_new_badge', |
| 1391 |
'value' => 'yes' |
| 1392 |
] |
| 1393 |
] |
| 1394 |
] |
| 1395 |
] |
| 1396 |
); |
| 1397 |
$this->add_group_control( |
| 1398 |
Group_Control_Border::get_type(), |
| 1399 |
[ |
| 1400 |
'name' => 'badge_border', |
| 1401 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge', |
| 1402 |
] |
| 1403 |
); |
| 1404 |
$this->add_responsive_control( |
| 1405 |
'badge_radius', |
| 1406 |
[ |
| 1407 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 1408 |
'type' => Controls_Manager::DIMENSIONS, |
| 1409 |
'size_units' => ['px', '%', 'em'], |
| 1410 |
'selectors' => [ |
| 1411 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1412 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1413 |
], |
| 1414 |
] |
| 1415 |
); |
| 1416 |
$this->add_responsive_control( |
| 1417 |
'badge_padding', |
| 1418 |
[ |
| 1419 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 1420 |
'type' => Controls_Manager::DIMENSIONS, |
| 1421 |
'size_units' => ['px', '%', 'em'], |
| 1422 |
'selectors' => [ |
| 1423 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1424 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1425 |
], |
| 1426 |
] |
| 1427 |
); |
| 1428 |
$this->add_responsive_control( |
| 1429 |
'badge_margin', |
| 1430 |
[ |
| 1431 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 1432 |
'type' => Controls_Manager::DIMENSIONS, |
| 1433 |
'size_units' => ['px', '%', 'em'], |
| 1434 |
'selectors' => [ |
| 1435 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1436 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1437 |
], |
| 1438 |
] |
| 1439 |
); |
| 1440 |
|
| 1441 |
$this->add_responsive_control( |
| 1442 |
'badge_spacing', |
| 1443 |
[ |
| 1444 |
'label' => esc_html__('Space Between', 'ultimate-store-kit'), |
| 1445 |
'type' => Controls_Manager::SLIDER, |
| 1446 |
'default' => [ |
| 1447 |
'unit' => 'px', |
| 1448 |
'size' => 10, |
| 1449 |
], |
| 1450 |
'selectors' => [ |
| 1451 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content' => 'gap: {{SIZE}}{{UNIT}};', |
| 1452 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content' => 'gap: {{SIZE}}{{UNIT}};', |
| 1453 |
], |
| 1454 |
] |
| 1455 |
); |
| 1456 |
$this->add_group_control( |
| 1457 |
Group_Control_Typography::get_type(), |
| 1458 |
[ |
| 1459 |
'name' => 'badge_typography', |
| 1460 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 1461 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-badge-label-content > div .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-badge-label-content > div .usk-badge', |
| 1462 |
] |
| 1463 |
); |
| 1464 |
$this->start_controls_tabs( |
| 1465 |
'label_badge_tabs' |
| 1466 |
); |
| 1467 |
$this->start_controls_tab( |
| 1468 |
'sale_badge_tab', |
| 1469 |
[ |
| 1470 |
'label' => esc_html__('Sale', 'ultimate-store-kit'), |
| 1471 |
'condition' => [ |
| 1472 |
'show_sale_badge' => 'yes', |
| 1473 |
] |
| 1474 |
] |
| 1475 |
); |
| 1476 |
$this->add_control( |
| 1477 |
'sale_badge_color', |
| 1478 |
[ |
| 1479 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1480 |
'type' => Controls_Manager::COLOR, |
| 1481 |
'selectors' => [ |
| 1482 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-sale-badge .usk-badge' => 'color: {{VALUE}}', |
| 1483 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-sale-badge .usk-badge' => 'color: {{VALUE}}', |
| 1484 |
], |
| 1485 |
'condition' => [ |
| 1486 |
'show_sale_badge' => 'yes', |
| 1487 |
] |
| 1488 |
] |
| 1489 |
); |
| 1490 |
|
| 1491 |
$this->add_group_control( |
| 1492 |
Group_Control_Background::get_type(), |
| 1493 |
[ |
| 1494 |
'name' => 'sale_badge_bg', |
| 1495 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-sale-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-sale-badge .usk-badge', |
| 1496 |
'condition' => [ |
| 1497 |
'show_sale_badge' => 'yes', |
| 1498 |
] |
| 1499 |
] |
| 1500 |
); |
| 1501 |
|
| 1502 |
$this->add_control( |
| 1503 |
'sale_badge_border_color', |
| 1504 |
[ |
| 1505 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1506 |
'type' => Controls_Manager::COLOR, |
| 1507 |
'selectors' => [ |
| 1508 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-sale-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1509 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-sale-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1510 |
], |
| 1511 |
'condition' => [ |
| 1512 |
'show_sale_badge' => 'yes', |
| 1513 |
'badge_border_border!' => '', |
| 1514 |
] |
| 1515 |
] |
| 1516 |
); |
| 1517 |
$this->end_controls_tab(); |
| 1518 |
$this->start_controls_tab( |
| 1519 |
'discount_badge_tab', |
| 1520 |
[ |
| 1521 |
'label' => esc_html__('Discount', 'ultimate-store-kit'), |
| 1522 |
'condition' => [ |
| 1523 |
'show_discount_badge' => 'yes', |
| 1524 |
], |
| 1525 |
] |
| 1526 |
); |
| 1527 |
$this->add_control( |
| 1528 |
'discount_badge_color', |
| 1529 |
[ |
| 1530 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1531 |
'type' => Controls_Manager::COLOR, |
| 1532 |
'selectors' => [ |
| 1533 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-percantage-badge .usk-badge' => 'color: {{VALUE}}', |
| 1534 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-percantage-badge .usk-badge' => 'color: {{VALUE}}', |
| 1535 |
], |
| 1536 |
'condition' => [ |
| 1537 |
'show_discount_badge' => 'yes', |
| 1538 |
], |
| 1539 |
] |
| 1540 |
); |
| 1541 |
|
| 1542 |
$this->add_group_control( |
| 1543 |
Group_Control_Background::get_type(), |
| 1544 |
[ |
| 1545 |
'name' => 'discount_badge_bg', |
| 1546 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-percantage-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-percantage-badge .usk-badge', |
| 1547 |
'condition' => [ |
| 1548 |
'show_discount_badge' => 'yes', |
| 1549 |
], |
| 1550 |
] |
| 1551 |
); |
| 1552 |
|
| 1553 |
$this->add_control( |
| 1554 |
'discount_badge_border_color', |
| 1555 |
[ |
| 1556 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1557 |
'type' => Controls_Manager::COLOR, |
| 1558 |
'selectors' => [ |
| 1559 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-percantage-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1560 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-percantage-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1561 |
], |
| 1562 |
'condition' => [ |
| 1563 |
'show_discount_badge' => 'yes', |
| 1564 |
'badge_border_border!' => '', |
| 1565 |
], |
| 1566 |
] |
| 1567 |
); |
| 1568 |
$this->end_controls_tab(); |
| 1569 |
$this->start_controls_tab( |
| 1570 |
'stock_badge_tab', |
| 1571 |
[ |
| 1572 |
'label' => esc_html__('Stock', 'ultimate-store-kit'), |
| 1573 |
'condition' => [ |
| 1574 |
'show_stock_status' => 'yes', |
| 1575 |
], |
| 1576 |
] |
| 1577 |
); |
| 1578 |
$this->add_control( |
| 1579 |
'stock_badge_color', |
| 1580 |
[ |
| 1581 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1582 |
'type' => Controls_Manager::COLOR, |
| 1583 |
'selectors' => [ |
| 1584 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-stock-status-badge .usk-badge' => 'color: {{VALUE}}', |
| 1585 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-stock-status-badge .usk-badge' => 'color: {{VALUE}}', |
| 1586 |
], |
| 1587 |
'condition' => [ |
| 1588 |
'show_stock_status' => 'yes', |
| 1589 |
], |
| 1590 |
] |
| 1591 |
); |
| 1592 |
$this->add_group_control( |
| 1593 |
Group_Control_Background::get_type(), |
| 1594 |
[ |
| 1595 |
'name' => 'stock_badge_bg', |
| 1596 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-stock-status-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-stock-status-badge .usk-badge', |
| 1597 |
'condition' => [ |
| 1598 |
'show_stock_status' => 'yes', |
| 1599 |
], |
| 1600 |
] |
| 1601 |
); |
| 1602 |
|
| 1603 |
$this->add_control( |
| 1604 |
'stock_badge_border_color', |
| 1605 |
[ |
| 1606 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1607 |
'type' => Controls_Manager::COLOR, |
| 1608 |
'selectors' => [ |
| 1609 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-stock-status-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1610 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-stock-status-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1611 |
], |
| 1612 |
'condition' => [ |
| 1613 |
'show_stock_status' => 'yes', |
| 1614 |
'badge_border_border!' => '', |
| 1615 |
], |
| 1616 |
] |
| 1617 |
); |
| 1618 |
$this->end_controls_tab(); |
| 1619 |
$this->start_controls_tab( |
| 1620 |
'trending_badge_tab', |
| 1621 |
[ |
| 1622 |
'label' => esc_html__('Trending', 'ultimate-store-kit'), |
| 1623 |
'condition' => [ |
| 1624 |
'show_trending_badge' => 'yes', |
| 1625 |
], |
| 1626 |
] |
| 1627 |
); |
| 1628 |
$this->add_control( |
| 1629 |
'trending_badge_color', |
| 1630 |
[ |
| 1631 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1632 |
'type' => Controls_Manager::COLOR, |
| 1633 |
'selectors' => [ |
| 1634 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-trending-badge .usk-badge' => 'color: {{VALUE}}', |
| 1635 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-trending-badge .usk-badge' => 'color: {{VALUE}}', |
| 1636 |
], |
| 1637 |
'condition' => [ |
| 1638 |
'show_trending_badge' => 'yes', |
| 1639 |
], |
| 1640 |
] |
| 1641 |
); |
| 1642 |
$this->add_group_control( |
| 1643 |
Group_Control_Background::get_type(), |
| 1644 |
[ |
| 1645 |
'name' => 'trending_badge_bg', |
| 1646 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-trending-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-trending-badge .usk-badge', |
| 1647 |
'condition' => [ |
| 1648 |
'show_trending_badge' => 'yes', |
| 1649 |
], |
| 1650 |
] |
| 1651 |
); |
| 1652 |
|
| 1653 |
$this->add_control( |
| 1654 |
'trending_badge_border_color', |
| 1655 |
[ |
| 1656 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1657 |
'type' => Controls_Manager::COLOR, |
| 1658 |
'selectors' => [ |
| 1659 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-trending-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1660 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-trending-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1661 |
], |
| 1662 |
'condition' => [ |
| 1663 |
'show_trending_badge' => 'yes', |
| 1664 |
'badge_border_border!' => '', |
| 1665 |
], |
| 1666 |
] |
| 1667 |
); |
| 1668 |
$this->end_controls_tab(); |
| 1669 |
$this->start_controls_tab( |
| 1670 |
'new_badge_tab', |
| 1671 |
[ |
| 1672 |
'label' => esc_html__('New', 'ultimate-store-kit'), |
| 1673 |
'condition' => [ |
| 1674 |
'show_new_badge' => 'yes', |
| 1675 |
], |
| 1676 |
] |
| 1677 |
); |
| 1678 |
$this->add_control( |
| 1679 |
'new_badge_color', |
| 1680 |
[ |
| 1681 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1682 |
'type' => Controls_Manager::COLOR, |
| 1683 |
'selectors' => [ |
| 1684 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-new-badge .usk-badge' => 'color: {{VALUE}}', |
| 1685 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-new-badge .usk-badge' => 'color: {{VALUE}}', |
| 1686 |
], |
| 1687 |
'condition' => [ |
| 1688 |
'show_new_badge' => 'yes', |
| 1689 |
], |
| 1690 |
] |
| 1691 |
); |
| 1692 |
|
| 1693 |
$this->add_group_control( |
| 1694 |
Group_Control_Background::get_type(), |
| 1695 |
[ |
| 1696 |
'name' => 'new_badge_bg', |
| 1697 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-new-badge .usk-badge, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-new-badge .usk-badge', |
| 1698 |
'condition' => [ |
| 1699 |
'show_new_badge' => 'yes', |
| 1700 |
], |
| 1701 |
] |
| 1702 |
); |
| 1703 |
|
| 1704 |
$this->add_control( |
| 1705 |
'new_badge_border_color', |
| 1706 |
[ |
| 1707 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1708 |
'type' => Controls_Manager::COLOR, |
| 1709 |
'selectors' => [ |
| 1710 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-new-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1711 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-new-badge .usk-badge' => 'border-color: {{VALUE}} !important;', |
| 1712 |
], |
| 1713 |
'condition' => [ |
| 1714 |
'show_new_badge' => 'yes', |
| 1715 |
'badge_border_border!' => '', |
| 1716 |
], |
| 1717 |
] |
| 1718 |
); |
| 1719 |
$this->end_controls_tab(); |
| 1720 |
$this->end_controls_tabs(); |
| 1721 |
$this->end_controls_section(); |
| 1722 |
|
| 1723 |
$this->start_controls_section( |
| 1724 |
'section_style_button', |
| 1725 |
[ |
| 1726 |
'label' => esc_html__('Add to Cart', 'ultimate-store-kit'), |
| 1727 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1728 |
'condition' => [ |
| 1729 |
'show_cart' => 'yes', |
| 1730 |
], |
| 1731 |
] |
| 1732 |
); |
| 1733 |
|
| 1734 |
$this->start_controls_tabs('tabs_button_style'); |
| 1735 |
|
| 1736 |
$this->start_controls_tab( |
| 1737 |
'tab_button_normal', |
| 1738 |
[ |
| 1739 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 1740 |
] |
| 1741 |
); |
| 1742 |
|
| 1743 |
$this->add_control( |
| 1744 |
'button_text_color', |
| 1745 |
[ |
| 1746 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1747 |
'type' => Controls_Manager::COLOR, |
| 1748 |
'default' => '', |
| 1749 |
'selectors' => [ |
| 1750 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-button' => 'color: {{VALUE}};', |
| 1751 |
'{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart' => 'color: {{VALUE}};', |
| 1752 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-button.loading::after' => 'border-color: {{VALUE}}', |
| 1753 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button' => 'color: {{VALUE}};', |
| 1754 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart' => 'color: {{VALUE}};', |
| 1755 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button.loading::after' => 'border-color: {{VALUE}}' |
| 1756 |
], |
| 1757 |
] |
| 1758 |
); |
| 1759 |
|
| 1760 |
$this->add_group_control( |
| 1761 |
Group_Control_Background::get_type(), |
| 1762 |
[ |
| 1763 |
'name' => 'btn_background_color', |
| 1764 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1765 |
'types' => ['classic', 'gradient'], |
| 1766 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart', |
| 1767 |
] |
| 1768 |
); |
| 1769 |
|
| 1770 |
$this->add_group_control( |
| 1771 |
Group_Control_Border::get_type(), |
| 1772 |
[ |
| 1773 |
'name' => 'btn_border', |
| 1774 |
'label' => esc_html__('Border', 'ultimate-store-kit'), |
| 1775 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart', |
| 1776 |
'separator' => 'before', |
| 1777 |
] |
| 1778 |
); |
| 1779 |
|
| 1780 |
$this->add_responsive_control( |
| 1781 |
'btn_border_radius', |
| 1782 |
[ |
| 1783 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 1784 |
'type' => Controls_Manager::DIMENSIONS, |
| 1785 |
'size_units' => ['px', '%'], |
| 1786 |
'selectors' => [ |
| 1787 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1788 |
'{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1789 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1790 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1791 |
], |
| 1792 |
] |
| 1793 |
); |
| 1794 |
|
| 1795 |
$this->add_responsive_control( |
| 1796 |
'button_width', |
| 1797 |
[ |
| 1798 |
'label' => esc_html__('Width(%)', 'ultimate-store-kit'), |
| 1799 |
'type' => Controls_Manager::SLIDER, |
| 1800 |
'range' => [ |
| 1801 |
'px' => [ |
| 1802 |
'min' => 10, |
| 1803 |
'max' => 100, |
| 1804 |
] |
| 1805 |
], |
| 1806 |
'selectors' => [ |
| 1807 |
'{{WRAPPER}} .' . $this->get_name() . '' => '--btn-width: {{SIZE}}%;', |
| 1808 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"]' => '--btn-width: {{SIZE}}% !important;', |
| 1809 |
], |
| 1810 |
] |
| 1811 |
); |
| 1812 |
|
| 1813 |
$this->add_responsive_control( |
| 1814 |
'button_height', |
| 1815 |
[ |
| 1816 |
'label' => esc_html__('Height(px)', 'ultimate-store-kit'), |
| 1817 |
'type' => Controls_Manager::SLIDER, |
| 1818 |
'range' => [ |
| 1819 |
'px' => [ |
| 1820 |
'min' => 10, |
| 1821 |
'max' => 100, |
| 1822 |
] |
| 1823 |
], |
| 1824 |
'selectors' => [ |
| 1825 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart' => 'height: {{SIZE}}px; line-height: {{SIZE}}px;', |
| 1826 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart' => 'height: {{SIZE}}px; line-height: {{SIZE}}px;', |
| 1827 |
], |
| 1828 |
] |
| 1829 |
); |
| 1830 |
|
| 1831 |
$this->add_group_control( |
| 1832 |
Group_Control_Typography::get_type(), |
| 1833 |
[ |
| 1834 |
'name' => 'button_typography', |
| 1835 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart', |
| 1836 |
] |
| 1837 |
); |
| 1838 |
$this->end_controls_tab(); |
| 1839 |
|
| 1840 |
$this->start_controls_tab( |
| 1841 |
'tab_button_hover', |
| 1842 |
[ |
| 1843 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1844 |
] |
| 1845 |
); |
| 1846 |
|
| 1847 |
$this->add_control( |
| 1848 |
'hover_color', |
| 1849 |
[ |
| 1850 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1851 |
'type' => Controls_Manager::COLOR, |
| 1852 |
'selectors' => [ |
| 1853 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-button:hover' => 'color: {{VALUE}};', |
| 1854 |
'{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart:hover' => 'color: {{VALUE}};', |
| 1855 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button:hover' => 'color: {{VALUE}};', |
| 1856 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart:hover' => 'color: {{VALUE}};', |
| 1857 |
], |
| 1858 |
] |
| 1859 |
); |
| 1860 |
|
| 1861 |
$this->add_group_control( |
| 1862 |
Group_Control_Background::get_type(), |
| 1863 |
[ |
| 1864 |
'name' => 'btn_hover_bg', |
| 1865 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1866 |
'types' => ['classic', 'gradient'], |
| 1867 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-button:hover, {{WRAPPER}} .' . $this->get_name() . ' .added_to_cart:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button:hover, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart:hover', |
| 1868 |
] |
| 1869 |
); |
| 1870 |
|
| 1871 |
$this->add_control( |
| 1872 |
'button_hover_border_color', |
| 1873 |
[ |
| 1874 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1875 |
'type' => Controls_Manager::COLOR, |
| 1876 |
'condition' => [ |
| 1877 |
'btn_border_border!' => '', |
| 1878 |
], |
| 1879 |
'selectors' => [ |
| 1880 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-button:hover' => 'border-color: {{VALUE}};', |
| 1881 |
'{{WRAPPER}} .' . $this->get_name() . ' .added_to_cart:hover' => 'border-color: {{VALUE}};', |
| 1882 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-button:hover' => 'border-color: {{VALUE}};', |
| 1883 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .added_to_cart:hover' => 'border-color: {{VALUE}};', |
| 1884 |
], |
| 1885 |
] |
| 1886 |
); |
| 1887 |
$this->end_controls_tab(); |
| 1888 |
$this->end_controls_tabs(); |
| 1889 |
$this->end_controls_section(); |
| 1890 |
|
| 1891 |
$this->start_controls_section( |
| 1892 |
'style_action_btn', |
| 1893 |
[ |
| 1894 |
'label' => esc_html__('Action Button', 'ultimate-store-kit'), |
| 1895 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1896 |
'conditions' => [ |
| 1897 |
'relation' => 'or', |
| 1898 |
'terms' => [ |
| 1899 |
[ |
| 1900 |
'name' => 'show_cart', |
| 1901 |
'value' => 'yes' |
| 1902 |
], |
| 1903 |
[ |
| 1904 |
'name' => 'show_wishlist', |
| 1905 |
'value' => 'yes' |
| 1906 |
], |
| 1907 |
[ |
| 1908 |
'name' => 'show_quick_view', |
| 1909 |
'value' => 'yes' |
| 1910 |
], |
| 1911 |
[ |
| 1912 |
'name' => 'show_compare', |
| 1913 |
'value' => 'yes' |
| 1914 |
] |
| 1915 |
] |
| 1916 |
] |
| 1917 |
] |
| 1918 |
); |
| 1919 |
$this->add_group_control( |
| 1920 |
Group_Control_Border::get_type(), |
| 1921 |
[ |
| 1922 |
'name' => 'action_btn_border', |
| 1923 |
'label' => esc_html__('Border', 'ultimate-store-kit'), |
| 1924 |
'selector' => '{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a, .tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a', |
| 1925 |
'separator' => 'before' |
| 1926 |
] |
| 1927 |
); |
| 1928 |
$this->add_responsive_control( |
| 1929 |
'action_btn_radius', |
| 1930 |
[ |
| 1931 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 1932 |
'type' => Controls_Manager::DIMENSIONS, |
| 1933 |
'size_units' => ['px', '%', 'em'], |
| 1934 |
'selectors' => [ |
| 1935 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1936 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1937 |
], |
| 1938 |
] |
| 1939 |
); |
| 1940 |
$this->add_responsive_control( |
| 1941 |
'action_btn_padding', |
| 1942 |
[ |
| 1943 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 1944 |
'type' => Controls_Manager::DIMENSIONS, |
| 1945 |
'size_units' => ['px', '%', 'em'], |
| 1946 |
'selectors' => [ |
| 1947 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1948 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1949 |
], |
| 1950 |
] |
| 1951 |
); |
| 1952 |
$this->add_responsive_control( |
| 1953 |
'action_btn_margin', |
| 1954 |
[ |
| 1955 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 1956 |
'type' => Controls_Manager::DIMENSIONS, |
| 1957 |
'size_units' => ['px', '%', 'em'], |
| 1958 |
'selectors' => [ |
| 1959 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1960 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1961 |
], |
| 1962 |
] |
| 1963 |
); |
| 1964 |
$this->add_responsive_control( |
| 1965 |
'action_btn_size', |
| 1966 |
[ |
| 1967 |
'label' => __('Icon Size', 'ultimate-store-kit'), |
| 1968 |
'type' => Controls_Manager::SLIDER, |
| 1969 |
'size_units' => ['px'], |
| 1970 |
'range' => [ |
| 1971 |
'px' => [ |
| 1972 |
'min' => 0, |
| 1973 |
'max' => 50, |
| 1974 |
'step' => 1, |
| 1975 |
] |
| 1976 |
], |
| 1977 |
'selectors' => [ |
| 1978 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a .icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1979 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a .icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1980 |
], |
| 1981 |
] |
| 1982 |
); |
| 1983 |
$this->add_control( |
| 1984 |
'font_family', |
| 1985 |
[ |
| 1986 |
'label' => esc_html__('Tooltip Font', 'ultimate-store-kit'), |
| 1987 |
'type' => Controls_Manager::FONT, |
| 1988 |
'selectors' => [ |
| 1989 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping a' => 'font-family: {{VALUE}}', |
| 1990 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping a' => 'font-family: {{VALUE}}', |
| 1991 |
], |
| 1992 |
] |
| 1993 |
); |
| 1994 |
$this->start_controls_tabs( |
| 1995 |
'action_btn_tabs' |
| 1996 |
); |
| 1997 |
$this->start_controls_tab( |
| 1998 |
'wishlist_tab', |
| 1999 |
[ |
| 2000 |
'label' => esc_html__('Wishlist', 'ultimate-store-kit'), |
| 2001 |
'condition' => [ |
| 2002 |
'show_wishlist' => 'yes' |
| 2003 |
] |
| 2004 |
] |
| 2005 |
); |
| 2006 |
$this->add_control( |
| 2007 |
'wishlist_normal_color', |
| 2008 |
[ |
| 2009 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2010 |
'type' => Controls_Manager::COLOR, |
| 2011 |
'selectors' => [ |
| 2012 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist' => 'color: {{VALUE}}', |
| 2013 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist' => 'color: {{VALUE}}', |
| 2014 |
], |
| 2015 |
] |
| 2016 |
); |
| 2017 |
$this->add_control( |
| 2018 |
'wishlist_icon_bg', |
| 2019 |
[ |
| 2020 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2021 |
'type' => Controls_Manager::COLOR, |
| 2022 |
'selectors' => [ |
| 2023 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist' => 'background: {{VALUE}}', |
| 2024 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist' => 'background: {{VALUE}}', |
| 2025 |
], |
| 2026 |
] |
| 2027 |
); |
| 2028 |
|
| 2029 |
$this->add_control( |
| 2030 |
'wishlist_border_color', |
| 2031 |
[ |
| 2032 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2033 |
'type' => Controls_Manager::COLOR, |
| 2034 |
'selectors' => [ |
| 2035 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist' => 'border-color: {{VALUE}} !important;', |
| 2036 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist' => 'border-color: {{VALUE}} !important;', |
| 2037 |
], |
| 2038 |
'condition' => [ |
| 2039 |
'action_btn_border_border!' => '' |
| 2040 |
] |
| 2041 |
] |
| 2042 |
); |
| 2043 |
$this->add_control( |
| 2044 |
'heading_wishlist_hover', |
| 2045 |
[ |
| 2046 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 2047 |
'type' => Controls_Manager::HEADING, |
| 2048 |
'separator' => 'before', |
| 2049 |
] |
| 2050 |
); |
| 2051 |
$this->add_control( |
| 2052 |
'wishlist_hover_color', |
| 2053 |
[ |
| 2054 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2055 |
'type' => Controls_Manager::COLOR, |
| 2056 |
'selectors' => [ |
| 2057 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist:hover' => 'color: {{VALUE}}', |
| 2058 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist:hover' => 'color: {{VALUE}}', |
| 2059 |
], |
| 2060 |
] |
| 2061 |
); |
| 2062 |
$this->add_control( |
| 2063 |
'wishlist_icon_hover_bg', |
| 2064 |
[ |
| 2065 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2066 |
'type' => Controls_Manager::COLOR, |
| 2067 |
'selectors' => [ |
| 2068 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist:hover' => 'background: {{VALUE}}', |
| 2069 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist:hover' => 'background: {{VALUE}}', |
| 2070 |
], |
| 2071 |
] |
| 2072 |
); |
| 2073 |
|
| 2074 |
$this->add_control( |
| 2075 |
'wishlist_border_hover_color', |
| 2076 |
[ |
| 2077 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2078 |
'type' => Controls_Manager::COLOR, |
| 2079 |
'selectors' => [ |
| 2080 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist:hover' => 'border-color: {{VALUE}} !important;', |
| 2081 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist:hover' => 'border-color: {{VALUE}} !important;', |
| 2082 |
], |
| 2083 |
'condition' => [ |
| 2084 |
'action_btn_border_border!' => '' |
| 2085 |
] |
| 2086 |
] |
| 2087 |
); |
| 2088 |
|
| 2089 |
$this->add_control( |
| 2090 |
'heading_wishlist_active', |
| 2091 |
[ |
| 2092 |
'label' => esc_html__('Active', 'ultimate-store-kit'), |
| 2093 |
'type' => Controls_Manager::HEADING, |
| 2094 |
'separator' => 'before', |
| 2095 |
] |
| 2096 |
); |
| 2097 |
$this->add_control( |
| 2098 |
'wishlist_active_color', |
| 2099 |
[ |
| 2100 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2101 |
'type' => Controls_Manager::COLOR, |
| 2102 |
'selectors' => [ |
| 2103 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'color: {{VALUE}}', |
| 2104 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'color: {{VALUE}}', |
| 2105 |
], |
| 2106 |
] |
| 2107 |
); |
| 2108 |
$this->add_control( |
| 2109 |
'wishlist_active_bg', |
| 2110 |
[ |
| 2111 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2112 |
'type' => Controls_Manager::COLOR, |
| 2113 |
'selectors' => [ |
| 2114 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'background: {{VALUE}}', |
| 2115 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'background: {{VALUE}}', |
| 2116 |
], |
| 2117 |
] |
| 2118 |
); |
| 2119 |
$this->add_control( |
| 2120 |
'wishlist_active_border_color', |
| 2121 |
[ |
| 2122 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2123 |
'type' => Controls_Manager::COLOR, |
| 2124 |
'selectors' => [ |
| 2125 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'border-color: {{VALUE}} !important;', |
| 2126 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-wishlist.usk-active' => 'border-color: {{VALUE}} !important;', |
| 2127 |
], |
| 2128 |
'condition' => [ |
| 2129 |
'action_btn_border_border!' => '' |
| 2130 |
] |
| 2131 |
] |
| 2132 |
); |
| 2133 |
$this->end_controls_tab(); |
| 2134 |
$this->start_controls_tab( |
| 2135 |
'compare_tab', |
| 2136 |
[ |
| 2137 |
'label' => esc_html__('Compare', 'ultimate-store-kit'), |
| 2138 |
'condition' => [ |
| 2139 |
'show_compare' => 'yes' |
| 2140 |
] |
| 2141 |
] |
| 2142 |
); |
| 2143 |
$this->add_control( |
| 2144 |
'compare_color', |
| 2145 |
[ |
| 2146 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2147 |
'type' => Controls_Manager::COLOR, |
| 2148 |
'selectors' => [ |
| 2149 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare' => 'color: {{VALUE}}', |
| 2150 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare' => 'color: {{VALUE}}', |
| 2151 |
], |
| 2152 |
] |
| 2153 |
); |
| 2154 |
$this->add_control( |
| 2155 |
'compare_icon_bg', |
| 2156 |
[ |
| 2157 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2158 |
'type' => Controls_Manager::COLOR, |
| 2159 |
'selectors' => [ |
| 2160 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare' => 'background: {{VALUE}}', |
| 2161 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare' => 'background: {{VALUE}}', |
| 2162 |
], |
| 2163 |
] |
| 2164 |
); |
| 2165 |
$this->add_control( |
| 2166 |
'compare_border_color', |
| 2167 |
[ |
| 2168 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2169 |
'type' => Controls_Manager::COLOR, |
| 2170 |
'selectors' => [ |
| 2171 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare' => 'border-color: {{VALUE}} !important;', |
| 2172 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare' => 'border-color: {{VALUE}} !important;', |
| 2173 |
], |
| 2174 |
'condition' => [ |
| 2175 |
'action_btn_border_border!' => '' |
| 2176 |
] |
| 2177 |
] |
| 2178 |
); |
| 2179 |
$this->add_control( |
| 2180 |
'heading_compare_hover', |
| 2181 |
[ |
| 2182 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 2183 |
'type' => Controls_Manager::HEADING, |
| 2184 |
'separator' => 'before', |
| 2185 |
] |
| 2186 |
); |
| 2187 |
$this->add_control( |
| 2188 |
'compare_color_hover', |
| 2189 |
[ |
| 2190 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2191 |
'type' => Controls_Manager::COLOR, |
| 2192 |
'selectors' => [ |
| 2193 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare:hover' => 'color: {{VALUE}}', |
| 2194 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare:hover' => 'color: {{VALUE}}', |
| 2195 |
], |
| 2196 |
] |
| 2197 |
); |
| 2198 |
$this->add_control( |
| 2199 |
'compare_icon_bg_hover', |
| 2200 |
[ |
| 2201 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2202 |
'type' => Controls_Manager::COLOR, |
| 2203 |
'selectors' => [ |
| 2204 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare:hover' => 'background: {{VALUE}}', |
| 2205 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare:hover' => 'background: {{VALUE}}', |
| 2206 |
], |
| 2207 |
] |
| 2208 |
); |
| 2209 |
$this->add_control( |
| 2210 |
'compare_border_hover_color', |
| 2211 |
[ |
| 2212 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2213 |
'type' => Controls_Manager::COLOR, |
| 2214 |
'selectors' => [ |
| 2215 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare:hover' => 'border-color: {{VALUE}} !important;', |
| 2216 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare:hover' => 'border-color: {{VALUE}} !important;', |
| 2217 |
], |
| 2218 |
'condition' => [ |
| 2219 |
'action_btn_border_border!' => '' |
| 2220 |
] |
| 2221 |
] |
| 2222 |
); |
| 2223 |
$this->add_control( |
| 2224 |
'heading_compare_active', |
| 2225 |
[ |
| 2226 |
'label' => esc_html__('Active', 'ultimate-store-kit'), |
| 2227 |
'type' => Controls_Manager::HEADING, |
| 2228 |
'separator' => 'before', |
| 2229 |
] |
| 2230 |
); |
| 2231 |
$this->add_control( |
| 2232 |
'compare_color_active', |
| 2233 |
[ |
| 2234 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2235 |
'type' => Controls_Manager::COLOR, |
| 2236 |
'selectors' => [ |
| 2237 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare.usk-active' => 'color: {{VALUE}}', |
| 2238 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare.usk-active' => 'color: {{VALUE}}', |
| 2239 |
], |
| 2240 |
] |
| 2241 |
); |
| 2242 |
$this->add_control( |
| 2243 |
'compare_icon_bg_active', |
| 2244 |
[ |
| 2245 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2246 |
'type' => Controls_Manager::COLOR, |
| 2247 |
'selectors' => [ |
| 2248 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare.usk-active' => 'background: {{VALUE}}', |
| 2249 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare.usk-active' => 'background: {{VALUE}}', |
| 2250 |
], |
| 2251 |
] |
| 2252 |
); |
| 2253 |
$this->add_control( |
| 2254 |
'compare_border_active_color', |
| 2255 |
[ |
| 2256 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2257 |
'type' => Controls_Manager::COLOR, |
| 2258 |
'selectors' => [ |
| 2259 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-compare.usk-active' => 'border-color: {{VALUE}} !important;', |
| 2260 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-compare.usk-active' => 'border-color: {{VALUE}} !important;', |
| 2261 |
], |
| 2262 |
'condition' => [ |
| 2263 |
'action_btn_border_border!' => '' |
| 2264 |
] |
| 2265 |
] |
| 2266 |
); |
| 2267 |
$this->end_controls_tab(); |
| 2268 |
$this->start_controls_tab( |
| 2269 |
'quickview_tab', |
| 2270 |
[ |
| 2271 |
'label' => esc_html__('Quickview', 'ultimate-store-kit'), |
| 2272 |
'condition' => [ |
| 2273 |
'show_quick_view' => 'yes' |
| 2274 |
] |
| 2275 |
] |
| 2276 |
); |
| 2277 |
$this->add_control( |
| 2278 |
'quickview_color', |
| 2279 |
[ |
| 2280 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2281 |
'type' => Controls_Manager::COLOR, |
| 2282 |
'selectors' => [ |
| 2283 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview' => 'color: {{VALUE}}', |
| 2284 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview' => 'color: {{VALUE}}', |
| 2285 |
], |
| 2286 |
] |
| 2287 |
); |
| 2288 |
$this->add_control( |
| 2289 |
'quickview_icon_bg', |
| 2290 |
[ |
| 2291 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2292 |
'type' => Controls_Manager::COLOR, |
| 2293 |
'selectors' => [ |
| 2294 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview' => 'background: {{VALUE}}', |
| 2295 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview' => 'background: {{VALUE}}', |
| 2296 |
], |
| 2297 |
] |
| 2298 |
); |
| 2299 |
$this->add_control( |
| 2300 |
'quickview_border_color', |
| 2301 |
[ |
| 2302 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2303 |
'type' => Controls_Manager::COLOR, |
| 2304 |
'selectors' => [ |
| 2305 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview' => 'border-color: {{VALUE}} !important;', |
| 2306 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview' => 'border-color: {{VALUE}} !important;', |
| 2307 |
], |
| 2308 |
'condition' => [ |
| 2309 |
'action_btn_border_border!' => '' |
| 2310 |
] |
| 2311 |
] |
| 2312 |
); |
| 2313 |
$this->add_control( |
| 2314 |
'heading_quickview_hover', |
| 2315 |
[ |
| 2316 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 2317 |
'type' => Controls_Manager::HEADING, |
| 2318 |
'separator' => 'before', |
| 2319 |
] |
| 2320 |
); |
| 2321 |
$this->add_control( |
| 2322 |
'quickview_color_hover', |
| 2323 |
[ |
| 2324 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 2325 |
'type' => Controls_Manager::COLOR, |
| 2326 |
'selectors' => [ |
| 2327 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview:hover' => 'color: {{VALUE}}', |
| 2328 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview:hover' => 'color: {{VALUE}}', |
| 2329 |
], |
| 2330 |
] |
| 2331 |
); |
| 2332 |
$this->add_control( |
| 2333 |
'quickview_icon_bg_hover', |
| 2334 |
[ |
| 2335 |
'label' => esc_html__('Background Color', 'ultimate-store-kit'), |
| 2336 |
'type' => Controls_Manager::COLOR, |
| 2337 |
'selectors' => [ |
| 2338 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview:hover' => 'background: {{VALUE}}', |
| 2339 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview:hover' => 'background: {{VALUE}}', |
| 2340 |
], |
| 2341 |
] |
| 2342 |
); |
| 2343 |
$this->add_control( |
| 2344 |
'quickview_border_hover_color', |
| 2345 |
[ |
| 2346 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 2347 |
'type' => Controls_Manager::COLOR, |
| 2348 |
'selectors' => [ |
| 2349 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-shoping .usk-shoping-icon-quickview:hover' => 'border-color: {{VALUE}} !important;', |
| 2350 |
'.tippy-box[data-theme="bdt-tippy-image-hotspot-{{ID}}"] .usk-item .usk-shoping .usk-shoping-icon-quickview:hover' => 'border-color: {{VALUE}} !important;', |
| 2351 |
], |
| 2352 |
'condition' => [ |
| 2353 |
'action_btn_border_border!' => '' |
| 2354 |
] |
| 2355 |
] |
| 2356 |
); |
| 2357 |
$this->end_controls_tab(); |
| 2358 |
$this->end_controls_tabs(); |
| 2359 |
$this->end_controls_section(); |
| 2360 |
} |
| 2361 |
|
| 2362 |
public function render_add_to_cart() { |
| 2363 |
global $product; |
| 2364 |
$settings = $this->get_settings_for_display(); |
| 2365 |
if ('yes' == $settings['show_cart']) : ?> |
| 2366 |
<?php if ($product) { |
| 2367 |
$defaults = [ |
| 2368 |
'quantity' => 1, |
| 2369 |
'class' => implode( |
| 2370 |
' ', |
| 2371 |
array_filter( |
| 2372 |
[ |
| 2373 |
'usk-button', |
| 2374 |
'product_type_' . $product->get_type(), |
| 2375 |
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '', |
| 2376 |
$product->supports('ajax_add_to_cart') && $product->is_purchasable() && $product->is_in_stock() ? 'ajax_add_to_cart' : '', |
| 2377 |
] |
| 2378 |
) |
| 2379 |
), |
| 2380 |
'attributes' => [ |
| 2381 |
'data-product_id' => $product->get_id(), |
| 2382 |
'data-product_sku' => $product->get_sku(), |
| 2383 |
'aria-label' => $product->add_to_cart_description(), |
| 2384 |
'rel' => 'nofollow', |
| 2385 |
], |
| 2386 |
]; |
| 2387 |
$args = apply_filters('woocommerce_loop_add_to_cart_args', wp_parse_args($defaults), $product); |
| 2388 |
if (isset($args['attributes']['aria-label'])) { |
| 2389 |
$args['attributes']['aria-label'] = wp_strip_all_tags($args['attributes']['aria-label']); |
| 2390 |
} |
| 2391 |
echo wp_kses_post(apply_filters( |
| 2392 |
'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok. |
| 2393 |
sprintf( |
| 2394 |
'<a href="%s" data-quantity="%s" class="%s" %s>%s <i class="button-icon usk-icon-arrow-right-8"></i></a>', |
| 2395 |
esc_url($product->add_to_cart_url()), |
| 2396 |
esc_attr(isset($args['quantity']) ? $args['quantity'] : 1), |
| 2397 |
esc_attr(isset($args['class']) ? $args['class'] : 'button'), |
| 2398 |
isset($args['attributes']) ? wc_implode_html_attributes($args['attributes']) : '', |
| 2399 |
esc_html($product->add_to_cart_text()) |
| 2400 |
), |
| 2401 |
$product, |
| 2402 |
$args |
| 2403 |
)); |
| 2404 |
}; ?> |
| 2405 |
<?php endif; |
| 2406 |
} |
| 2407 |
|
| 2408 |
public function render_image() { |
| 2409 |
global $product; |
| 2410 |
$tooltip_position = 'left'; |
| 2411 |
$settings = $this->get_settings_for_display(); |
| 2412 |
|
| 2413 |
$thumbnail_size = $settings['thumbnail_size']; |
| 2414 |
|
| 2415 |
$gallery_thumbs = $product->get_gallery_image_ids(); |
| 2416 |
$product_image = wp_get_attachment_image_url(get_post_thumbnail_id(), $thumbnail_size); |
| 2417 |
|
| 2418 |
// if product image is empty, use placeholder |
| 2419 |
if (empty($product_image)) { |
| 2420 |
$product_image = wc_placeholder_img_src('full'); |
| 2421 |
} |
| 2422 |
|
| 2423 |
if ($gallery_thumbs) { |
| 2424 |
foreach ($gallery_thumbs as $key => $gallery_thumb) { |
| 2425 |
if ($key == 0) : |
| 2426 |
$gallery_image_link = wp_get_attachment_image_url($gallery_thumb, $thumbnail_size); |
| 2427 |
endif; |
| 2428 |
} |
| 2429 |
} else { |
| 2430 |
$gallery_image_link = wp_get_attachment_image_url(get_post_thumbnail_id(), $thumbnail_size); |
| 2431 |
} |
| 2432 |
?> |
| 2433 |
<div class="usk-image"> |
| 2434 |
<a href="<?php echo esc_url(get_permalink()); ?>"> |
| 2435 |
<img class="img image-default" src="<?php echo esc_url($product_image); ?>" alt="<?php echo esc_attr(get_the_title()); ?>"> |
| 2436 |
<img class="img image-hover" src="<?php echo esc_url($gallery_image_link); ?>" alt="<?php echo esc_attr(get_the_title()); ?>"> |
| 2437 |
</a> |
| 2438 |
<?php $this->render_add_to_cart(); ?> |
| 2439 |
<div class="usk-shoping"> |
| 2440 |
<?php $this->register_global_template_add_to_wishlist($tooltip_position, $settings); ?> |
| 2441 |
<?php $this->register_global_template_add_to_compare($tooltip_position, $settings); ?> |
| 2442 |
<?php $this->register_global_template_quick_view($product->get_id(), $tooltip_position, $settings); ?> |
| 2443 |
</div> |
| 2444 |
<div class="usk-badge-label-wrapper"> |
| 2445 |
<div class="usk-badge-label-content usk-flex usk-flex-column"> |
| 2446 |
<?php $this->register_global_template_badge_label($settings); ?> |
| 2447 |
</div> |
| 2448 |
</div> |
| 2449 |
</div> |
| 2450 |
<?php |
| 2451 |
} |
| 2452 |
|
| 2453 |
public function render_slider_header() { |
| 2454 |
$settings = $this->get_settings_for_display(); |
| 2455 |
$this->add_render_attribute('image-hotspot', 'class', ['usk-image-hotspot usk-grid-carousel']); |
| 2456 |
$id = 'image-hotspot-' . $this->get_id(); |
| 2457 |
|
| 2458 |
$this->add_render_attribute('image-hotspot', 'id', $id); |
| 2459 |
|
| 2460 |
$this->add_render_attribute( |
| 2461 |
[ |
| 2462 |
'image-hotspot' => [ |
| 2463 |
'data-settings' => [ |
| 2464 |
wp_json_encode(array_filter([ |
| 2465 |
'id' => $id, |
| 2466 |
"slidesPerView" => isset($settings['product_limit']) ? $settings['product_limit'] : 3, |
| 2467 |
"watchSlidesProgress" => true, |
| 2468 |
"sliderEffect" => isset($settings["swiper_effect"]) ? $settings["swiper_effect"] : 'slide', |
| 2469 |
"image_hotspot_layout" => isset($settings['image_hotspot_layout']) ? $settings['image_hotspot_layout'] : 'slider', |
| 2470 |
])), |
| 2471 |
], |
| 2472 |
], |
| 2473 |
] |
| 2474 |
); |
| 2475 |
?> |
| 2476 |
<div class="ultimate-store-kit"> |
| 2477 |
<div <?php $this->print_render_attribute_string('image-hotspot'); ?>> |
| 2478 |
<?php if ($settings['image_hotspot_layout'] == 'slider') : ?> |
| 2479 |
<div class="swiper usk-image-hotspot-main"> |
| 2480 |
<div class="swiper-wrapper"> |
| 2481 |
<?php endif; |
| 2482 |
} |
| 2483 |
|
| 2484 |
public function render_slider_footer() { |
| 2485 |
$settings = $this->get_settings_for_display(); |
| 2486 |
|
| 2487 |
if ($settings['image_hotspot_layout'] == 'slider') { |
| 2488 |
$this->add_render_attribute('thumbs', 'class', 'usk-image-hotspot-thumbs swiper'); |
| 2489 |
} else { |
| 2490 |
$this->add_render_attribute('thumbs', 'class', 'usk-image-hotspot-thumbs'); |
| 2491 |
} |
| 2492 |
|
| 2493 |
?> |
| 2494 |
<?php if ($settings['image_hotspot_layout'] == 'slider') : ?> |
| 2495 |
</div> |
| 2496 |
</div> |
| 2497 |
<?php endif; ?> |
| 2498 |
|
| 2499 |
<!-- thumbsslider --> |
| 2500 |
<div thumbsSlider="" <?php $this->print_render_attribute_string('thumbs'); ?>> |
| 2501 |
<?php |
| 2502 |
$image_size = $settings['image_resolution_size']; |
| 2503 |
$placeholder_image_src = \Elementor\Utils::get_placeholder_image_src(); |
| 2504 |
$image_src = wp_get_attachment_image_src($settings['hotspot_image']['id'], $image_size); |
| 2505 |
if (! $image_src) { |
| 2506 |
printf('<img src="%1$s" alt="%2$s">', esc_url($placeholder_image_src), esc_attr(get_the_title())); |
| 2507 |
} else { |
| 2508 |
print(wp_get_attachment_image( |
| 2509 |
$settings['hotspot_image']['id'], |
| 2510 |
$image_size, |
| 2511 |
false, |
| 2512 |
[ |
| 2513 |
|
| 2514 |
'alt' => esc_attr(get_the_title()) |
| 2515 |
] |
| 2516 |
)); |
| 2517 |
} |
| 2518 |
?> |
| 2519 |
<div class="swiper-wrapper"> |
| 2520 |
<?php $this->render_thumbs_item(); ?> |
| 2521 |
</div> |
| 2522 |
</div> |
| 2523 |
<!-- thumbsslider --> |
| 2524 |
</div> |
| 2525 |
</div> |
| 2526 |
<?php |
| 2527 |
} |
| 2528 |
|
| 2529 |
public function print_price_output($output) { |
| 2530 |
$tags = [ |
| 2531 |
'del' => ['aria-hidden' => []], |
| 2532 |
'span' => ['class' => []], |
| 2533 |
'bdi' => [], |
| 2534 |
'ins' => [], |
| 2535 |
]; |
| 2536 |
|
| 2537 |
if (isset($output)) { |
| 2538 |
echo wp_kses($output, $tags); |
| 2539 |
} |
| 2540 |
} |
| 2541 |
|
| 2542 |
public function render_product_content() { |
| 2543 |
$settings = $this->get_settings_for_display(); |
| 2544 |
|
| 2545 |
global $product; |
| 2546 |
$rating_count = $product->get_rating_count(); |
| 2547 |
$average = $product->get_average_rating(); |
| 2548 |
$have_rating = ('yes' === $settings['show_rating']) ? 'usk-have-rating' : ''; |
| 2549 |
$categories = str_replace(',', '', wc_get_product_category_list($product->get_id())); |
| 2550 |
|
| 2551 |
?> |
| 2552 |
<div class="swiper-slide usk-item <?php echo esc_attr($have_rating); ?>"> |
| 2553 |
<div class="usk-item-box"> |
| 2554 |
<?php $this->render_image(); ?> |
| 2555 |
<div class="usk-content"> |
| 2556 |
<div class="usk-content-inner"> |
| 2557 |
<?php if ('yes' == $settings['show_category']) : ?> |
| 2558 |
<div class="usk-category"> |
| 2559 |
<?php echo wp_kses_post(wc_get_product_category_list($product->get_id(), ' ')); ?> |
| 2560 |
</div> |
| 2561 |
<?php endif; ?> |
| 2562 |
<?php if ('yes' == $settings['show_title']) : ?> |
| 2563 |
<?php printf( |
| 2564 |
'<a href="%2$s" class="usk-title"><%1$s class="title">%3$s</%1$s></a>', |
| 2565 |
esc_attr(Utils::get_valid_html_tag($settings['title_tags'])), |
| 2566 |
esc_url($product->get_permalink()), |
| 2567 |
esc_html($product->get_title()) |
| 2568 |
); ?> |
| 2569 |
<?php endif; ?> |
| 2570 |
<?php if ('yes' == $settings['show_price']) : ?> |
| 2571 |
<div class="usk-price"> |
| 2572 |
<?php $this->print_price_output($product->get_price_html()); ?> |
| 2573 |
</div> |
| 2574 |
<?php endif; ?> |
| 2575 |
<?php if ('yes' == $settings['show_rating']) : ?> |
| 2576 |
<div class="usk-rating"> |
| 2577 |
<span><?php echo wp_kses_post($this->register_global_template_wc_rating($average, $rating_count)); ?></span> |
| 2578 |
</div> |
| 2579 |
<?php endif; ?> |
| 2580 |
</div> |
| 2581 |
</div> |
| 2582 |
</div> |
| 2583 |
</div> |
| 2584 |
|
| 2585 |
<?php |
| 2586 |
} |
| 2587 |
|
| 2588 |
public function render_tooltip_product_content() { |
| 2589 |
ob_start(); |
| 2590 |
$html = ''; |
| 2591 |
$this->render_product_content(); |
| 2592 |
$html .= ob_get_clean(); |
| 2593 |
return $html; |
| 2594 |
} |
| 2595 |
|
| 2596 |
public function render_loop_item() { |
| 2597 |
$settings = $this->get_settings_for_display(); |
| 2598 |
|
| 2599 |
$this->query_product(); |
| 2600 |
$wp_query = $this->get_query(); |
| 2601 |
|
| 2602 |
if ($wp_query->have_posts()) { ?> |
| 2603 |
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); |
| 2604 |
|
| 2605 |
|
| 2606 |
?> |
| 2607 |
<?php $this->render_product_content(); ?> |
| 2608 |
<?php endwhile; |
| 2609 |
wp_reset_postdata(); |
| 2610 |
} else { |
| 2611 |
echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>'; |
| 2612 |
} |
| 2613 |
} |
| 2614 |
|
| 2615 |
public function render_thumbs_image() { |
| 2616 |
global $product; |
| 2617 |
$settings = $this->get_settings_for_display(); |
| 2618 |
$product_image = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['thumbnail_size']); |
| 2619 |
|
| 2620 |
// if product image is empty, use placeholder |
| 2621 |
if (empty($product_image)) { |
| 2622 |
$product_image = wc_placeholder_img_src('full'); |
| 2623 |
} |
| 2624 |
?> |
| 2625 |
<div class="usk-image-wrap"> |
| 2626 |
<img class="usk-img" src="<?php echo esc_url($product_image); ?>" alt="<?php echo esc_attr(get_the_title()); ?>"> |
| 2627 |
</div> |
| 2628 |
<?php |
| 2629 |
} |
| 2630 |
|
| 2631 |
public function render_thumbs_item() { |
| 2632 |
$settings = $this->get_settings_for_display(); |
| 2633 |
|
| 2634 |
$hotspots = $settings['markers']; // Retrieve hotspots |
| 2635 |
$unique_ids = []; // Initialize an array to store unique IDs |
| 2636 |
if ($hotspots) { |
| 2637 |
foreach ($hotspots as $hotspot) { |
| 2638 |
$unique_ids[] = $hotspot['_id']; // Collect unique IDs |
| 2639 |
} |
| 2640 |
} |
| 2641 |
|
| 2642 |
$this->query_product(); |
| 2643 |
$wp_query = $this->get_query(); |
| 2644 |
|
| 2645 |
if ($wp_query->have_posts()) { |
| 2646 |
$index = 0; |
| 2647 |
|
| 2648 |
while ($wp_query->have_posts()): $wp_query->the_post(); |
| 2649 |
global $product; |
| 2650 |
|
| 2651 |
|
| 2652 |
$unique_id_class = isset($unique_ids[$index]) ? esc_attr($unique_ids[$index]) : ''; |
| 2653 |
|
| 2654 |
if ($settings['image_hotspot_layout'] == 'tooltip') { |
| 2655 |
$marker_title = $this->render_tooltip_product_content(); |
| 2656 |
|
| 2657 |
$this->add_render_attribute('marker', 'class', 'usk-thumbs-item elementor-repeater-item-' . esc_attr($unique_id_class), true); |
| 2658 |
|
| 2659 |
$this->add_render_attribute('marker', 'data-tippy-content', $marker_title, true); |
| 2660 |
|
| 2661 |
$this->add_render_attribute('marker', 'class', 'bdt-tippy-tooltip'); |
| 2662 |
$this->add_render_attribute('marker', 'data-tippy', '', true); |
| 2663 |
|
| 2664 |
if ($settings['marker_tooltip_animation']) { |
| 2665 |
$this->add_render_attribute('marker', 'data-tippy-animation', $settings['marker_tooltip_animation'], true); |
| 2666 |
} |
| 2667 |
|
| 2668 |
if ($settings['marker_tooltip_x_offset']['size'] or $settings['marker_tooltip_y_offset']['size']) { |
| 2669 |
$this->add_render_attribute('marker', 'data-tippy-offset', '[' . $settings['marker_tooltip_x_offset']['size'] . ',' . $settings['marker_tooltip_y_offset']['size'] . ']', true); |
| 2670 |
} |
| 2671 |
|
| 2672 |
if ('yes' == $settings['marker_tooltip_arrow']) { |
| 2673 |
$this->add_render_attribute('marker', 'data-tippy-arrow', 'true', true); |
| 2674 |
} else { |
| 2675 |
$this->add_render_attribute('marker', 'data-tippy-arrow', 'false', true); |
| 2676 |
} |
| 2677 |
|
| 2678 |
if ('yes' == $settings['marker_tooltip_trigger']) { |
| 2679 |
$this->add_render_attribute('marker', 'data-tippy-trigger', 'click', true); |
| 2680 |
} |
| 2681 |
|
| 2682 |
if ($settings['marker_tooltip_placement']) { |
| 2683 |
$this->add_render_attribute('marker', 'data-tippy-placement', $settings['marker_tooltip_placement'], true); |
| 2684 |
} |
| 2685 |
} else { |
| 2686 |
$this->add_render_attribute('marker', 'class', 'swiper-slide usk-thumbs-item elementor-repeater-item-' . esc_attr($unique_id_class), true); |
| 2687 |
} |
| 2688 |
|
| 2689 |
?> |
| 2690 |
<div <?php echo $this->get_render_attribute_string('marker'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Elementor escapes render attributes. ?>> |
| 2691 |
<div class="usk-thumbs-box"> |
| 2692 |
<?php if ($settings['hotspot_type'] == 'image') : ?> |
| 2693 |
<?php $this->render_thumbs_image(); ?> |
| 2694 |
<?php else : ?> |
| 2695 |
<?php if ($settings['hotspot_icon']['value']) : ?> |
| 2696 |
<?php Icons_Manager::render_icon($settings['hotspot_icon'], ['aria-hidden' => 'true']); ?> |
| 2697 |
<?php else : ?> |
| 2698 |
<i class="usk-icon-plus-2" aria-hidden="true"></i> |
| 2699 |
<?php endif; ?> |
| 2700 |
<?php endif; ?> |
| 2701 |
</div> |
| 2702 |
</div> |
| 2703 |
<?php |
| 2704 |
$index++; |
| 2705 |
endwhile; |
| 2706 |
|
| 2707 |
wp_reset_postdata(); |
| 2708 |
} else { |
| 2709 |
echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>'; |
| 2710 |
} |
| 2711 |
} |
| 2712 |
|
| 2713 |
public function render() { |
| 2714 |
$settings = $this->get_settings_for_display(); |
| 2715 |
|
| 2716 |
$this->render_slider_header(); |
| 2717 |
|
| 2718 |
if ($settings['image_hotspot_layout'] == 'slider') { |
| 2719 |
$this->render_loop_item(); |
| 2720 |
} |
| 2721 |
|
| 2722 |
$this->render_slider_footer(); |
| 2723 |
} |
| 2724 |
public function query_product() { |
| 2725 |
$default = $this->getGroupControlQueryArgs(); |
| 2726 |
$this->_query = new WP_Query($default); |
| 2727 |
} |
| 2728 |
} |
| 2729 |
|