| 1 |
<?php |
| 2 |
|
| 3 |
namespace UltimateStoreKit\Modules\MentorSlider\Widgets; |
| 4 |
|
| 5 |
|
| 6 |
use Elementor\Controls_Manager; |
| 7 |
use UltimateStoreKit\Base\Module_Base; |
| 8 |
use Elementor\Group_Control_Border; |
| 9 |
use Elementor\Group_Control_Background; |
| 10 |
use Elementor\Group_Control_Box_Shadow; |
| 11 |
use Elementor\Group_Control_Image_Size; |
| 12 |
use Elementor\Group_Control_Text_Shadow; |
| 13 |
use Elementor\Group_Control_Text_Stroke; |
| 14 |
use Elementor\Group_Control_Typography; |
| 15 |
use UltimateStoreKit\traits\Global_Widget_Controls; |
| 16 |
use UltimateStoreKit\traits\Global_Widget_Template; |
| 17 |
use UltimateStoreKit\Includes\Controls\GroupQuery\Group_Control_Query; |
| 18 |
use UltimateStoreKit\Classes\Utils; |
| 19 |
use WP_Query; |
| 20 |
|
| 21 |
if (!defined('ABSPATH')) { |
| 22 |
exit; |
| 23 |
} |
| 24 |
|
| 25 |
// Exit if accessed directly |
| 26 |
|
| 27 |
class Mentor_Slider extends Module_Base { |
| 28 |
use Global_Widget_Controls; |
| 29 |
use Global_Widget_Template; |
| 30 |
use Group_Control_Query; |
| 31 |
|
| 32 |
/** |
| 33 |
* @var \WP_Query |
| 34 |
*/ |
| 35 |
private $_query = null; |
| 36 |
public function get_name() { |
| 37 |
return 'usk-mentor-slider'; |
| 38 |
} |
| 39 |
|
| 40 |
public function get_title() { |
| 41 |
return esc_html__('Mentor Slider', 'ultimate-store-kit'); |
| 42 |
} |
| 43 |
|
| 44 |
public function get_icon() { |
| 45 |
return 'usk-widget-icon usk-icon-mentor-slider usk-new'; |
| 46 |
} |
| 47 |
|
| 48 |
public function get_categories() { |
| 49 |
return ['ultimate-store-kit']; |
| 50 |
} |
| 51 |
|
| 52 |
public function get_keywords() { |
| 53 |
return ['product', 'product-grid', 'table', 'wc']; |
| 54 |
} |
| 55 |
|
| 56 |
public function get_script_depends() { |
| 57 |
if ($this->usk_is_edit_mode()) { |
| 58 |
return ['swiper', 'micromodal', 'usk-site']; |
| 59 |
} else { |
| 60 |
return ['swiper', 'micromodal', 'usk-mentor-slider']; |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
public function get_style_depends() { |
| 65 |
if ($this->usk_is_edit_mode()) { |
| 66 |
return ['swiper', 'usk-all-styles']; |
| 67 |
} else { |
| 68 |
return ['swiper', 'usk-font', 'usk-mentor-slider']; |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
public function get_custom_help_url() { |
| 73 |
return 'https://youtu.be/qO4BSo8OTkA'; |
| 74 |
} |
| 75 |
|
| 76 |
public function get_query() { |
| 77 |
return $this->_query; |
| 78 |
} |
| 79 |
public function has_widget_inner_wrapper(): bool { |
| 80 |
return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup'); |
| 81 |
} |
| 82 |
protected function register_controls() { |
| 83 |
$this->start_controls_section( |
| 84 |
'section_woocommerce_layout', |
| 85 |
[ |
| 86 |
'label' => esc_html__('Layout', 'ultimate-store-kit'), |
| 87 |
] |
| 88 |
); |
| 89 |
$this->add_responsive_control( |
| 90 |
'items_height', |
| 91 |
[ |
| 92 |
'label' => esc_html__('Item Height', 'ultimate-store-kit'), |
| 93 |
'type' => Controls_Manager::SLIDER, |
| 94 |
'range' => [ |
| 95 |
'px' => [ |
| 96 |
'min' => 100, |
| 97 |
'max' => 1000, |
| 98 |
], |
| 99 |
'vh' => [ |
| 100 |
'min' => 10, |
| 101 |
'max' => 100, |
| 102 |
], |
| 103 |
], |
| 104 |
'default' => [ |
| 105 |
'unit' => 'vh', |
| 106 |
], |
| 107 |
'size_units' => ['px', 'vh', 'em'], |
| 108 |
'selectors' => [ |
| 109 |
'{{WRAPPER}} .usk-main-slider' => 'height: {{SIZE}}{{UNIT}}', |
| 110 |
], |
| 111 |
] |
| 112 |
); |
| 113 |
|
| 114 |
$this->add_group_control( |
| 115 |
Group_Control_Image_Size::get_type(), |
| 116 |
[ |
| 117 |
'name' => 'image', |
| 118 |
'label' => esc_html__('Image Size', 'ultimate-store-kit'), |
| 119 |
'exclude' => ['custom'], |
| 120 |
'default' => 'full', |
| 121 |
] |
| 122 |
); |
| 123 |
|
| 124 |
$this->add_control( |
| 125 |
'show_arrows', |
| 126 |
[ |
| 127 |
'label' => esc_html__('Show Navigation', 'ultimate-store-kit'), |
| 128 |
'type' => Controls_Manager::SWITCHER, |
| 129 |
'default' => 'yes', |
| 130 |
'separator' => 'before' |
| 131 |
] |
| 132 |
); |
| 133 |
|
| 134 |
$this->add_control( |
| 135 |
'show_pagination', |
| 136 |
[ |
| 137 |
'label' => esc_html__('Show Pagination', 'ultimate-store-kit'), |
| 138 |
'type' => Controls_Manager::SWITCHER, |
| 139 |
'default' => 'yes', |
| 140 |
] |
| 141 |
); |
| 142 |
|
| 143 |
$this->start_controls_tabs( |
| 144 |
'navigation_tabs' |
| 145 |
); |
| 146 |
|
| 147 |
$this->start_controls_tab( |
| 148 |
'previous_navigation_tab', |
| 149 |
[ |
| 150 |
'label' => esc_html__('Previous', 'ultimate-store-kit'), |
| 151 |
'condition' => [ |
| 152 |
'show_arrows' => 'yes', |
| 153 |
], |
| 154 |
] |
| 155 |
); |
| 156 |
|
| 157 |
$this->add_control( |
| 158 |
'previous_navigation_text', |
| 159 |
[ |
| 160 |
'label' => esc_html__('Text', 'ultimate-store-kit'), |
| 161 |
'type' => Controls_Manager::TEXT, |
| 162 |
'dynamic' => ['active' => true], |
| 163 |
'default' => esc_html__('prev', 'ultimate-store-kit'), |
| 164 |
'condition' => [ |
| 165 |
'show_arrows' => 'yes', |
| 166 |
], |
| 167 |
] |
| 168 |
); |
| 169 |
|
| 170 |
$this->end_controls_tab(); |
| 171 |
|
| 172 |
$this->start_controls_tab( |
| 173 |
'next_navigation_tab', |
| 174 |
[ |
| 175 |
'label' => esc_html__('Next', 'ultimate-store-kit'), |
| 176 |
'condition' => [ |
| 177 |
'show_arrows' => 'yes', |
| 178 |
], |
| 179 |
] |
| 180 |
); |
| 181 |
|
| 182 |
$this->add_control( |
| 183 |
'next_navigation_text', |
| 184 |
[ |
| 185 |
'label' => esc_html__('Text', 'ultimate-store-kit'), |
| 186 |
'type' => Controls_Manager::TEXT, |
| 187 |
'dynamic' => ['active' => true], |
| 188 |
'default' => esc_html__('next', 'ultimate-store-kit'), |
| 189 |
'condition' => [ |
| 190 |
'show_arrows' => 'yes', |
| 191 |
], |
| 192 |
] |
| 193 |
); |
| 194 |
|
| 195 |
$this->end_controls_tab(); |
| 196 |
$this->end_controls_tabs(); |
| 197 |
|
| 198 |
$this->end_controls_section(); |
| 199 |
|
| 200 |
//Query |
| 201 |
$this->start_controls_section( |
| 202 |
'section_post_query_builder', |
| 203 |
[ |
| 204 |
'label' => __('Query', 'ultimate-store-kit'), |
| 205 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 206 |
] |
| 207 |
); |
| 208 |
$this->register_query_builder_controls(); |
| 209 |
$this->end_controls_section(); |
| 210 |
|
| 211 |
//Additional |
| 212 |
$this->start_controls_section( |
| 213 |
'section_woocommerce_additional', |
| 214 |
[ |
| 215 |
'label' => esc_html__('Additional Options', 'ultimate-store-kit'), |
| 216 |
] |
| 217 |
); |
| 218 |
$this->start_controls_tabs( |
| 219 |
'tabs_show_hide_content' |
| 220 |
); |
| 221 |
$this->start_controls_tab( |
| 222 |
'show_content_tab', |
| 223 |
[ |
| 224 |
'label' => esc_html__('Content', 'ultimate-store-kit'), |
| 225 |
] |
| 226 |
); |
| 227 |
$this->add_control( |
| 228 |
'show_title', |
| 229 |
[ |
| 230 |
'label' => esc_html__('Title', 'ultimate-store-kit'), |
| 231 |
'type' => Controls_Manager::SWITCHER, |
| 232 |
'default' => 'yes' |
| 233 |
] |
| 234 |
); |
| 235 |
$this->add_control( |
| 236 |
'title_tags', |
| 237 |
[ |
| 238 |
'label' => esc_html__('Title HTML Tag', 'ultimate-store-kit'), |
| 239 |
'type' => Controls_Manager::SELECT, |
| 240 |
'default' => 'h3', |
| 241 |
'options' => ultimate_store_kit_title_tags(), |
| 242 |
] |
| 243 |
); |
| 244 |
|
| 245 |
$this->add_control( |
| 246 |
'show_rating', |
| 247 |
[ |
| 248 |
'label' => esc_html__('Rating', 'ultimate-store-kit'), |
| 249 |
'type' => Controls_Manager::SWITCHER, |
| 250 |
'default' => 'yes', |
| 251 |
'separator' => 'before' |
| 252 |
] |
| 253 |
); |
| 254 |
$this->add_control( |
| 255 |
'hide_customer_review', |
| 256 |
[ |
| 257 |
'label' => esc_html__('Hide Review Text', 'ultimate-store-kit'), |
| 258 |
'type' => Controls_Manager::SWITCHER, |
| 259 |
'label_on' => esc_html__('Yes', 'ultimate-store-kit'), |
| 260 |
'label_off' => esc_html__('No', 'ultimate-store-kit'), |
| 261 |
// 'return_value' => 'yes', |
| 262 |
'default' => 'yes', |
| 263 |
'condition' => [ |
| 264 |
'show_rating' => 'yes', |
| 265 |
], |
| 266 |
'selectors' => [ |
| 267 |
'{{WRAPPER}} .usk-mentor-slider .usk-rating .woocommerce-review-link' => 'display:none', |
| 268 |
], |
| 269 |
] |
| 270 |
); |
| 271 |
// $this->add_control( |
| 272 |
// 'show_button', |
| 273 |
// [ |
| 274 |
// 'label' => esc_html__('Button', 'ultimate-store-kit'), |
| 275 |
// 'type' => Controls_Manager::SWITCHER, |
| 276 |
// 'default' => 'yes' |
| 277 |
// ] |
| 278 |
// ); |
| 279 |
$this->add_control( |
| 280 |
'show_price', |
| 281 |
[ |
| 282 |
'label' => esc_html__('Price', 'ultimate-store-kit'), |
| 283 |
'type' => Controls_Manager::SWITCHER, |
| 284 |
'default' => 'yes', |
| 285 |
] |
| 286 |
); |
| 287 |
|
| 288 |
$this->add_control( |
| 289 |
'show_category', |
| 290 |
[ |
| 291 |
'label' => esc_html__('Category', 'ultimate-store-kit'), |
| 292 |
'type' => Controls_Manager::SWITCHER, |
| 293 |
'default' => 'yes', |
| 294 |
] |
| 295 |
); |
| 296 |
|
| 297 |
$this->add_control( |
| 298 |
'show_excerpt', |
| 299 |
[ |
| 300 |
'label' => esc_html__('Text', 'ultimate-store-kit'), |
| 301 |
'type' => Controls_Manager::SWITCHER, |
| 302 |
'default' => 'yes', |
| 303 |
'separator' => 'before', |
| 304 |
] |
| 305 |
); |
| 306 |
$this->add_control( |
| 307 |
'excerpt_limit', |
| 308 |
[ |
| 309 |
'label' => esc_html__('Text Limit', 'ultimate-store-kit'), |
| 310 |
'type' => Controls_Manager::NUMBER, |
| 311 |
'default' => 15, |
| 312 |
'condition' => [ |
| 313 |
'show_excerpt' => 'yes', |
| 314 |
], |
| 315 |
] |
| 316 |
); |
| 317 |
|
| 318 |
$this->end_controls_tab(); |
| 319 |
$this->start_controls_tab( |
| 320 |
'show_sale_badge_tab', |
| 321 |
[ |
| 322 |
'label' => esc_html__('Badge', 'ultimate-store-kit'), |
| 323 |
] |
| 324 |
); |
| 325 |
$this->add_control( |
| 326 |
'show_sale_badge', |
| 327 |
[ |
| 328 |
'label' => esc_html__('Sale', 'ultimate-store-kit'), |
| 329 |
'type' => Controls_Manager::SWITCHER, |
| 330 |
'default' => 'yes', |
| 331 |
] |
| 332 |
); |
| 333 |
$this->add_control( |
| 334 |
'show_discount_badge', |
| 335 |
[ |
| 336 |
'label' => esc_html__('Percentage', 'ultimate-store-kit'), |
| 337 |
'type' => Controls_Manager::SWITCHER, |
| 338 |
'default' => 'yes', |
| 339 |
] |
| 340 |
); |
| 341 |
$this->add_control( |
| 342 |
'show_stock_status', |
| 343 |
[ |
| 344 |
'label' => esc_html__('Stock Status', 'ultimate-store-kit'), |
| 345 |
'type' => Controls_Manager::SWITCHER, |
| 346 |
'default' => 'yes', |
| 347 |
] |
| 348 |
); |
| 349 |
$this->add_control( |
| 350 |
'show_trending_badge', |
| 351 |
[ |
| 352 |
'label' => esc_html__('Trending', 'ultimate-store-kit'), |
| 353 |
'type' => Controls_Manager::SWITCHER, |
| 354 |
'default' => 'yes', |
| 355 |
] |
| 356 |
); |
| 357 |
$this->add_control( |
| 358 |
'show_new_badge', |
| 359 |
[ |
| 360 |
'label' => esc_html__('New', 'ultimate-store-kit'), |
| 361 |
'type' => Controls_Manager::SWITCHER, |
| 362 |
'default' => 'yes', |
| 363 |
] |
| 364 |
); |
| 365 |
$this->add_control( |
| 366 |
'newness_days', |
| 367 |
[ |
| 368 |
'label' => esc_html__('Newness Days', 'ultimate-store-kit'), |
| 369 |
'type' => Controls_Manager::NUMBER, |
| 370 |
'default' => 30, |
| 371 |
'condition' => [ |
| 372 |
'show_new_badge' => 'yes', |
| 373 |
], |
| 374 |
] |
| 375 |
); |
| 376 |
$this->end_controls_tab(); |
| 377 |
|
| 378 |
$this->start_controls_tab( |
| 379 |
'show_action_btn_tab', |
| 380 |
[ |
| 381 |
'label' => esc_html__('Action Button', 'ultimate-store-kit'), |
| 382 |
] |
| 383 |
); |
| 384 |
$this->add_control( |
| 385 |
'show_cart', |
| 386 |
[ |
| 387 |
'label' => esc_html__('Add to Cart', 'ultimate-store-kit'), |
| 388 |
'type' => Controls_Manager::SWITCHER, |
| 389 |
'default' => 'yes', |
| 390 |
] |
| 391 |
); |
| 392 |
|
| 393 |
$this->add_control( |
| 394 |
'show_wishlist', |
| 395 |
[ |
| 396 |
'label' => esc_html__('Wishlist', 'ultimate-store-kit'), |
| 397 |
'type' => Controls_Manager::SWITCHER, |
| 398 |
'label_on' => esc_html__('Show', 'ultimate-store-kit'), |
| 399 |
'label_off' => esc_html__('Hide', 'ultimate-store-kit'), |
| 400 |
'return_value' => 'yes', |
| 401 |
'default' => 'yes', |
| 402 |
] |
| 403 |
); |
| 404 |
$this->add_control( |
| 405 |
'show_quick_view', |
| 406 |
[ |
| 407 |
'label' => esc_html__('Quick View', 'ultimate-store-kit'), |
| 408 |
'type' => Controls_Manager::SWITCHER, |
| 409 |
'default' => 'yes', |
| 410 |
] |
| 411 |
); |
| 412 |
|
| 413 |
$this->end_controls_tab(); |
| 414 |
$this->end_controls_tabs(); |
| 415 |
$this->end_controls_section(); |
| 416 |
|
| 417 |
/** |
| 418 |
* Slider settings |
| 419 |
*/ |
| 420 |
$this->start_controls_section( |
| 421 |
'section_carousel_settings', |
| 422 |
[ |
| 423 |
'label' => __('Slider Settings', 'ultimate-store-kit'), |
| 424 |
] |
| 425 |
); |
| 426 |
|
| 427 |
$this->add_control( |
| 428 |
'autoplay', |
| 429 |
[ |
| 430 |
'label' => __('Autoplay', 'ultimate-store-kit'), |
| 431 |
'type' => Controls_Manager::SWITCHER, |
| 432 |
'default' => 'yes', |
| 433 |
|
| 434 |
] |
| 435 |
); |
| 436 |
|
| 437 |
$this->add_control( |
| 438 |
'autoplay_speed', |
| 439 |
[ |
| 440 |
'label' => esc_html__('Autoplay Speed', 'ultimate-store-kit'), |
| 441 |
'type' => Controls_Manager::NUMBER, |
| 442 |
'default' => 5000, |
| 443 |
'condition' => [ |
| 444 |
'autoplay' => 'yes', |
| 445 |
], |
| 446 |
] |
| 447 |
); |
| 448 |
|
| 449 |
$this->add_control( |
| 450 |
'pauseonhover', |
| 451 |
[ |
| 452 |
'label' => esc_html__('Pause on Hover', 'ultimate-store-kit'), |
| 453 |
'type' => Controls_Manager::SWITCHER, |
| 454 |
'condition' => [ |
| 455 |
'autoplay' => 'yes', |
| 456 |
], |
| 457 |
] |
| 458 |
); |
| 459 |
|
| 460 |
$this->add_control( |
| 461 |
'grab_cursor', |
| 462 |
[ |
| 463 |
'label' => __('Grab Cursor', 'ultimate-store-kit'), |
| 464 |
'type' => Controls_Manager::SWITCHER, |
| 465 |
] |
| 466 |
); |
| 467 |
|
| 468 |
$this->add_control( |
| 469 |
'loop', |
| 470 |
[ |
| 471 |
'label' => __('Loop', 'ultimate-store-kit'), |
| 472 |
'type' => Controls_Manager::SWITCHER, |
| 473 |
'default' => 'yes', |
| 474 |
|
| 475 |
] |
| 476 |
); |
| 477 |
|
| 478 |
$this->add_control( |
| 479 |
'mousewheel', |
| 480 |
[ |
| 481 |
'label' => __('Mousewheel', 'ultimate-store-kit'), |
| 482 |
'type' => Controls_Manager::SWITCHER, |
| 483 |
// 'default' => 'yes', |
| 484 |
|
| 485 |
] |
| 486 |
); |
| 487 |
|
| 488 |
|
| 489 |
$this->add_control( |
| 490 |
'speed', |
| 491 |
[ |
| 492 |
'label' => __('Animation Speed (ms)', 'ultimate-store-kit'), |
| 493 |
'type' => Controls_Manager::SLIDER, |
| 494 |
'default' => [ |
| 495 |
'size' => 800, |
| 496 |
], |
| 497 |
'range' => [ |
| 498 |
'px' => [ |
| 499 |
'min' => 100, |
| 500 |
'max' => 5000, |
| 501 |
'step' => 50, |
| 502 |
], |
| 503 |
], |
| 504 |
] |
| 505 |
); |
| 506 |
|
| 507 |
$this->add_control( |
| 508 |
'observer', |
| 509 |
[ |
| 510 |
'label' => __('Observer', 'ultimate-store-kit'), |
| 511 |
'description' => __('When you use carousel in any hidden place (in tabs, accordion etc) keep it yes.', 'ultimate-store-kit'), |
| 512 |
'type' => Controls_Manager::SWITCHER, |
| 513 |
] |
| 514 |
); |
| 515 |
|
| 516 |
$this->end_controls_section(); |
| 517 |
|
| 518 |
/** |
| 519 |
* Start Style Controls |
| 520 |
*/ |
| 521 |
$this->start_controls_section( |
| 522 |
'section_style_items', |
| 523 |
[ |
| 524 |
'label' => esc_html__('Slider', 'ultimate-store-kit'), |
| 525 |
'tab' => Controls_Manager::TAB_STYLE, |
| 526 |
] |
| 527 |
); |
| 528 |
|
| 529 |
$this->add_group_control( |
| 530 |
Group_Control_Background::get_type(), |
| 531 |
[ |
| 532 |
'name' => 'slider_items_background', |
| 533 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 534 |
'types' => ['classic', 'gradient'], |
| 535 |
'selector' => '{{WRAPPER}} .usk-mentor-slider', |
| 536 |
] |
| 537 |
); |
| 538 |
|
| 539 |
$this->add_group_control( |
| 540 |
Group_Control_Border::get_type(), |
| 541 |
[ |
| 542 |
'name' => 'slider_items_border', |
| 543 |
'label' => __('Border', 'ultimate-store-kit'), |
| 544 |
// 'fields_options' => [ |
| 545 |
// 'border' => [ |
| 546 |
// 'default' => 'solid', |
| 547 |
// ], |
| 548 |
// 'width' => [ |
| 549 |
// 'default' => [ |
| 550 |
// 'top' => '1', |
| 551 |
// 'right' => '1', |
| 552 |
// 'bottom' => '1', |
| 553 |
// 'left' => '1', |
| 554 |
// 'isLinked' => false, |
| 555 |
// ], |
| 556 |
// ], |
| 557 |
// 'color' => [ |
| 558 |
// 'default' => '#5bb300', |
| 559 |
// ], |
| 560 |
// ], |
| 561 |
'selector' => '{{WRAPPER}} .usk-mentor-slider', |
| 562 |
] |
| 563 |
); |
| 564 |
|
| 565 |
$this->add_responsive_control( |
| 566 |
'slider_items_radius', |
| 567 |
[ |
| 568 |
'label' => esc_html__('Radius', 'ultimate-store-kit'), |
| 569 |
'type' => Controls_Manager::DIMENSIONS, |
| 570 |
'size_units' => ['px'], |
| 571 |
'selectors' => [ |
| 572 |
'{{WRAPPER}} .usk-mentor-slider' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 573 |
], |
| 574 |
] |
| 575 |
); |
| 576 |
$this->add_responsive_control( |
| 577 |
'slider_items_padding', |
| 578 |
[ |
| 579 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 580 |
'type' => Controls_Manager::DIMENSIONS, |
| 581 |
'size_units' => [ |
| 582 |
'px', |
| 583 |
'em', |
| 584 |
'%' |
| 585 |
], |
| 586 |
'selectors' => [ |
| 587 |
'{{WRAPPER}} .usk-mentor-slider' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 588 |
], |
| 589 |
] |
| 590 |
); |
| 591 |
|
| 592 |
$this->add_responsive_control( |
| 593 |
'content_item_padding', |
| 594 |
[ |
| 595 |
'label' => esc_html__('Content Padding', 'ultimate-store-kit'), |
| 596 |
'type' => Controls_Manager::DIMENSIONS, |
| 597 |
'size_units' => [ |
| 598 |
'px', |
| 599 |
'em', |
| 600 |
'%' |
| 601 |
], |
| 602 |
'selectors' => [ |
| 603 |
'{{WRAPPER}} .usk-mentor-slider .usk-inner-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 604 |
], |
| 605 |
] |
| 606 |
); |
| 607 |
|
| 608 |
$this->end_controls_section(); |
| 609 |
|
| 610 |
|
| 611 |
$this->start_controls_section( |
| 612 |
'section_style_image', |
| 613 |
[ |
| 614 |
'label' => esc_html__('Images', 'ultimate-store-kit'), |
| 615 |
'tab' => Controls_Manager::TAB_STYLE, |
| 616 |
] |
| 617 |
); |
| 618 |
|
| 619 |
$this->add_group_control( |
| 620 |
Group_Control_Background::get_type(), |
| 621 |
[ |
| 622 |
'name' => 'image_background', |
| 623 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 624 |
'types' => ['classic', 'gradient'], |
| 625 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-image-wrap', |
| 626 |
] |
| 627 |
); |
| 628 |
|
| 629 |
$this->add_group_control( |
| 630 |
Group_Control_Border::get_type(), |
| 631 |
[ |
| 632 |
'name' => 'image_border', |
| 633 |
'label' => __('Border', 'ultimate-store-kit'), |
| 634 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-image-wrap', |
| 635 |
] |
| 636 |
); |
| 637 |
|
| 638 |
$this->add_responsive_control( |
| 639 |
'image_radius', |
| 640 |
[ |
| 641 |
'label' => esc_html__('Radius', 'ultimate-store-kit'), |
| 642 |
'type' => Controls_Manager::DIMENSIONS, |
| 643 |
'size_units' => ['px'], |
| 644 |
'selectors' => [ |
| 645 |
'{{WRAPPER}} .usk-mentor-slider .usk-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 646 |
], |
| 647 |
] |
| 648 |
); |
| 649 |
|
| 650 |
|
| 651 |
$this->end_controls_section(); |
| 652 |
|
| 653 |
$this->start_controls_section( |
| 654 |
'section_style_title', |
| 655 |
[ |
| 656 |
'label' => esc_html__('Title', 'ultimate-store-kit'), |
| 657 |
'tab' => Controls_Manager::TAB_STYLE, |
| 658 |
'condition' => [ |
| 659 |
'show_title' => 'yes' |
| 660 |
] |
| 661 |
] |
| 662 |
); |
| 663 |
|
| 664 |
$this->add_control( |
| 665 |
'title_color', |
| 666 |
[ |
| 667 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 668 |
'type' => Controls_Manager::COLOR, |
| 669 |
'selectors' => [ |
| 670 |
'{{WRAPPER}} .usk-main-slider .usk-title a' => 'color: {{VALUE}}', |
| 671 |
], |
| 672 |
] |
| 673 |
); |
| 674 |
|
| 675 |
$this->add_control( |
| 676 |
'hover_title_color', |
| 677 |
[ |
| 678 |
'label' => esc_html__('Hover Color', 'ultimate-store-kit'), |
| 679 |
'type' => Controls_Manager::COLOR, |
| 680 |
'selectors' => [ |
| 681 |
'{{WRAPPER}} .usk-main-slider .usk-title a:hover' => 'color: {{VALUE}};', |
| 682 |
], |
| 683 |
] |
| 684 |
); |
| 685 |
|
| 686 |
$this->add_responsive_control( |
| 687 |
'title_margin', |
| 688 |
[ |
| 689 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 690 |
'type' => Controls_Manager::DIMENSIONS, |
| 691 |
'size_units' => ['px', '%'], |
| 692 |
'selectors' => [ |
| 693 |
'{{WRAPPER}} .usk-main-slider .usk-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 694 |
], |
| 695 |
] |
| 696 |
); |
| 697 |
|
| 698 |
$this->add_group_control( |
| 699 |
Group_Control_Typography::get_type(), |
| 700 |
[ |
| 701 |
'name' => 'title_typography', |
| 702 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 703 |
'selector' => '{{WRAPPER}} .usk-main-slider .usk-title', |
| 704 |
] |
| 705 |
); |
| 706 |
|
| 707 |
$this->add_group_control( |
| 708 |
Group_Control_Text_Shadow::get_type(), |
| 709 |
[ |
| 710 |
'name' => 'title_text_shadow', |
| 711 |
'selector' => '{{WRAPPER}} .usk-main-slider .usk-title', |
| 712 |
] |
| 713 |
); |
| 714 |
|
| 715 |
$this->add_group_control( |
| 716 |
Group_Control_Text_Stroke::get_type(), |
| 717 |
[ |
| 718 |
'name' => 'title_text_stroke', |
| 719 |
'selector' => '{{WRAPPER}} .usk-main-slider .usk-title a', |
| 720 |
] |
| 721 |
); |
| 722 |
|
| 723 |
$this->end_controls_section(); |
| 724 |
|
| 725 |
$this->start_controls_section( |
| 726 |
'section_style_text', |
| 727 |
[ |
| 728 |
'label' => esc_html__('Text', 'ultimate-store-kit'), |
| 729 |
'tab' => Controls_Manager::TAB_STYLE, |
| 730 |
'condition' => [ |
| 731 |
'show_excerpt' => 'yes', |
| 732 |
], |
| 733 |
] |
| 734 |
); |
| 735 |
|
| 736 |
$this->add_control( |
| 737 |
'text_color', |
| 738 |
[ |
| 739 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 740 |
'type' => Controls_Manager::COLOR, |
| 741 |
'selectors' => [ |
| 742 |
'{{WRAPPER}} .usk-main-slider .usk-text' => 'color: {{VALUE}}', |
| 743 |
], |
| 744 |
] |
| 745 |
); |
| 746 |
|
| 747 |
$this->add_responsive_control( |
| 748 |
'text_margin', |
| 749 |
[ |
| 750 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 751 |
'type' => Controls_Manager::DIMENSIONS, |
| 752 |
'size_units' => ['px', '%'], |
| 753 |
'selectors' => [ |
| 754 |
'{{WRAPPER}} .usk-main-slider .usk-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 755 |
], |
| 756 |
] |
| 757 |
); |
| 758 |
|
| 759 |
$this->add_group_control( |
| 760 |
Group_Control_Typography::get_type(), |
| 761 |
[ |
| 762 |
'name' => 'text_typography', |
| 763 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 764 |
'selector' => '{{WRAPPER}} .usk-main-slider .usk-text', |
| 765 |
] |
| 766 |
); |
| 767 |
|
| 768 |
|
| 769 |
$this->end_controls_section(); |
| 770 |
|
| 771 |
$this->start_controls_section( |
| 772 |
'section_style_price', |
| 773 |
[ |
| 774 |
'label' => esc_html__('Price', 'ultimate-store-kit'), |
| 775 |
'tab' => Controls_Manager::TAB_STYLE, |
| 776 |
'condition' => [ |
| 777 |
'show_price' => 'yes', |
| 778 |
], |
| 779 |
] |
| 780 |
); |
| 781 |
$this->add_control( |
| 782 |
'regular_price_color', |
| 783 |
[ |
| 784 |
'label' => esc_html__('Regular Color', 'ultimate-store-kit'), |
| 785 |
'type' => Controls_Manager::COLOR, |
| 786 |
'selectors' => [ |
| 787 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price del .woocommerce-Price-amount.amount' => 'color: {{VALUE}};', |
| 788 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-item .usk-content .usk-price del' => 'color: {{VALUE}};', |
| 789 |
], |
| 790 |
|
| 791 |
] |
| 792 |
); |
| 793 |
$this->add_control( |
| 794 |
'sale_price_color', |
| 795 |
[ |
| 796 |
'label' => esc_html__('Sale Color', 'ultimate-store-kit'), |
| 797 |
'type' => Controls_Manager::COLOR, |
| 798 |
'selectors' => [ |
| 799 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price' => 'color: {{VALUE}}', |
| 800 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price ins span' => 'color: {{VALUE}}', |
| 801 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price .woocommerce-Price-amount.amount' => 'color: {{VALUE}}', |
| 802 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-price > .woocommerce-Price-amount.amount bdi' => 'color: {{VALUE}}', |
| 803 |
], |
| 804 |
] |
| 805 |
); |
| 806 |
$this->add_group_control( |
| 807 |
Group_Control_Typography::get_type(), |
| 808 |
[ |
| 809 |
'name' => 'sale_price_typography', |
| 810 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 811 |
'selector' => ' |
| 812 |
{{WRAPPER}} .' . $this->get_name() . ' .usk-item .usk-price', |
| 813 |
] |
| 814 |
); |
| 815 |
|
| 816 |
$this->end_controls_section(); |
| 817 |
|
| 818 |
$this->start_controls_section( |
| 819 |
'section_style_rating', |
| 820 |
[ |
| 821 |
'label' => esc_html__('Rating', 'ultimate-store-kit'), |
| 822 |
'tab' => Controls_Manager::TAB_STYLE, |
| 823 |
'condition' => [ |
| 824 |
'show_rating' => 'yes', |
| 825 |
], |
| 826 |
] |
| 827 |
); |
| 828 |
|
| 829 |
$this->add_control( |
| 830 |
'rating_color', |
| 831 |
[ |
| 832 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 833 |
'type' => Controls_Manager::COLOR, |
| 834 |
'default' => '#e7e7e7', |
| 835 |
'selectors' => [ |
| 836 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating::before' => 'color: {{VALUE}};', |
| 837 |
], |
| 838 |
] |
| 839 |
); |
| 840 |
|
| 841 |
$this->add_control( |
| 842 |
'active_rating_color', |
| 843 |
[ |
| 844 |
'label' => esc_html__('Active Color', 'ultimate-store-kit'), |
| 845 |
'type' => Controls_Manager::COLOR, |
| 846 |
'default' => '#FFCC00', |
| 847 |
'selectors' => [ |
| 848 |
'{{WRAPPER}} .' . $this->get_name() . ' .usk-rating .star-rating span::before' => 'color: {{VALUE}};', |
| 849 |
], |
| 850 |
] |
| 851 |
); |
| 852 |
|
| 853 |
$this->add_responsive_control( |
| 854 |
'rating_margin', |
| 855 |
[ |
| 856 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 857 |
'type' => Controls_Manager::DIMENSIONS, |
| 858 |
'size_units' => ['px', '%', 'em'], |
| 859 |
'selectors' => [ |
| 860 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 861 |
], |
| 862 |
] |
| 863 |
); |
| 864 |
|
| 865 |
$this->end_controls_section(); |
| 866 |
|
| 867 |
//Badge Global |
| 868 |
$this->register_global_controls_badge(); |
| 869 |
|
| 870 |
$this->start_controls_section( |
| 871 |
'style_action_btn', |
| 872 |
[ |
| 873 |
'label' => esc_html__('Action Button', 'ultimate-store-kit'), |
| 874 |
'tab' => Controls_Manager::TAB_STYLE, |
| 875 |
'conditions' => [ |
| 876 |
'relation' => 'or', |
| 877 |
'terms' => [ |
| 878 |
[ |
| 879 |
'name' => 'show_wishlist', |
| 880 |
'value' => 'yes', |
| 881 |
], |
| 882 |
[ |
| 883 |
'name' => 'show_quick_view', |
| 884 |
'value' => 'yes', |
| 885 |
], |
| 886 |
[ |
| 887 |
'name' => 'show_cart', |
| 888 |
'value' => 'yes', |
| 889 |
], |
| 890 |
], |
| 891 |
], |
| 892 |
] |
| 893 |
); |
| 894 |
|
| 895 |
$this->add_control( |
| 896 |
'action_button_color', |
| 897 |
[ |
| 898 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 899 |
'type' => Controls_Manager::COLOR, |
| 900 |
'selectors' => [ |
| 901 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a i' => 'color: {{VALUE}}', |
| 902 |
], |
| 903 |
] |
| 904 |
); |
| 905 |
|
| 906 |
$this->add_control( |
| 907 |
'action_button_color_hover', |
| 908 |
[ |
| 909 |
'label' => esc_html__('Hover Color', 'ultimate-store-kit'), |
| 910 |
'type' => Controls_Manager::COLOR, |
| 911 |
'selectors' => [ |
| 912 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a:hover i' => 'color: {{VALUE}}', |
| 913 |
], |
| 914 |
] |
| 915 |
); |
| 916 |
|
| 917 |
$this->add_control( |
| 918 |
'action_button_bg', |
| 919 |
[ |
| 920 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 921 |
'type' => Controls_Manager::COLOR, |
| 922 |
'selectors' => [ |
| 923 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'background: {{VALUE}}', |
| 924 |
], |
| 925 |
] |
| 926 |
); |
| 927 |
|
| 928 |
$this->add_control( |
| 929 |
'action_button_bg_hover', |
| 930 |
[ |
| 931 |
'label' => esc_html__('Hover Background', 'ultimate-store-kit'), |
| 932 |
'type' => Controls_Manager::COLOR, |
| 933 |
'selectors' => [ |
| 934 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a:hover' => 'background: {{VALUE}}', |
| 935 |
], |
| 936 |
] |
| 937 |
); |
| 938 |
|
| 939 |
$this->add_group_control( |
| 940 |
Group_Control_Border::get_type(), |
| 941 |
[ |
| 942 |
'name' => 'action_btn_border', |
| 943 |
'label' => esc_html__('Border', 'ultimate-store-kit'), |
| 944 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a', |
| 945 |
] |
| 946 |
); |
| 947 |
$this->add_responsive_control( |
| 948 |
'action_btn_radius', |
| 949 |
[ |
| 950 |
'label' => esc_html__('Radius', 'ultimate-store-kit'), |
| 951 |
'type' => Controls_Manager::DIMENSIONS, |
| 952 |
'size_units' => ['px', '%', 'em'], |
| 953 |
'selectors' => [ |
| 954 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 955 |
], |
| 956 |
] |
| 957 |
); |
| 958 |
$this->add_responsive_control( |
| 959 |
'action_btn_padding', |
| 960 |
[ |
| 961 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 962 |
'type' => Controls_Manager::DIMENSIONS, |
| 963 |
'size_units' => ['px', '%', 'em'], |
| 964 |
'selectors' => [ |
| 965 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 966 |
], |
| 967 |
] |
| 968 |
); |
| 969 |
$this->add_responsive_control( |
| 970 |
'action_btn_margin', |
| 971 |
[ |
| 972 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 973 |
'type' => Controls_Manager::DIMENSIONS, |
| 974 |
'size_units' => ['px', '%', 'em'], |
| 975 |
'selectors' => [ |
| 976 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 977 |
], |
| 978 |
] |
| 979 |
); |
| 980 |
|
| 981 |
$this->add_control( |
| 982 |
'font_family', |
| 983 |
[ |
| 984 |
'label' => esc_html__('Tooltip Font', 'ultimate-store-kit'), |
| 985 |
'type' => Controls_Manager::FONT, |
| 986 |
'default' => "'Open Sans', sans-serif", |
| 987 |
'selectors' => [ |
| 988 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap a' => 'font-family: {{VALUE}}', |
| 989 |
], |
| 990 |
] |
| 991 |
); |
| 992 |
|
| 993 |
$this->add_control( |
| 994 |
'action_btn_separator', |
| 995 |
[ |
| 996 |
'label' => esc_html__('Button Separator', 'ultimate-store-kit'), |
| 997 |
'show_label' => false, |
| 998 |
'label_block' => false, |
| 999 |
'type' => Controls_Manager::HEADING, |
| 1000 |
'separator' => 'before', |
| 1001 |
] |
| 1002 |
); |
| 1003 |
$this->start_controls_tabs( |
| 1004 |
'action_btn_tabs' |
| 1005 |
); |
| 1006 |
$this->start_controls_tab( |
| 1007 |
'wishlist_tab', |
| 1008 |
[ |
| 1009 |
'label' => esc_html__('Wishlist', 'ultimate-store-kit'), |
| 1010 |
'condition' => [ |
| 1011 |
'show_wishlist' => 'yes' |
| 1012 |
] |
| 1013 |
] |
| 1014 |
); |
| 1015 |
$this->add_control( |
| 1016 |
'wishlist_normal_color', |
| 1017 |
[ |
| 1018 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1019 |
'type' => Controls_Manager::COLOR, |
| 1020 |
'selectors' => [ |
| 1021 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist' => 'color: {{VALUE}}', |
| 1022 |
], |
| 1023 |
] |
| 1024 |
); |
| 1025 |
$this->add_control( |
| 1026 |
'wishlist_icon_bg', |
| 1027 |
[ |
| 1028 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1029 |
'type' => Controls_Manager::COLOR, |
| 1030 |
'selectors' => [ |
| 1031 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist' => 'background: {{VALUE}}', |
| 1032 |
], |
| 1033 |
] |
| 1034 |
); |
| 1035 |
$this->add_control( |
| 1036 |
'heading_wishlist_hover', |
| 1037 |
[ |
| 1038 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1039 |
'type' => Controls_Manager::HEADING, |
| 1040 |
'separator' => 'before', |
| 1041 |
] |
| 1042 |
); |
| 1043 |
$this->add_control( |
| 1044 |
'wishlist_hover_color', |
| 1045 |
[ |
| 1046 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1047 |
'type' => Controls_Manager::COLOR, |
| 1048 |
'selectors' => [ |
| 1049 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist:hover' => 'color: {{VALUE}}', |
| 1050 |
], |
| 1051 |
] |
| 1052 |
); |
| 1053 |
$this->add_control( |
| 1054 |
'wishlist_icon_hover_bg', |
| 1055 |
[ |
| 1056 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1057 |
'type' => Controls_Manager::COLOR, |
| 1058 |
'selectors' => [ |
| 1059 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-wishlist:hover' => 'background: {{VALUE}}', |
| 1060 |
], |
| 1061 |
] |
| 1062 |
); |
| 1063 |
|
| 1064 |
$this->end_controls_tab(); |
| 1065 |
$this->start_controls_tab( |
| 1066 |
'quickview_tab', |
| 1067 |
[ |
| 1068 |
'label' => esc_html__('Quickview', 'ultimate-store-kit'), |
| 1069 |
'condition' => [ |
| 1070 |
'show_quick_view' => 'yes' |
| 1071 |
] |
| 1072 |
] |
| 1073 |
); |
| 1074 |
$this->add_control( |
| 1075 |
'quickview_color', |
| 1076 |
[ |
| 1077 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1078 |
'type' => Controls_Manager::COLOR, |
| 1079 |
'selectors' => [ |
| 1080 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view' => 'color: {{VALUE}}', |
| 1081 |
], |
| 1082 |
] |
| 1083 |
); |
| 1084 |
$this->add_control( |
| 1085 |
'quickview_icon_bg', |
| 1086 |
[ |
| 1087 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1088 |
'type' => Controls_Manager::COLOR, |
| 1089 |
'selectors' => [ |
| 1090 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view' => 'background: {{VALUE}}', |
| 1091 |
], |
| 1092 |
] |
| 1093 |
); |
| 1094 |
$this->add_control( |
| 1095 |
'heading_quickview_hover', |
| 1096 |
[ |
| 1097 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1098 |
'type' => Controls_Manager::HEADING, |
| 1099 |
'separator' => 'before', |
| 1100 |
] |
| 1101 |
); |
| 1102 |
$this->add_control( |
| 1103 |
'quickview_color_hover', |
| 1104 |
[ |
| 1105 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1106 |
'type' => Controls_Manager::COLOR, |
| 1107 |
'selectors' => [ |
| 1108 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view:hover' => 'color: {{VALUE}}', |
| 1109 |
], |
| 1110 |
] |
| 1111 |
); |
| 1112 |
$this->add_control( |
| 1113 |
'quickview_icon_bg_hover', |
| 1114 |
[ |
| 1115 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1116 |
'type' => Controls_Manager::COLOR, |
| 1117 |
'selectors' => [ |
| 1118 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-view:hover' => 'background: {{VALUE}}', |
| 1119 |
], |
| 1120 |
] |
| 1121 |
); |
| 1122 |
$this->end_controls_tab(); |
| 1123 |
if (($this->get_name() !== 'usk-shiny-grid') && ($this->get_name() !== 'usk-shiny-carousel')) { |
| 1124 |
$this->start_controls_tab( |
| 1125 |
'add_to_cart_tab', |
| 1126 |
[ |
| 1127 |
'label' => esc_html__('Cart', 'ultimate-store-kit'), |
| 1128 |
'condition' => [ |
| 1129 |
'show_cart' => 'yes' |
| 1130 |
] |
| 1131 |
] |
| 1132 |
); |
| 1133 |
$this->add_control( |
| 1134 |
'cart_color', |
| 1135 |
[ |
| 1136 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1137 |
'type' => Controls_Manager::COLOR, |
| 1138 |
'selectors' => [ |
| 1139 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart' => 'color: {{VALUE}}', |
| 1140 |
], |
| 1141 |
] |
| 1142 |
); |
| 1143 |
$this->add_control( |
| 1144 |
'cart_icon_bg', |
| 1145 |
[ |
| 1146 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1147 |
'type' => Controls_Manager::COLOR, |
| 1148 |
'selectors' => [ |
| 1149 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart' => 'background: {{VALUE}}', |
| 1150 |
], |
| 1151 |
] |
| 1152 |
); |
| 1153 |
$this->add_control( |
| 1154 |
'heading_cart_hover', |
| 1155 |
[ |
| 1156 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1157 |
'type' => Controls_Manager::HEADING, |
| 1158 |
'separator' => 'before', |
| 1159 |
] |
| 1160 |
); |
| 1161 |
$this->add_control( |
| 1162 |
'cart_color_hover', |
| 1163 |
[ |
| 1164 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1165 |
'type' => Controls_Manager::COLOR, |
| 1166 |
'selectors' => [ |
| 1167 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart:hover' => 'color: {{VALUE}}', |
| 1168 |
], |
| 1169 |
] |
| 1170 |
); |
| 1171 |
$this->add_control( |
| 1172 |
'cart_icon_bg_hover', |
| 1173 |
[ |
| 1174 |
'label' => esc_html__('Background', 'ultimate-store-kit'), |
| 1175 |
'type' => Controls_Manager::COLOR, |
| 1176 |
'selectors' => [ |
| 1177 |
'{{WRAPPER}} .usk-mentor-slider .usk-main-slider .usk-action-btn-wrap .usk-cart:hover' => 'background: {{VALUE}}', |
| 1178 |
], |
| 1179 |
] |
| 1180 |
); |
| 1181 |
} |
| 1182 |
$this->end_controls_tab(); |
| 1183 |
$this->end_controls_tabs(); |
| 1184 |
$this->end_controls_section(); |
| 1185 |
|
| 1186 |
$this->start_controls_section( |
| 1187 |
'section_style_category', |
| 1188 |
[ |
| 1189 |
'label' => esc_html__('Category', 'ultimate-store-kit'), |
| 1190 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1191 |
'condition' => [ |
| 1192 |
'show_category' => 'yes', |
| 1193 |
], |
| 1194 |
] |
| 1195 |
); |
| 1196 |
$this->start_controls_tabs( |
| 1197 |
'category_tabs' |
| 1198 |
); |
| 1199 |
$this->start_controls_tab( |
| 1200 |
'category_tab_normal', |
| 1201 |
[ |
| 1202 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 1203 |
] |
| 1204 |
); |
| 1205 |
$this->add_control( |
| 1206 |
'category_color', |
| 1207 |
[ |
| 1208 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1209 |
'type' => Controls_Manager::COLOR, |
| 1210 |
'selectors' => [ |
| 1211 |
'{{WRAPPER}} .usk-mentor-slider .usk-category a' => 'color: {{VALUE}};', |
| 1212 |
], |
| 1213 |
] |
| 1214 |
); |
| 1215 |
$this->add_group_control( |
| 1216 |
Group_Control_Background::get_type(), |
| 1217 |
[ |
| 1218 |
'name' => 'category_bg_color', |
| 1219 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a', |
| 1220 |
] |
| 1221 |
); |
| 1222 |
$this->add_group_control( |
| 1223 |
Group_Control_Border::get_type(), |
| 1224 |
[ |
| 1225 |
'name' => 'category_border', |
| 1226 |
'label' => esc_html__('Border', 'ultimate-store-kit'), |
| 1227 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a', |
| 1228 |
'separator' => 'before' |
| 1229 |
] |
| 1230 |
); |
| 1231 |
$this->add_responsive_control( |
| 1232 |
'category_radius', |
| 1233 |
[ |
| 1234 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 1235 |
'type' => Controls_Manager::DIMENSIONS, |
| 1236 |
'size_units' => ['px', '%', 'em'], |
| 1237 |
'selectors' => [ |
| 1238 |
'{{WRAPPER}} .usk-mentor-slider .usk-category a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1239 |
], |
| 1240 |
] |
| 1241 |
); |
| 1242 |
$this->add_responsive_control( |
| 1243 |
'category_padding', |
| 1244 |
[ |
| 1245 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 1246 |
'type' => Controls_Manager::DIMENSIONS, |
| 1247 |
'size_units' => ['px', '%'], |
| 1248 |
'selectors' => [ |
| 1249 |
'{{WRAPPER}} .usk-mentor-slider .usk-category a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1250 |
], |
| 1251 |
] |
| 1252 |
); |
| 1253 |
$this->add_responsive_control( |
| 1254 |
'category_margin', |
| 1255 |
[ |
| 1256 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 1257 |
'type' => Controls_Manager::DIMENSIONS, |
| 1258 |
'size_units' => ['px', '%'], |
| 1259 |
'selectors' => [ |
| 1260 |
'{{WRAPPER}} .usk-mentor-slider .usk-category' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1261 |
], |
| 1262 |
] |
| 1263 |
); |
| 1264 |
|
| 1265 |
$this->add_responsive_control( |
| 1266 |
'category_space_between', |
| 1267 |
[ |
| 1268 |
'label' => esc_html__('Space Between', 'ultimate-store-kit'), |
| 1269 |
'type' => Controls_Manager::SLIDER, |
| 1270 |
'size_units' => ['px', 'em', '%'], |
| 1271 |
'selectors' => [ |
| 1272 |
'{{WRAPPER}} .usk-mentor-slider .usk-category' => 'gap: {{SIZE}}{{UNIT}};', |
| 1273 |
], |
| 1274 |
] |
| 1275 |
); |
| 1276 |
$this->add_group_control( |
| 1277 |
Group_Control_Typography::get_type(), |
| 1278 |
[ |
| 1279 |
'name' => 'category_typography', |
| 1280 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 1281 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a', |
| 1282 |
] |
| 1283 |
); |
| 1284 |
$this->add_group_control( |
| 1285 |
Group_Control_Box_Shadow::get_type(), |
| 1286 |
[ |
| 1287 |
'name' => 'category_shadow', |
| 1288 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a', |
| 1289 |
] |
| 1290 |
); |
| 1291 |
$this->end_controls_tab(); |
| 1292 |
$this->start_controls_tab( |
| 1293 |
'category_tab_hover', |
| 1294 |
[ |
| 1295 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1296 |
] |
| 1297 |
); |
| 1298 |
$this->add_control( |
| 1299 |
'hover_category_color', |
| 1300 |
[ |
| 1301 |
'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 1302 |
'type' => Controls_Manager::COLOR, |
| 1303 |
'selectors' => [ |
| 1304 |
'{{WRAPPER}} .usk-mentor-slider .usk-category a:hover' => 'color: {{VALUE}};', |
| 1305 |
], |
| 1306 |
] |
| 1307 |
); |
| 1308 |
$this->add_group_control( |
| 1309 |
Group_Control_Background::get_type(), |
| 1310 |
[ |
| 1311 |
'name' => 'hover_category_bg_color', |
| 1312 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-category a:hover', |
| 1313 |
] |
| 1314 |
); |
| 1315 |
$this->add_control( |
| 1316 |
'hover_category_border_color', |
| 1317 |
[ |
| 1318 |
'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 1319 |
'type' => Controls_Manager::COLOR, |
| 1320 |
'selectors' => [ |
| 1321 |
'{{WRAPPER}} .usk-mentor-slider .usk-category a:hover' => 'border-color: {{VALUE}};', |
| 1322 |
], |
| 1323 |
'condition' => [ |
| 1324 |
'category_border_border!' => '' |
| 1325 |
], |
| 1326 |
'separator' => 'before' |
| 1327 |
] |
| 1328 |
); |
| 1329 |
$this->end_controls_tab(); |
| 1330 |
$this->end_controls_tabs(); |
| 1331 |
$this->end_controls_section(); |
| 1332 |
|
| 1333 |
$this->start_controls_section( |
| 1334 |
'section_style_navigation', |
| 1335 |
[ |
| 1336 |
'label' => __('Navigation', 'ultimate-store-kit'), |
| 1337 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1338 |
'condition' => [ |
| 1339 |
'show_arrows' => 'yes' |
| 1340 |
], |
| 1341 |
] |
| 1342 |
); |
| 1343 |
|
| 1344 |
$this->add_control( |
| 1345 |
'nav_arrows_icon', |
| 1346 |
[ |
| 1347 |
'label' => esc_html__('Arrows Icon', 'ultimate-store-kit'), |
| 1348 |
'type' => Controls_Manager::SELECT, |
| 1349 |
'default' => '0', |
| 1350 |
'options' => [ |
| 1351 |
'0' => esc_html__('Default', 'ultimate-store-kit'), |
| 1352 |
'1' => esc_html__('Style 1', 'ultimate-store-kit'), |
| 1353 |
'2' => esc_html__('Style 2', 'ultimate-store-kit'), |
| 1354 |
'3' => esc_html__('Style 3', 'ultimate-store-kit'), |
| 1355 |
'4' => esc_html__('Style 4', 'ultimate-store-kit'), |
| 1356 |
'5' => esc_html__('Style 5', 'ultimate-store-kit'), |
| 1357 |
'6' => esc_html__('Style 6', 'ultimate-store-kit'), |
| 1358 |
'7' => esc_html__('Style 7', 'ultimate-store-kit'), |
| 1359 |
'8' => esc_html__('Style 8', 'ultimate-store-kit'), |
| 1360 |
'9' => esc_html__('Style 9', 'ultimate-store-kit'), |
| 1361 |
'10' => esc_html__('Style 10', 'ultimate-store-kit'), |
| 1362 |
'11' => esc_html__('Style 11', 'ultimate-store-kit'), |
| 1363 |
'12' => esc_html__('Style 12', 'ultimate-store-kit'), |
| 1364 |
'13' => esc_html__('Style 13', 'ultimate-store-kit'), |
| 1365 |
'14' => esc_html__('Style 14', 'ultimate-store-kit'), |
| 1366 |
'15' => esc_html__('Style 15', 'ultimate-store-kit'), |
| 1367 |
'16' => esc_html__('Style 16', 'ultimate-store-kit'), |
| 1368 |
'17' => esc_html__('Style 17', 'ultimate-store-kit'), |
| 1369 |
'18' => esc_html__('Style 18', 'ultimate-store-kit'), |
| 1370 |
'circle-1' => esc_html__('Style 19', 'ultimate-store-kit'), |
| 1371 |
'circle-2' => esc_html__('Style 20', 'ultimate-store-kit'), |
| 1372 |
'circle-3' => esc_html__('Style 21', 'ultimate-store-kit'), |
| 1373 |
'circle-4' => esc_html__('Style 22', 'ultimate-store-kit'), |
| 1374 |
'square-1' => esc_html__('Style 23', 'ultimate-store-kit'), |
| 1375 |
], |
| 1376 |
] |
| 1377 |
); |
| 1378 |
|
| 1379 |
$this->start_controls_tabs('tabs_navigation_arrows_style'); |
| 1380 |
|
| 1381 |
$this->start_controls_tab( |
| 1382 |
'tabs_nav_arrows_normal', |
| 1383 |
[ |
| 1384 |
'label' => __('Normal', 'ultimate-store-kit'), |
| 1385 |
] |
| 1386 |
); |
| 1387 |
|
| 1388 |
$this->add_control( |
| 1389 |
'arrows_color', |
| 1390 |
[ |
| 1391 |
'label' => __('Color', 'ultimate-store-kit'), |
| 1392 |
'type' => Controls_Manager::COLOR, |
| 1393 |
'selectors' => [ |
| 1394 |
'{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'color: {{VALUE}}', |
| 1395 |
], |
| 1396 |
] |
| 1397 |
); |
| 1398 |
|
| 1399 |
$this->add_control( |
| 1400 |
'arrows_background', |
| 1401 |
[ |
| 1402 |
'label' => __('Background', 'ultimate-store-kit'), |
| 1403 |
'type' => Controls_Manager::COLOR, |
| 1404 |
'selectors' => [ |
| 1405 |
'{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'background-color: {{VALUE}}', |
| 1406 |
], |
| 1407 |
] |
| 1408 |
); |
| 1409 |
|
| 1410 |
$this->add_group_control( |
| 1411 |
Group_Control_Border::get_type(), |
| 1412 |
[ |
| 1413 |
'name' => 'nav_arrows_border', |
| 1414 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn', |
| 1415 |
] |
| 1416 |
); |
| 1417 |
|
| 1418 |
$this->add_responsive_control( |
| 1419 |
'border_radius', |
| 1420 |
[ |
| 1421 |
'label' => __('Border Radius', 'ultimate-store-kit'), |
| 1422 |
'type' => Controls_Manager::DIMENSIONS, |
| 1423 |
'size_units' => ['px', '%'], |
| 1424 |
'selectors' => [ |
| 1425 |
'{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1426 |
], |
| 1427 |
] |
| 1428 |
); |
| 1429 |
|
| 1430 |
$this->add_responsive_control( |
| 1431 |
'arrows_padding', |
| 1432 |
[ |
| 1433 |
'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 1434 |
'type' => Controls_Manager::DIMENSIONS, |
| 1435 |
'size_units' => ['px', 'em', '%'], |
| 1436 |
'selectors' => [ |
| 1437 |
'{{WRAPPER}} .usk-mentor-slider .usk-nav-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1438 |
], |
| 1439 |
] |
| 1440 |
); |
| 1441 |
|
| 1442 |
$this->add_responsive_control( |
| 1443 |
'arrows_margin', |
| 1444 |
[ |
| 1445 |
'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 1446 |
'type' => Controls_Manager::DIMENSIONS, |
| 1447 |
'size_units' => ['px', 'em', '%'], |
| 1448 |
'selectors' => [ |
| 1449 |
'{{WRAPPER}} .usk-mentor-slider .usk-navigation-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1450 |
], |
| 1451 |
] |
| 1452 |
); |
| 1453 |
|
| 1454 |
$this->add_group_control( |
| 1455 |
Group_Control_Typography::get_type(), |
| 1456 |
[ |
| 1457 |
'name' => 'navigation_typography', |
| 1458 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 1459 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-nav-btn', |
| 1460 |
] |
| 1461 |
); |
| 1462 |
|
| 1463 |
$this->add_responsive_control( |
| 1464 |
'arrows_space', |
| 1465 |
[ |
| 1466 |
'label' => __('Space Between Arrows', 'ultimate-store-kit'), |
| 1467 |
'type' => Controls_Manager::SLIDER, |
| 1468 |
'range' => [ |
| 1469 |
'px' => [ |
| 1470 |
'min' => 0, |
| 1471 |
'max' => 100, |
| 1472 |
], |
| 1473 |
], |
| 1474 |
'selectors' => [ |
| 1475 |
'{{WRAPPER}} .usk-mentor-slider .usk-navigation-button' => 'grid-column-gap: {{SIZE}}px;', |
| 1476 |
], |
| 1477 |
] |
| 1478 |
); |
| 1479 |
|
| 1480 |
$this->end_controls_tab(); |
| 1481 |
|
| 1482 |
$this->start_controls_tab( |
| 1483 |
'tabs_nav_arrows_hover', |
| 1484 |
[ |
| 1485 |
'label' => __('Hover', 'ultimate-store-kit'), |
| 1486 |
] |
| 1487 |
); |
| 1488 |
|
| 1489 |
$this->add_control( |
| 1490 |
'arrows_hover_color', |
| 1491 |
[ |
| 1492 |
'label' => __('Color', 'ultimate-store-kit'), |
| 1493 |
'type' => Controls_Manager::COLOR, |
| 1494 |
'selectors' => [ |
| 1495 |
'{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'color: {{VALUE}}', |
| 1496 |
], |
| 1497 |
] |
| 1498 |
); |
| 1499 |
|
| 1500 |
$this->add_control( |
| 1501 |
'arrows_hover_background', |
| 1502 |
[ |
| 1503 |
'label' => __('Background', 'ultimate-store-kit'), |
| 1504 |
'type' => Controls_Manager::COLOR, |
| 1505 |
'selectors' => [ |
| 1506 |
'{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'background-color: {{VALUE}}', |
| 1507 |
], |
| 1508 |
] |
| 1509 |
); |
| 1510 |
|
| 1511 |
$this->add_control( |
| 1512 |
'nav_arrows_hover_border_color', |
| 1513 |
[ |
| 1514 |
'label' => __('Border Color', 'ultimate-store-kit'), |
| 1515 |
'type' => Controls_Manager::COLOR, |
| 1516 |
'selectors' => [ |
| 1517 |
'{{WRAPPER}} .usk-mentor-slider .usk-nav-btn:hover' => 'border-color: {{VALUE}};', |
| 1518 |
], |
| 1519 |
] |
| 1520 |
); |
| 1521 |
|
| 1522 |
$this->end_controls_tab(); |
| 1523 |
|
| 1524 |
$this->end_controls_tabs(); |
| 1525 |
|
| 1526 |
$this->end_controls_section(); |
| 1527 |
|
| 1528 |
$this->start_controls_section( |
| 1529 |
'section_style_pagination', |
| 1530 |
[ |
| 1531 |
'label' => __('Pagination', 'ultimate-store-kit'), |
| 1532 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1533 |
'condition' => [ |
| 1534 |
'show_pagination' => 'yes' |
| 1535 |
], |
| 1536 |
] |
| 1537 |
); |
| 1538 |
|
| 1539 |
$this->add_control( |
| 1540 |
'pagination_color', |
| 1541 |
[ |
| 1542 |
'label' => __('Color', 'ultimate-store-kit'), |
| 1543 |
'type' => Controls_Manager::COLOR, |
| 1544 |
'selectors' => [ |
| 1545 |
'{{WRAPPER}} .usk-mentor-slider .swiper-pagination-fraction' => 'color: {{VALUE}}', |
| 1546 |
], |
| 1547 |
] |
| 1548 |
); |
| 1549 |
|
| 1550 |
$this->add_control( |
| 1551 |
'pagination_active_color', |
| 1552 |
[ |
| 1553 |
'label' => __('Active Color', 'ultimate-store-kit'), |
| 1554 |
'type' => Controls_Manager::COLOR, |
| 1555 |
'selectors' => [ |
| 1556 |
'{{WRAPPER}} .usk-mentor-slider .swiper-pagination-current' => 'color: {{VALUE}}', |
| 1557 |
], |
| 1558 |
] |
| 1559 |
); |
| 1560 |
|
| 1561 |
$this->add_group_control( |
| 1562 |
Group_Control_Typography::get_type(), |
| 1563 |
[ |
| 1564 |
'name' => 'pagination_typography', |
| 1565 |
'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 1566 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .swiper-pagination', |
| 1567 |
] |
| 1568 |
); |
| 1569 |
|
| 1570 |
$this->end_controls_section(); |
| 1571 |
|
| 1572 |
$this->start_controls_section( |
| 1573 |
'section_style_thumbs_slide', |
| 1574 |
[ |
| 1575 |
'label' => esc_html__('Thumbs', 'ultimate-store-kit'), |
| 1576 |
'tab' => Controls_Manager::TAB_STYLE, |
| 1577 |
] |
| 1578 |
); |
| 1579 |
|
| 1580 |
$this->start_controls_tabs('thumbs_style_tabs'); |
| 1581 |
$this->start_controls_tab( |
| 1582 |
'thumbs_normal_tab', |
| 1583 |
[ |
| 1584 |
'label' => esc_html__('Normal', 'ultimate-store-kit'), |
| 1585 |
] |
| 1586 |
); |
| 1587 |
|
| 1588 |
$this->add_group_control( |
| 1589 |
Group_Control_Background::get_type(), |
| 1590 |
[ |
| 1591 |
'name' => 'thumbs_background', |
| 1592 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap', |
| 1593 |
] |
| 1594 |
); |
| 1595 |
|
| 1596 |
$this->add_group_control( |
| 1597 |
Group_Control_Border::get_type(), |
| 1598 |
[ |
| 1599 |
'name' => 'thumbs_items_border', |
| 1600 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap', |
| 1601 |
'separator' => 'before' |
| 1602 |
] |
| 1603 |
); |
| 1604 |
|
| 1605 |
$this->add_responsive_control( |
| 1606 |
'thumbs_items_radius', |
| 1607 |
[ |
| 1608 |
'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 1609 |
'type' => Controls_Manager::DIMENSIONS, |
| 1610 |
'size_units' => ['px'], |
| 1611 |
'selectors' => [ |
| 1612 |
'{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-image-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 1613 |
], |
| 1614 |
] |
| 1615 |
); |
| 1616 |
|
| 1617 |
$this->end_controls_tab(); |
| 1618 |
$this->start_controls_tab( |
| 1619 |
'thumbs_hover_tab', |
| 1620 |
[ |
| 1621 |
'label' => esc_html__('Hover', 'ultimate-store-kit'), |
| 1622 |
] |
| 1623 |
); |
| 1624 |
|
| 1625 |
$this->add_group_control( |
| 1626 |
Group_Control_Background::get_type(), |
| 1627 |
[ |
| 1628 |
'name' => 'thumbs_items_hover_background', |
| 1629 |
'selector' => '{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-item:hover .usk-image-wrap', |
| 1630 |
] |
| 1631 |
); |
| 1632 |
|
| 1633 |
$this->add_control( |
| 1634 |
'thumbs_items_hover_border_color', |
| 1635 |
[ |
| 1636 |
'label' => __('Border Color', 'ultimate-store-kit'), |
| 1637 |
'type' => Controls_Manager::COLOR, |
| 1638 |
'selectors' => [ |
| 1639 |
'{{WRAPPER}} .usk-mentor-slider .usk-thumbs-slider-wrap .usk-item:hover .usk-image-wrap' => 'border-color: {{VALUE}};', |
| 1640 |
], |
| 1641 |
'condition' => [ |
| 1642 |
'thumbs_items_border_border!' => 'none', |
| 1643 |
], |
| 1644 |
] |
| 1645 |
); |
| 1646 |
|
| 1647 |
$this->end_controls_tab(); |
| 1648 |
$this->end_controls_tabs(); |
| 1649 |
|
| 1650 |
$this->end_controls_section(); |
| 1651 |
} |
| 1652 |
|
| 1653 |
public function render_image() { |
| 1654 |
global $product; |
| 1655 |
$settings = $this->get_settings_for_display(); |
| 1656 |
$product_image = wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['image_size']); |
| 1657 |
|
| 1658 |
// if product image is empty, use placeholder |
| 1659 |
if (empty($product_image)) { |
| 1660 |
$product_image = wc_placeholder_img_src('full'); |
| 1661 |
} |
| 1662 |
?> |
| 1663 |
<div class="usk-image-wrap"> |
| 1664 |
<img class="usk-img" src="<?php echo esc_url($product_image); ?>" alt="<?php echo esc_attr(get_the_title()); ?>"> |
| 1665 |
</div> |
| 1666 |
<?php |
| 1667 |
} |
| 1668 |
|
| 1669 |
function render_slider_header() { |
| 1670 |
$settings = $this->get_settings_for_display(); |
| 1671 |
$this->add_render_attribute('slider', 'class', ['usk-mentor-slider']); |
| 1672 |
$id = 'ultimate-store-kit-' . $this->get_id(); |
| 1673 |
|
| 1674 |
$this->add_render_attribute('slider', 'id', $id); |
| 1675 |
|
| 1676 |
$this->add_render_attribute( |
| 1677 |
[ |
| 1678 |
'slider' => [ |
| 1679 |
'data-settings' => [ |
| 1680 |
wp_json_encode(array_filter([ |
| 1681 |
"autoplay" => ("yes" == $settings["autoplay"]) ? ["delay" => $settings["autoplay_speed"]] : false, |
| 1682 |
"parallax" => true, |
| 1683 |
"speed" => $settings["speed"]["size"], |
| 1684 |
"pauseOnHover" => ("yes" == $settings["pauseonhover"]) ? true : false, |
| 1685 |
"grabCursor" => ($settings["grab_cursor"] === "yes") ? true : false, |
| 1686 |
"effect" => 'fade', |
| 1687 |
"fadeEffect" => ['crossFade' => true], |
| 1688 |
"lazy" => true, |
| 1689 |
"mousewheel" => ($settings["mousewheel"]) ? true : false, |
| 1690 |
"observer" => ($settings["observer"]) ? true : false, |
| 1691 |
"observeParents" => ($settings["observer"]) ? true : false, |
| 1692 |
"slidesPerView" => 1, |
| 1693 |
"loop" => ($settings["loop"] == "yes") ? true : false, |
| 1694 |
"loopedSlides" => 4, |
| 1695 |
"navigation" => [ |
| 1696 |
"nextEl" => "#" . $id . " .usk-button-next", |
| 1697 |
"prevEl" => "#" . $id . " .usk-button-prev", |
| 1698 |
], |
| 1699 |
"pagination" => [ |
| 1700 |
"el" => "#" . $id . " .swiper-pagination", |
| 1701 |
"type" => "fraction", |
| 1702 |
], |
| 1703 |
"lazy" => [ |
| 1704 |
"loadPrevNext" => "true", |
| 1705 |
], |
| 1706 |
|
| 1707 |
])) |
| 1708 |
] |
| 1709 |
] |
| 1710 |
] |
| 1711 |
); |
| 1712 |
?> |
| 1713 |
<div class="ultimate-store-kit"> |
| 1714 |
<div <?php $this->print_render_attribute_string('slider'); ?>> |
| 1715 |
<div class="swiper usk-main-slider"> |
| 1716 |
<div class="swiper-wrapper"> |
| 1717 |
<?php |
| 1718 |
} |
| 1719 |
|
| 1720 |
public function render_slider_footer() { |
| 1721 |
$settings = $this->get_settings_for_display(); |
| 1722 |
?> |
| 1723 |
</div> |
| 1724 |
</div> |
| 1725 |
|
| 1726 |
<!-- thumbsslider --> |
| 1727 |
<div class="usk-thumbs-slider-wrap"> |
| 1728 |
<div thumbsSlider="" class="usk-thumbs-slider swiper"> |
| 1729 |
<div class="swiper-wrapper"> |
| 1730 |
<?php $this->render_thumbs_item(); ?> |
| 1731 |
</div> |
| 1732 |
</div> |
| 1733 |
|
| 1734 |
<!-- Navigation & Pagination Html --> |
| 1735 |
<?php if ($settings['show_arrows'] or $settings['show_pagination']) : ?> |
| 1736 |
<div class="usk-nav-pag-wrap"> |
| 1737 |
<?php if ($settings['show_pagination']) : ?> |
| 1738 |
<div class="swiper-pagination"></div> |
| 1739 |
<?php endif; ?> |
| 1740 |
|
| 1741 |
<?php if ($settings['show_arrows']) : ?> |
| 1742 |
<div class="usk-navigation-button"> |
| 1743 |
<div class="usk-button-next usk-nav-btn"> |
| 1744 |
<div class="usk-nav-text" data-title="<?php echo esc_attr($settings['next_navigation_text']) ?>"> |
| 1745 |
<span><?php echo esc_html($settings['next_navigation_text']) ?></span> |
| 1746 |
</div> |
| 1747 |
<i class="usk-icon-arrow-right-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i> |
| 1748 |
</div> |
| 1749 |
<div class="usk-button-prev usk-nav-btn"> |
| 1750 |
<i class="usk-icon-arrow-left-<?php echo esc_attr($settings['nav_arrows_icon']); ?>" aria-hidden="true"></i> |
| 1751 |
<div class="usk-nav-text" data-title="<?php echo esc_attr($settings['previous_navigation_text']) ?>"> |
| 1752 |
<span><?php echo esc_html($settings['previous_navigation_text']) ?></span> |
| 1753 |
</div> |
| 1754 |
</div> |
| 1755 |
</div> |
| 1756 |
<?php endif; ?> |
| 1757 |
</div> |
| 1758 |
<?php endif; ?> |
| 1759 |
|
| 1760 |
</div> |
| 1761 |
<!-- thumbsslider --> |
| 1762 |
</div> |
| 1763 |
</div> |
| 1764 |
<?php |
| 1765 |
} |
| 1766 |
|
| 1767 |
public function print_price_output($output) { |
| 1768 |
$tags = [ |
| 1769 |
'del' => ['aria-hidden' => []], |
| 1770 |
'span' => ['class' => []], |
| 1771 |
'bdi' => [], |
| 1772 |
'ins' => [], |
| 1773 |
]; |
| 1774 |
|
| 1775 |
if (isset($output)) { |
| 1776 |
echo wp_kses($output, $tags); |
| 1777 |
} |
| 1778 |
} |
| 1779 |
|
| 1780 |
public function render_loop_item() { |
| 1781 |
$settings = $this->get_settings_for_display(); |
| 1782 |
$id = 'usk-wc-product-' . $this->get_id(); |
| 1783 |
$modal_id = wp_unique_id('modal-id-'); |
| 1784 |
|
| 1785 |
$this->query_product(); |
| 1786 |
$wp_query = $this->get_query(); |
| 1787 |
if ($wp_query->have_posts()) { ?> |
| 1788 |
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); |
| 1789 |
global $product; |
| 1790 |
$tooltip_position = 'right'; |
| 1791 |
|
| 1792 |
$rating_count = $product->get_rating_count(); |
| 1793 |
$average = $product->get_average_rating(); |
| 1794 |
if ($settings['show_rating'] == 'yes') { |
| 1795 |
$this->add_render_attribute('usk-item', 'class', ['usk-item swiper-slide', 'usk-have-rating'], true); |
| 1796 |
} else { |
| 1797 |
$this->add_render_attribute('usk-item', 'class', ['usk-item swiper-slide'], true); |
| 1798 |
} |
| 1799 |
|
| 1800 |
?> |
| 1801 |
<div <?php $this->print_render_attribute_string('usk-item'); ?>> |
| 1802 |
<?php $this->render_image(); ?> |
| 1803 |
|
| 1804 |
<div class="usk-badge-label-wrapper"> |
| 1805 |
<div class="usk-badge-label-content usk-flex"> |
| 1806 |
<?php $this->register_global_template_badge_label($settings); ?> |
| 1807 |
</div> |
| 1808 |
</div> |
| 1809 |
|
| 1810 |
<div class="usk-content"> |
| 1811 |
<div class="usk-inner-content"> |
| 1812 |
|
| 1813 |
<?php if ('yes' == $settings['show_category']) : ?> |
| 1814 |
<?php printf( |
| 1815 |
'<div class="usk-category" data-swiper-parallax-X="-50">%1$s</div>', |
| 1816 |
wp_kses_post(wc_get_product_category_list($product->get_id(), ' ')) |
| 1817 |
); ?> |
| 1818 |
<?php endif; ?> |
| 1819 |
|
| 1820 |
<?php if ('yes' == $settings['show_title']) : |
| 1821 |
printf( |
| 1822 |
'<%1$s class="usk-title" data-swiper-parallax-X="-100"><a href="%2$s">%3$s</a></%1$s>', |
| 1823 |
esc_attr(Utils::get_valid_html_tag($settings['title_tags'])), |
| 1824 |
esc_url($product->get_permalink()), |
| 1825 |
esc_html($product->get_title()) |
| 1826 |
); |
| 1827 |
endif; ?> |
| 1828 |
|
| 1829 |
<?php if ('yes' == $settings['show_excerpt']) : |
| 1830 |
$excerpt = $product->get_short_description(); |
| 1831 |
if (empty($excerpt)) { |
| 1832 |
$excerpt = $product->get_description(); |
| 1833 |
} |
| 1834 |
if (! empty($excerpt)) : ?> |
| 1835 |
<div class="usk-text" data-swiper-parallax-x="-150"> |
| 1836 |
<?php echo wp_kses_post(wp_trim_words($excerpt, $settings['excerpt_limit'], '...')); ?> |
| 1837 |
</div> |
| 1838 |
<?php endif; |
| 1839 |
endif; ?> |
| 1840 |
|
| 1841 |
<?php if (('yes' == $settings['show_price'])) : ?> |
| 1842 |
<div class="usk-price" data-swiper-parallax-X="-200"> |
| 1843 |
<?php |
| 1844 |
$this->print_price_output($product->get_price_html()); |
| 1845 |
?> |
| 1846 |
</div> |
| 1847 |
<?php endif; ?> |
| 1848 |
|
| 1849 |
<?php if ('yes' == $settings['show_rating']) : ?> |
| 1850 |
<div class="usk-rating" data-swiper-parallax-X="-250"> |
| 1851 |
<span><?php echo wp_kses_post($this->register_global_template_wc_rating($average, $rating_count)); ?></span> |
| 1852 |
</div> |
| 1853 |
<?php endif; ?> |
| 1854 |
|
| 1855 |
</div> |
| 1856 |
</div> |
| 1857 |
<div class="usk-action-btn-wrap"> |
| 1858 |
<div> |
| 1859 |
<?php $this->register_global_template_add_to_cart($tooltip_position, $settings); ?> |
| 1860 |
</div> |
| 1861 |
<div> |
| 1862 |
<?php $this->register_global_template_quick_view($product->get_id(), $tooltip_position, $settings); ?> |
| 1863 |
</div> |
| 1864 |
<div> |
| 1865 |
<?php $this->register_global_template_add_to_wishlist($tooltip_position, $settings); ?> |
| 1866 |
</div> |
| 1867 |
</div> |
| 1868 |
</div> |
| 1869 |
|
| 1870 |
<?php endwhile; |
| 1871 |
wp_reset_postdata(); |
| 1872 |
} else { |
| 1873 |
echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>'; |
| 1874 |
} |
| 1875 |
} |
| 1876 |
|
| 1877 |
public function render_thumbs_item() { |
| 1878 |
$settings = $this->get_settings_for_display(); |
| 1879 |
$this->query_product(); |
| 1880 |
$wp_query = $this->get_query(); |
| 1881 |
if ($wp_query->have_posts()) { ?> |
| 1882 |
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); |
| 1883 |
global $product; |
| 1884 |
|
| 1885 |
?> |
| 1886 |
<div class="swiper-slide usk-item"> |
| 1887 |
<?php $this->render_image(); ?> |
| 1888 |
</div> |
| 1889 |
<?php endwhile; |
| 1890 |
wp_reset_postdata(); |
| 1891 |
} else { |
| 1892 |
echo '<div class="usk-alert-warning" usk-alert>' . esc_html__('Ops! There no product to display.', 'ultimate-store-kit') . '</div>'; |
| 1893 |
} |
| 1894 |
} |
| 1895 |
|
| 1896 |
public function render() { |
| 1897 |
$this->render_slider_header(); |
| 1898 |
$this->render_loop_item(); |
| 1899 |
$this->render_slider_footer(); |
| 1900 |
} |
| 1901 |
public function query_product() { |
| 1902 |
$default = $this->getGroupControlQueryArgs(); |
| 1903 |
$this->_query = $this->build_query_from_args($default); |
| 1904 |
} |
| 1905 |
} |
| 1906 |
|