| @@ -7,11 +7,14 @@ | ||
| 7 | 7 | use Elementor\Group_Control_Border; |
| 8 | 8 | use Elementor\Group_Control_Box_Shadow; |
| 9 | 9 | use Elementor\Group_Control_Image_Size; |
| 10 | 10 | use Elementor\Group_Control_Typography; |
| 11 | -use Elementor\Utils; | |
| 11 | +// 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. | |
| 12 | + | |
| 13 | +// use Elementor\Utils; | |
| 12 | 14 | use UltimateStoreKit\Base\Module_Base; |
| 13 | 15 | use UltimateStoreKit\Traits\Global_Terms_Query_Controls; |
| 16 | +use UltimateStoreKit\Classes\Utils; | |
| 14 | 17 | |
| 15 | 18 | use WP_Query; |
| 16 | 19 | |
| 17 | 20 | |
| @@ -43,19 +46,19 @@ | ||
| 43 | 46 | } |
| 44 | 47 | |
| 45 | 48 | public function get_style_depends() { |
| 46 | 49 | if ($this->usk_is_edit_mode()) { |
| 47 | - return ['usk-all-styles']; | |
| 50 | + return ['swiper', 'usk-all-styles']; | |
| 48 | 51 | } else { |
| 49 | - return ['usk-sub-category']; | |
| 52 | + return ['swiper', 'usk-sub-category']; | |
| 50 | 53 | } |
| 51 | 54 | } |
| 52 | 55 | |
| 53 | 56 | public function get_script_depends() { |
| 54 | 57 | if ($this->usk_is_edit_mode()) { |
| 55 | - return ['usk-all-styles']; | |
| 58 | + return ['swiper', 'usk-all-styles']; | |
| 56 | 59 | } else { |
| 57 | - return ['usk-sub-category']; | |
| 60 | + return ['swiper', 'usk-sub-category']; | |
| 58 | 61 | } |
| 59 | 62 | } |
| 60 | 63 | // public function get_custom_help_url() { |
| 61 | 64 | // return 'https://youtu.be/ksy2uZ5Hg3M'; |
| @@ -60,8 +63,11 @@ | ||
| 60 | 63 | // public function get_custom_help_url() { |
| 61 | 64 | // return 'https://youtu.be/ksy2uZ5Hg3M'; |
| 62 | 65 | // } |
| 63 | 66 | |
| 67 | + public function has_widget_inner_wrapper(): bool { | |
| 68 | + return ! \Elementor\Plugin::$instance->experiments->is_feature_active('e_optimized_markup'); | |
| 69 | + } | |
| 64 | 70 | protected function register_controls() { |
| 65 | 71 | $this->start_controls_section( |
| 66 | 72 | 'section_content_layout', |
| 67 | 73 | [ |
| @@ -70,9 +76,9 @@ | ||
| 70 | 76 | ); |
| 71 | 77 | $this->add_responsive_control( |
| 72 | 78 | 'columns', |
| 73 | 79 | [ |
| 74 | - 'label' => __('Columns', 'ultimate-store-kit-pro'), | |
| 80 | + 'label' => __('Columns', 'ultimate-store-kit'), | |
| 75 | 81 | 'type' => Controls_Manager::SELECT, |
| 76 | 82 | 'default' => 3, |
| 77 | 83 | 'tablet_default' => 2, |
| 78 | 84 | 'mobile_default' => 1, |
| @@ -121,8 +127,67 @@ | ||
| 121 | 127 | 'exclude' => ['custom'], |
| 122 | 128 | 'default' => 'medium', |
| 123 | 129 | ] |
| 124 | 130 | ); |
| 131 | + | |
| 132 | + $this->add_responsive_control( | |
| 133 | + 'item_flex_direction', | |
| 134 | + [ | |
| 135 | + 'label' => esc_html__('Direction', 'ultimate-store-kit'), | |
| 136 | + 'type' => Controls_Manager::CHOOSE, | |
| 137 | + 'options' => [ | |
| 138 | + 'row' => [ | |
| 139 | + 'title' => esc_html__('Row - horizontal', 'ultimate-store-kit'), | |
| 140 | + 'icon' => 'eicon-arrow-right', | |
| 141 | + ], | |
| 142 | + 'column' => [ | |
| 143 | + 'title' => esc_html__('Column - vertical', 'ultimate-store-kit'), | |
| 144 | + 'icon' => 'eicon-arrow-down', | |
| 145 | + ], | |
| 146 | + 'row-reverse' => [ | |
| 147 | + 'title' => esc_html__('Row - reversed', 'ultimate-store-kit'), | |
| 148 | + 'icon' => 'eicon-arrow-left', | |
| 149 | + ], | |
| 150 | + 'column-reverse' => [ | |
| 151 | + 'title' => esc_html__('Column - reversed', 'ultimate-store-kit'), | |
| 152 | + 'icon' => 'eicon-arrow-up', | |
| 153 | + ], | |
| 154 | + ], | |
| 155 | + 'selectors' => [ | |
| 156 | + '{{WRAPPER}} .usk-sub-category .usk-item' => 'flex-direction: {{VALUE}};', | |
| 157 | + ], | |
| 158 | + ] | |
| 159 | + ); | |
| 160 | + | |
| 161 | + $this->add_responsive_control( | |
| 162 | + 'text_align', | |
| 163 | + [ | |
| 164 | + 'label' => esc_html__('Text Align', 'ultimate-store-kit'), | |
| 165 | + 'type' => Controls_Manager::CHOOSE, | |
| 166 | + 'options' => [ | |
| 167 | + 'left' => [ | |
| 168 | + 'title' => esc_html__('Left', 'ultimate-store-kit'), | |
| 169 | + 'icon' => 'eicon-text-align-left', | |
| 170 | + ], | |
| 171 | + 'center' => [ | |
| 172 | + 'title' => esc_html__('Center', 'ultimate-store-kit'), | |
| 173 | + 'icon' => 'eicon-text-align-center', | |
| 174 | + ], | |
| 175 | + 'right' => [ | |
| 176 | + 'title' => esc_html__('Right', 'ultimate-store-kit'), | |
| 177 | + 'icon' => 'eicon-text-align-right', | |
| 178 | + ], | |
| 179 | + 'justify' => [ | |
| 180 | + 'title' => esc_html__('Justify', 'ultimate-store-kit'), | |
| 181 | + 'icon' => 'eicon-text-align-justify', | |
| 182 | + ], | |
| 183 | + ], | |
| 184 | + 'selectors' => [ | |
| 185 | + '{{WRAPPER}} .usk-sub-category .usk-content' => 'text-align: {{VALUE}};', | |
| 186 | + ], | |
| 187 | + ] | |
| 188 | + ); | |
| 189 | + | |
| 125 | 190 | $this->end_controls_section(); |
| 126 | 191 | $this->start_controls_section( |
| 127 | 192 | 'section_term_query', |
| 128 | 193 | [ |
| @@ -130,26 +195,8 @@ | ||
| 130 | 195 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 131 | 196 | ] |
| 132 | 197 | ); |
| 133 | 198 | |
| 134 | - | |
| 135 | - // $this->add_control( | |
| 136 | - // 'item_limit', | |
| 137 | - // [ | |
| 138 | - // 'label' => esc_html__('Item Limit', 'ultimate-store-kit'), | |
| 139 | - // 'type' => Controls_Manager::SLIDER, | |
| 140 | - // 'range' => [ | |
| 141 | - // 'px' => [ | |
| 142 | - // 'min' => 1, | |
| 143 | - // 'max' => 20, | |
| 144 | - // ], | |
| 145 | - // ], | |
| 146 | - // 'default' => [ | |
| 147 | - // 'size' => 6, | |
| 148 | - // ], | |
| 149 | - // ] | |
| 150 | - // ); | |
| 151 | - | |
| 152 | 199 | $this->start_controls_tabs( |
| 153 | 200 | 'tabs_terms_include_exclude', |
| 154 | 201 | [] |
| 155 | 202 | ); |
| @@ -213,10 +260,10 @@ | ||
| 213 | 260 | 'label' => __('Order', 'ultimate-store-kit'), |
| 214 | 261 | 'type' => Controls_Manager::SELECT, |
| 215 | 262 | 'default' => 'desc', |
| 216 | 263 | 'options' => [ |
| 217 | - 'desc' => __('Descending', 'ultimate-store-kit'), | |
| 218 | - 'asc' => __('Ascending', 'ultimate-store-kit'), | |
| 264 | + 'desc' => __('DESC', 'ultimate-store-kit'), | |
| 265 | + 'asc' => __('ASC', 'ultimate-store-kit'), | |
| 219 | 266 | ], |
| 220 | 267 | ] |
| 221 | 268 | ); |
| 222 | 269 | $this->add_control( |
| @@ -223,13 +270,17 @@ | ||
| 223 | 270 | 'hide_empty', |
| 224 | 271 | [ |
| 225 | 272 | 'label' => __('Hide Empty', 'ultimate-store-kit'), |
| 226 | 273 | 'type' => Controls_Manager::SWITCHER, |
| 274 | + 'default' => 'yes', | |
| 227 | 275 | ] |
| 228 | 276 | ); |
| 229 | 277 | |
| 230 | 278 | $this->end_controls_section(); |
| 231 | 279 | |
| 280 | + /** | |
| 281 | + * Style Tab | |
| 282 | + */ | |
| 232 | 283 | $this->start_controls_section( |
| 233 | 284 | 'section_style_item', |
| 234 | 285 | [ |
| 235 | 286 | 'label' => esc_html__('Item', 'ultimate-store-kit'), |
| @@ -248,12 +299,33 @@ | ||
| 248 | 299 | $this->add_group_control( |
| 249 | 300 | Group_Control_Background::get_type(), |
| 250 | 301 | [ |
| 251 | 302 | 'name' => 'item_background', |
| 252 | - 'selector' => '{{WRAPPER}} .usk-sub-category-item', | |
| 303 | + 'selector' => '{{WRAPPER}} .usk-sub-category .usk-item', | |
| 253 | 304 | ] |
| 254 | 305 | ); |
| 306 | + | |
| 307 | + $this->add_group_control( | |
| 308 | + Group_Control_Border::get_type(), | |
| 309 | + [ | |
| 310 | + 'name' => 'item_border', | |
| 311 | + 'label' => esc_html__('Border', 'ultimate-store-kit'), | |
| 312 | + 'selector' => '{{WRAPPER}} .usk-sub-category .usk-item', | |
| 313 | + 'separator' => 'before', | |
| 314 | + ] | |
| 315 | + ); | |
| 255 | 316 | $this->add_responsive_control( |
| 317 | + 'item_radius', | |
| 318 | + [ | |
| 319 | + 'label' => esc_html__('Border Radius', 'ultimate-store-kit'), | |
| 320 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 321 | + 'size_units' => ['px', '%', 'em'], | |
| 322 | + 'selectors' => [ | |
| 323 | + '{{WRAPPER}} .usk-sub-category .usk-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 324 | + ], | |
| 325 | + ] | |
| 326 | + ); | |
| 327 | + $this->add_responsive_control( | |
| 256 | 328 | 'item_padding', |
| 257 | 329 | [ |
| 258 | 330 | 'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 259 | 331 | 'type' => Controls_Manager::DIMENSIONS, |
| @@ -258,9 +330,9 @@ | ||
| 258 | 330 | 'label' => esc_html__('Padding', 'ultimate-store-kit'), |
| 259 | 331 | 'type' => Controls_Manager::DIMENSIONS, |
| 260 | 332 | 'size_units' => ['px', '%', 'em'], |
| 261 | 333 | 'selectors' => [ |
| 262 | - '{{WRAPPER}} .usk-sub-category-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 334 | + '{{WRAPPER}} .usk-sub-category .usk-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 263 | 335 | ], |
| 264 | 336 | ] |
| 265 | 337 | ); |
| 266 | 338 | $this->add_responsive_control( |
| @@ -269,28 +341,20 @@ | ||
| 269 | 341 | 'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 270 | 342 | 'type' => Controls_Manager::DIMENSIONS, |
| 271 | 343 | 'size_units' => ['px', '%', 'em'], |
| 272 | 344 | 'selectors' => [ |
| 273 | - '{{WRAPPER}} .usk-sub-category-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 345 | + '{{WRAPPER}} .usk-sub-category .usk-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 274 | 346 | ], |
| 275 | 347 | ] |
| 276 | 348 | ); |
| 277 | - $this->add_group_control( | |
| 278 | - Group_Control_Border::get_type(), | |
| 279 | - [ | |
| 280 | - 'name' => 'item_border', | |
| 281 | - 'label' => esc_html__('Border', 'ultimate-store-kit'), | |
| 282 | - 'selector' => '{{WRAPPER}} .usk-sub-category-item', | |
| 283 | - ] | |
| 284 | - ); | |
| 285 | 349 | $this->add_responsive_control( |
| 286 | - 'item_radius', | |
| 350 | + 'space_between', | |
| 287 | 351 | [ |
| 288 | - 'label' => esc_html__('Radius', 'ultimate-store-kit'), | |
| 289 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 290 | - 'size_units' => ['px', '%', 'em'], | |
| 291 | - 'selectors' => [ | |
| 292 | - '{{WRAPPER}} .usk-sub-category-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 352 | + 'label' => esc_html__('Space Between', 'ultimate-store-kit'), | |
| 353 | + 'type' => Controls_Manager::SLIDER, | |
| 354 | + 'size_units' => ['px', 'em', '%'], | |
| 355 | + 'selectors' => [ | |
| 356 | + '{{WRAPPER}} .usk-sub-category .usk-item' => 'gap: {{SIZE}}{{UNIT}};', | |
| 293 | 357 | ], |
| 294 | 358 | ] |
| 295 | 359 | ); |
| 296 | 360 | |
| @@ -297,11 +361,12 @@ | ||
| 297 | 361 | $this->add_group_control( |
| 298 | 362 | Group_Control_Box_Shadow::get_type(), |
| 299 | 363 | [ |
| 300 | 364 | 'name' => 'item_shadow', |
| 301 | - 'selector' => '{{WRAPPER}} .usk-sub-category-item', | |
| 365 | + 'selector' => '{{WRAPPER}} .usk-sub-category .usk-item', | |
| 302 | 366 | ] |
| 303 | 367 | ); |
| 368 | + | |
| 304 | 369 | $this->end_controls_tab(); |
| 305 | 370 | $this->start_controls_tab( |
| 306 | 371 | 'item_tab_hover', |
| 307 | 372 | [ |
| @@ -313,9 +378,9 @@ | ||
| 313 | 378 | [ |
| 314 | 379 | 'label' => esc_html__('Border Color', 'ultimate-store-kit'), |
| 315 | 380 | 'type' => Controls_Manager::COLOR, |
| 316 | 381 | 'selectors' => [ |
| 317 | - '{{WRAPPER}} .usk-sub-category-item:hover' => 'border-color: {{VALUE}}', | |
| 382 | + '{{WRAPPER}} .usk-sub-category .usk-item:hover' => 'border-color: {{VALUE}}', | |
| 318 | 383 | ], |
| 319 | 384 | ] |
| 320 | 385 | ); |
| 321 | 386 | $this->add_group_control( |
| @@ -321,9 +386,9 @@ | ||
| 321 | 386 | $this->add_group_control( |
| 322 | 387 | Group_Control_Box_Shadow::get_type(), |
| 323 | 388 | [ |
| 324 | 389 | 'name' => 'item_hover_shadow', |
| 325 | - 'selector' => '{{WRAPPER}} .usk-sub-category-item:hover', | |
| 390 | + 'selector' => '{{WRAPPER}} .usk-sub-category .usk-item:hover', | |
| 326 | 391 | ] |
| 327 | 392 | ); |
| 328 | 393 | $this->end_controls_tab(); |
| 329 | 394 | $this->end_controls_tabs(); |
| @@ -334,8 +399,108 @@ | ||
| 334 | 399 | 'label' => esc_html__('Image', 'ultimate-store-kit'), |
| 335 | 400 | 'tab' => Controls_Manager::TAB_STYLE, |
| 336 | 401 | ] |
| 337 | 402 | ); |
| 403 | + $this->add_responsive_control( | |
| 404 | + 'image_height', | |
| 405 | + [ | |
| 406 | + 'label' => esc_html__('Height', 'ultimate-store-kit'), | |
| 407 | + 'type' => Controls_Manager::SLIDER, | |
| 408 | + 'size_units' => ['px', '%'], | |
| 409 | + 'range' => [ | |
| 410 | + 'px' => [ | |
| 411 | + 'min' => 50, | |
| 412 | + 'max' => 500, | |
| 413 | + 'step' => 1, | |
| 414 | + ], | |
| 415 | + '%' => [ | |
| 416 | + 'min' => 10, | |
| 417 | + 'max' => 100, | |
| 418 | + 'step' => 1, | |
| 419 | + ], | |
| 420 | + ], | |
| 421 | + 'selectors' => [ | |
| 422 | + '{{WRAPPER}} .usk-sub-category .usk-image-slider .swiper-slide' => 'height: {{SIZE}}{{UNIT}};', | |
| 423 | + ], | |
| 424 | + ] | |
| 425 | + ); | |
| 426 | + $this->add_responsive_control( | |
| 427 | + 'image_width', | |
| 428 | + [ | |
| 429 | + 'label' => esc_html__('Width', 'ultimate-store-kit'), | |
| 430 | + 'type' => Controls_Manager::SLIDER, | |
| 431 | + 'size_units' => ['px', '%'], | |
| 432 | + 'range' => [ | |
| 433 | + 'px' => [ | |
| 434 | + 'min' => 50, | |
| 435 | + 'max' => 500, | |
| 436 | + 'step' => 1, | |
| 437 | + ], | |
| 438 | + '%' => [ | |
| 439 | + 'min' => 10, | |
| 440 | + 'max' => 100, | |
| 441 | + 'step' => 1, | |
| 442 | + ], | |
| 443 | + ], | |
| 444 | + 'selectors' => [ | |
| 445 | + '{{WRAPPER}} .usk-sub-category .usk-image-slider' => 'width: {{SIZE}}{{UNIT}};', | |
| 446 | + ], | |
| 447 | + ] | |
| 448 | + ); | |
| 449 | + $this->add_responsive_control( | |
| 450 | + 'image_alignment', | |
| 451 | + [ | |
| 452 | + 'label' => esc_html__('Alignment', 'ultimate-store-kit'), | |
| 453 | + 'type' => Controls_Manager::CHOOSE, | |
| 454 | + 'options' => [ | |
| 455 | + 'left' => [ | |
| 456 | + 'title' => esc_html__('Left', 'ultimate-store-kit'), | |
| 457 | + 'icon' => 'eicon-h-align-left', | |
| 458 | + ], | |
| 459 | + 'center' => [ | |
| 460 | + 'title' => esc_html__('Center', 'ultimate-store-kit'), | |
| 461 | + 'icon' => 'eicon-h-align-center', | |
| 462 | + ], | |
| 463 | + 'right' => [ | |
| 464 | + 'title' => esc_html__('Right', 'ultimate-store-kit'), | |
| 465 | + 'icon' => 'eicon-h-align-right', | |
| 466 | + ], | |
| 467 | + ], | |
| 468 | + 'selectors_dictionary' => [ | |
| 469 | + 'left' => 'margin-left: inherit;', | |
| 470 | + 'center' => 'margin-left: auto; margin-right: auto;', | |
| 471 | + 'right' => 'margin-right: inherit;', | |
| 472 | + ], | |
| 473 | + 'selectors' => [ | |
| 474 | + '{{WRAPPER}} .usk-sub-category .usk-image-slider' => '{{VALUE}}', | |
| 475 | + ], | |
| 476 | + 'conditions' => [ | |
| 477 | + 'relation' => 'and', | |
| 478 | + 'terms' => [ | |
| 479 | + [ | |
| 480 | + 'name' => 'image_width[size]', | |
| 481 | + 'operator' => '>', | |
| 482 | + 'value' => 0, | |
| 483 | + ], | |
| 484 | + [ | |
| 485 | + 'relation' => 'or', | |
| 486 | + 'terms' => [ | |
| 487 | + [ | |
| 488 | + 'name' => 'item_flex_direction', | |
| 489 | + 'operator' => '==', | |
| 490 | + 'value' => 'column', | |
| 491 | + ], | |
| 492 | + [ | |
| 493 | + 'name' => 'item_flex_direction', | |
| 494 | + 'operator' => '==', | |
| 495 | + 'value' => 'column-reverse', | |
| 496 | + ], | |
| 497 | + ], | |
| 498 | + ], | |
| 499 | + ], | |
| 500 | + ], | |
| 501 | + ] | |
| 502 | + ); | |
| 338 | 503 | |
| 339 | 504 | $this->add_group_control( |
| 340 | 505 | Group_Control_Border::get_type(), |
| 341 | 506 | [ |
| @@ -340,9 +505,10 @@ | ||
| 340 | 505 | Group_Control_Border::get_type(), |
| 341 | 506 | [ |
| 342 | 507 | 'name' => 'image_border', |
| 343 | 508 | 'label' => esc_html__('Image Border', 'ultimate-store-kit'), |
| 344 | - 'selector' => '{{WRAPPER}} .usk-sub-category .usk-image-slider .usk-image-wrap .usk-img', | |
| 509 | + 'selector' => '{{WRAPPER}} .usk-sub-category .usk-image-slider .swiper-slide', | |
| 510 | + 'separator' => 'before', | |
| 345 | 511 | ] |
| 346 | 512 | ); |
| 347 | 513 | |
| 348 | 514 | $this->add_responsive_control( |
| @@ -351,24 +517,13 @@ | ||
| 351 | 517 | 'label' => esc_html__('Border Radius', 'ultimate-store-kit'), |
| 352 | 518 | 'type' => Controls_Manager::DIMENSIONS, |
| 353 | 519 | 'size_units' => ['px', '%'], |
| 354 | 520 | 'selectors' => [ |
| 355 | - '{{WRAPPER}} .usk-sub-category .usk-image-slider .usk-image-wrap .usk-img ' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 521 | + '{{WRAPPER}} .usk-sub-category .usk-image-slider .swiper-slide' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 356 | 522 | ], |
| 357 | 523 | ] |
| 358 | 524 | ); |
| 359 | 525 | |
| 360 | - // $this->add_group_control( | |
| 361 | - // Group_Control_Box_Shadow::get_type(), | |
| 362 | - // [ | |
| 363 | - // 'name' => 'image_shadow', | |
| 364 | - // 'exclude' => [ | |
| 365 | - // 'shadow_position', | |
| 366 | - // ], | |
| 367 | - // 'selector' => '{{WRAPPER}} .usk-sub-category .usk-image-slider .usk-image-wrap .usk-img', | |
| 368 | - // ] | |
| 369 | - // ); | |
| 370 | - | |
| 371 | 526 | $this->end_controls_section(); |
| 372 | 527 | $this->start_controls_section( |
| 373 | 528 | 'section_style_title', |
| 374 | 529 | [ |
| @@ -375,9 +530,8 @@ | ||
| 375 | 530 | 'label' => esc_html__('Title', 'ultimate-store-kit'), |
| 376 | 531 | 'tab' => Controls_Manager::TAB_STYLE, |
| 377 | 532 | ] |
| 378 | 533 | ); |
| 379 | - | |
| 380 | 534 | $this->add_control( |
| 381 | 535 | 'title_color', |
| 382 | 536 | [ |
| 383 | 537 | 'label' => esc_html__('Color', 'ultimate-store-kit'), |
| @@ -382,24 +536,12 @@ | ||
| 382 | 536 | [ |
| 383 | 537 | 'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 384 | 538 | 'type' => Controls_Manager::COLOR, |
| 385 | 539 | 'selectors' => [ |
| 386 | - '{{WRAPPER}} .usk-sub-category .usk-category-name' => 'color: {{VALUE}}', | |
| 540 | + '{{WRAPPER}} .usk-sub-category .usk-name' => 'color: {{VALUE}}', | |
| 387 | 541 | ], |
| 388 | 542 | ] |
| 389 | 543 | ); |
| 390 | - | |
| 391 | - $this->add_control( | |
| 392 | - 'hover_title_color', | |
| 393 | - [ | |
| 394 | - 'label' => esc_html__('Hover Color', 'ultimate-store-kit'), | |
| 395 | - 'type' => Controls_Manager::COLOR, | |
| 396 | - 'selectors' => [ | |
| 397 | - '{{WRAPPER}} .usk-sub-category .usk-category-name:hover' => 'color: {{VALUE}};', | |
| 398 | - ], | |
| 399 | - ] | |
| 400 | - ); | |
| 401 | - | |
| 402 | 544 | $this->add_responsive_control( |
| 403 | 545 | 'title_margin', |
| 404 | 546 | [ |
| 405 | 547 | 'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| @@ -405,9 +547,9 @@ | ||
| 405 | 547 | 'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 406 | 548 | 'type' => Controls_Manager::DIMENSIONS, |
| 407 | 549 | 'size_units' => ['px', '%'], |
| 408 | 550 | 'selectors' => [ |
| 409 | - '{{WRAPPER}} .usk-sub-category .usk-category-name' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 551 | + '{{WRAPPER}} .usk-sub-category .usk-name' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 410 | 552 | ], |
| 411 | 553 | ] |
| 412 | 554 | ); |
| 413 | 555 | $this->add_group_control( |
| @@ -414,9 +556,9 @@ | ||
| 414 | 556 | Group_Control_Typography::get_type(), |
| 415 | 557 | [ |
| 416 | 558 | 'name' => 'title_typography', |
| 417 | 559 | 'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 418 | - 'selector' => '{{WRAPPER}} .usk-sub-category .usk-category-name', | |
| 560 | + 'selector' => '{{WRAPPER}} .usk-sub-category .usk-name', | |
| 419 | 561 | ] |
| 420 | 562 | ); |
| 421 | 563 | $this->end_controls_section(); |
| 422 | 564 | $this->start_controls_section( |
| @@ -432,9 +574,9 @@ | ||
| 432 | 574 | [ |
| 433 | 575 | 'label' => esc_html__('Color', 'ultimate-store-kit'), |
| 434 | 576 | 'type' => Controls_Manager::COLOR, |
| 435 | 577 | 'selectors' => [ |
| 436 | - '{{WRAPPER}} .usk-sub-category .usk-category-list li a' => 'color: {{VALUE}}', | |
| 578 | + '{{WRAPPER}} .usk-sub-category .usk-list a' => 'color: {{VALUE}}', | |
| 437 | 579 | ], |
| 438 | 580 | ] |
| 439 | 581 | ); |
| 440 | 582 | |
| @@ -443,9 +585,9 @@ | ||
| 443 | 585 | [ |
| 444 | 586 | 'label' => esc_html__('Hover Color', 'ultimate-store-kit'), |
| 445 | 587 | 'type' => Controls_Manager::COLOR, |
| 446 | 588 | 'selectors' => [ |
| 447 | - '{{WRAPPER}} .usk-sub-category .usk-category-list li a:hover' => 'color: {{VALUE}};', | |
| 589 | + '{{WRAPPER}} .usk-sub-category .usk-list a:hover' => 'color: {{VALUE}};', | |
| 448 | 590 | ], |
| 449 | 591 | ] |
| 450 | 592 | ); |
| 451 | 593 | |
| @@ -455,9 +597,9 @@ | ||
| 455 | 597 | 'label' => esc_html__('Margin', 'ultimate-store-kit'), |
| 456 | 598 | 'type' => Controls_Manager::DIMENSIONS, |
| 457 | 599 | 'size_units' => ['px', '%'], |
| 458 | 600 | 'selectors' => [ |
| 459 | - '{{WRAPPER}} .usk-sub-category .usk-category-list li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 601 | + '{{WRAPPER}} .usk-sub-category .usk-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 460 | 602 | ], |
| 461 | 603 | ] |
| 462 | 604 | ); |
| 463 | 605 | $this->add_group_control( |
| @@ -464,9 +606,9 @@ | ||
| 464 | 606 | Group_Control_Typography::get_type(), |
| 465 | 607 | [ |
| 466 | 608 | 'name' => 'sub_category_typography', |
| 467 | 609 | 'label' => esc_html__('Typography', 'ultimate-store-kit'), |
| 468 | - 'selector' => '{{WRAPPER}} .usk-sub-category .usk-category-list li a', | |
| 610 | + 'selector' => '{{WRAPPER}} .usk-sub-category .usk-list a', | |
| 469 | 611 | ] |
| 470 | 612 | ); |
| 471 | 613 | $this->end_controls_section(); |
| 472 | 614 | $this->start_controls_section( |
| @@ -471,9 +613,9 @@ | ||
| 471 | 613 | $this->end_controls_section(); |
| 472 | 614 | $this->start_controls_section( |
| 473 | 615 | 'section_style_all_category', |
| 474 | 616 | [ |
| 475 | - 'label' => esc_html__('All Category', 'ultimate-store-kit'), | |
| 617 | + 'label' => esc_html__('Read More', 'ultimate-store-kit'), | |
| 476 | 618 | 'tab' => Controls_Manager::TAB_STYLE, |
| 477 | 619 | ] |
| 478 | 620 | ); |
| 479 | 621 | |
| @@ -518,295 +660,8 @@ | ||
| 518 | 660 | 'selector' => '{{WRAPPER}} .usk-sub-category .usk-link-btn a', |
| 519 | 661 | ] |
| 520 | 662 | ); |
| 521 | 663 | $this->end_controls_section(); |
| 522 | - // $this->start_controls_section( | |
| 523 | - // 'section_style_content', | |
| 524 | - // [ | |
| 525 | - // 'label' => esc_html__('Content', 'ultimate-store-kit'), | |
| 526 | - // 'tab' => Controls_Manager::TAB_STYLE, | |
| 527 | - // ] | |
| 528 | - // ); | |
| 529 | - | |
| 530 | - // $this->add_control( | |
| 531 | - // 'content_color', | |
| 532 | - // [ | |
| 533 | - // 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 534 | - // 'type' => Controls_Manager::COLOR, | |
| 535 | - // 'selectors' => [ | |
| 536 | - // '{{WRAPPER}} .usk-sub-category-item .usk-review-text' => 'color: {{VALUE}}', | |
| 537 | - // ], | |
| 538 | - // ] | |
| 539 | - // ); | |
| 540 | - | |
| 541 | - // $this->add_control( | |
| 542 | - // 'hover_content_color', | |
| 543 | - // [ | |
| 544 | - // 'label' => esc_html__('Hover Color', 'ultimate-store-kit'), | |
| 545 | - // 'type' => Controls_Manager::COLOR, | |
| 546 | - // 'selectors' => [ | |
| 547 | - // '{{WRAPPER}} .usk-sub-category-item .usk-review-text:hover' => 'color: {{VALUE}};', | |
| 548 | - // ], | |
| 549 | - // ] | |
| 550 | - // ); | |
| 551 | - // $this->add_group_control( | |
| 552 | - // Group_Control_Typography::get_type(), | |
| 553 | - // [ | |
| 554 | - // 'name' => 'content_typography', | |
| 555 | - // 'label' => esc_html__('Typography', 'ultimate-store-kit'), | |
| 556 | - // 'selector' => '{{WRAPPER}} .usk-sub-category-item .usk-review-text', | |
| 557 | - // ] | |
| 558 | - // ); | |
| 559 | - | |
| 560 | - // $this->end_controls_section(); | |
| 561 | - // $this->start_controls_section( | |
| 562 | - // 'section_style_rating', | |
| 563 | - // [ | |
| 564 | - // 'label' => esc_html__('Rating', 'ultimate-store-kit'), | |
| 565 | - // 'tab' => Controls_Manager::TAB_STYLE, | |
| 566 | - // // 'condition' => [ | |
| 567 | - // // 'show_rating' => 'yes', | |
| 568 | - // // ], | |
| 569 | - // ] | |
| 570 | - // ); | |
| 571 | - // $this->add_control( | |
| 572 | - // 'rating_color', | |
| 573 | - // [ | |
| 574 | - // 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 575 | - // 'type' => Controls_Manager::COLOR, | |
| 576 | - // 'default' => '#e7e7e7', | |
| 577 | - // 'selectors' => [ | |
| 578 | - // '{{WRAPPER}} .ultimate-store-kit-review-wrapper .usk-review-info-wrap .usk-review-rating .usk-rating-text' => 'color: {{VALUE}};', | |
| 579 | - // ], | |
| 580 | - // ] | |
| 581 | - // ); | |
| 582 | - | |
| 583 | - // $this->add_control( | |
| 584 | - // 'rating_bg_color', | |
| 585 | - // [ | |
| 586 | - // 'label' => esc_html__('Background', 'ultimate-store-kit'), | |
| 587 | - // 'type' => Controls_Manager::COLOR, | |
| 588 | - // 'default' => '#FFCC00', | |
| 589 | - // 'selectors' => [ | |
| 590 | - // '{{WRAPPER}} .ultimate-store-kit-review-wrapper .usk-review-info-wrap .usk-review-rating span .usk-rating-icon' => 'color: {{VALUE}};', | |
| 591 | - // ], | |
| 592 | - // ] | |
| 593 | - // ); | |
| 594 | - // $this->add_group_control( | |
| 595 | - // Group_Control_Typography::get_type(), | |
| 596 | - // [ | |
| 597 | - // 'name' => 'rating_typography', | |
| 598 | - // 'label' => esc_html__('Typography', 'ultimate-store-kit'), | |
| 599 | - // 'selector' => '{{WRAPPER}} .ultimate-store-kit-review-wrapper .usk-review-info-wrap .usk-review-rating .usk-rating-text', | |
| 600 | - // ] | |
| 601 | - // ); | |
| 602 | - | |
| 603 | - // $this->end_controls_section(); | |
| 604 | - // $this->start_controls_section( | |
| 605 | - // 'badge', | |
| 606 | - // [ | |
| 607 | - // 'label' => esc_html__('Badge', 'ultimate-store-kit'), | |
| 608 | - // 'tab' => Controls_Manager::TAB_STYLE, | |
| 609 | - // ] | |
| 610 | - // ); | |
| 611 | - // $this->start_controls_tabs( | |
| 612 | - // 'label_badge_tabs' | |
| 613 | - // ); | |
| 614 | - // $this->start_controls_tab( | |
| 615 | - // 'sale_badge_tab', | |
| 616 | - // [ | |
| 617 | - // 'label' => esc_html__( | |
| 618 | - // 'Sale', | |
| 619 | - // 'ultimate-store-kit' | |
| 620 | - // ), | |
| 621 | - // 'condition' => [ | |
| 622 | - // 'show_sale_badge' => 'yes', | |
| 623 | - // ], | |
| 624 | - // ] | |
| 625 | - // ); | |
| 626 | - // $this->add_control( | |
| 627 | - // 'sale_badge_color', | |
| 628 | - // [ | |
| 629 | - // 'label' => esc_html__( | |
| 630 | - // 'Color', | |
| 631 | - // 'ultimate-store-kit' | |
| 632 | - // ), | |
| 633 | - // 'type' => Controls_Manager::COLOR, | |
| 634 | - // 'selectors' => [ | |
| 635 | - // '{{WRAPPER}} .usk-list-wrap .usk-sub-category-item .usk-sub-category-item-box .usk-badge-label-wrapper .usk-sale-badge .usk-badge' => 'color: {{VALUE}}', | |
| 636 | - // ], | |
| 637 | - // ] | |
| 638 | - // ); | |
| 639 | - // $this->add_control( | |
| 640 | - // 'sale_badge_bg', | |
| 641 | - // [ | |
| 642 | - // 'label' => esc_html__('Background', 'ultimae-woo-kit'), | |
| 643 | - // 'type' => Controls_Manager::COLOR, | |
| 644 | - // 'selectors' => [ | |
| 645 | - // '{{WRAPPER}} .usk-list-wrap .usk-sub-category-item .usk-sub-category-item-box .usk-badge-label-wrapper .usk-sale-badge .usk-badge' => 'background: {{VALUE}}', | |
| 646 | - // ], | |
| 647 | - // ] | |
| 648 | - // ); | |
| 649 | - // $this->end_controls_tab(); | |
| 650 | - // $this->start_controls_tab( | |
| 651 | - // 'percentage_badge_tab', | |
| 652 | - // [ | |
| 653 | - // 'label' => esc_html__('Percentage', 'ultimate-store-kit'), | |
| 654 | - // 'condition' => [ | |
| 655 | - // 'show_percentage_badge' => 'yes', | |
| 656 | - // ], | |
| 657 | - // ] | |
| 658 | - // ); | |
| 659 | - // $this->add_control( | |
| 660 | - // 'percentage_badge_color', | |
| 661 | - // [ | |
| 662 | - // 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 663 | - // 'type' => Controls_Manager::COLOR, | |
| 664 | - // 'selectors' => [ | |
| 665 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-percantage-badge .usk-badge' => 'color: {{VALUE}}', | |
| 666 | - // ], | |
| 667 | - // ] | |
| 668 | - // ); | |
| 669 | - // $this->add_control( | |
| 670 | - // 'percentage_badge_bg', | |
| 671 | - // [ | |
| 672 | - // 'label' => esc_html__('Background', 'ultimae-woo-kit'), | |
| 673 | - // 'type' => Controls_Manager::COLOR, | |
| 674 | - // 'selectors' => [ | |
| 675 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-percantage-badge .usk-badge' => 'background: {{VALUE}}', | |
| 676 | - // ], | |
| 677 | - // ] | |
| 678 | - // ); | |
| 679 | - // $this->end_controls_tab(); | |
| 680 | - // $this->start_controls_tab( | |
| 681 | - // 'stock_badge_tab', | |
| 682 | - // [ | |
| 683 | - // 'label' => esc_html__('Stock', 'ultimate-store-kit'), | |
| 684 | - // 'condition' => [ | |
| 685 | - // 'show_stock_status' => 'yes', | |
| 686 | - // ], | |
| 687 | - // ] | |
| 688 | - // ); | |
| 689 | - // $this->add_control( | |
| 690 | - // 'stock_badge_color', | |
| 691 | - // [ | |
| 692 | - // 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 693 | - // 'type' => Controls_Manager::COLOR, | |
| 694 | - // 'selectors' => [ | |
| 695 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-stock-status-badge .usk-badge' => 'color: {{VALUE}}', | |
| 696 | - // ], | |
| 697 | - // ] | |
| 698 | - // ); | |
| 699 | - // $this->add_control( | |
| 700 | - // 'stock_badge_bg', | |
| 701 | - // [ | |
| 702 | - // 'label' => esc_html__('Background', 'ultimae-woo-kit'), | |
| 703 | - // 'type' => Controls_Manager::COLOR, | |
| 704 | - // 'selectors' => [ | |
| 705 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-stock-status-badge .usk-badge' => 'background: {{VALUE}}', | |
| 706 | - // ], | |
| 707 | - // ] | |
| 708 | - // ); | |
| 709 | - // $this->end_controls_tab(); | |
| 710 | - // $this->start_controls_tab( | |
| 711 | - // 'trending_badge_tab', | |
| 712 | - // [ | |
| 713 | - // 'label' => esc_html__('Trending', 'ultimate-store-kit'), | |
| 714 | - // 'condition' => [ | |
| 715 | - // 'show_trending_badge' => 'yes', | |
| 716 | - // ], | |
| 717 | - // ] | |
| 718 | - // ); | |
| 719 | - // $this->add_control( | |
| 720 | - // 'trending_badge_color', | |
| 721 | - // [ | |
| 722 | - // 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 723 | - // 'type' => Controls_Manager::COLOR, | |
| 724 | - // 'selectors' => [ | |
| 725 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-trending-badge .usk-badge' => 'color: {{VALUE}}', | |
| 726 | - // ], | |
| 727 | - // ] | |
| 728 | - // ); | |
| 729 | - // $this->add_control( | |
| 730 | - // 'trending_badge_bg', | |
| 731 | - // [ | |
| 732 | - // 'label' => esc_html__('Background', 'ultimae-woo-kit'), | |
| 733 | - // 'type' => Controls_Manager::COLOR, | |
| 734 | - // 'selectors' => [ | |
| 735 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-trending-badge .usk-badge' => 'background: {{VALUE}}', | |
| 736 | - // ], | |
| 737 | - // ] | |
| 738 | - // ); | |
| 739 | - | |
| 740 | - // $this->end_controls_tab(); | |
| 741 | - // $this->start_controls_tab( | |
| 742 | - // 'new_badge_tab', | |
| 743 | - // [ | |
| 744 | - // 'label' => esc_html__('new', 'ultimate-store-kit'), | |
| 745 | - // 'condition' => [ | |
| 746 | - // 'show_new_badge' => 'yes', | |
| 747 | - // ], | |
| 748 | - // ] | |
| 749 | - // ); | |
| 750 | - // $this->add_control( | |
| 751 | - // 'new_badge_color', | |
| 752 | - // [ | |
| 753 | - // 'label' => esc_html__('Color', 'ultimate-store-kit'), | |
| 754 | - // 'type' => Controls_Manager::COLOR, | |
| 755 | - // 'selectors' => [ | |
| 756 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-new-badge .usk-badge' => 'color: {{VALUE}}', | |
| 757 | - // ], | |
| 758 | - // ] | |
| 759 | - // ); | |
| 760 | - // $this->add_control( | |
| 761 | - // 'new_badge_bg', | |
| 762 | - // [ | |
| 763 | - // 'label' => esc_html__('Background', 'ultimae-woo-kit'), | |
| 764 | - // 'type' => Controls_Manager::COLOR, | |
| 765 | - // 'selectors' => [ | |
| 766 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-new-badge .usk-badge' => 'background: {{VALUE}}', | |
| 767 | - // ], | |
| 768 | - // ] | |
| 769 | - // ); | |
| 770 | - | |
| 771 | - // $this->end_controls_tab(); | |
| 772 | - // $this->end_controls_tabs(); | |
| 773 | - // $this->add_control( | |
| 774 | - // 'badge_padding', | |
| 775 | - // [ | |
| 776 | - // 'label' => esc_html__('Padding', 'ultimate-store-kit'), | |
| 777 | - // 'type' => Controls_Manager::DIMENSIONS, | |
| 778 | - // 'size_units' => ['px', '%', 'em'], | |
| 779 | - // 'selectors' => [ | |
| 780 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-badge-wrap .usk-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 781 | - // ], | |
| 782 | - // 'separator' => 'before' | |
| 783 | - // ] | |
| 784 | - // ); | |
| 785 | - // $this->add_control( | |
| 786 | - // 'badge_margin', | |
| 787 | - // [ | |
| 788 | - // 'label' => esc_html__('Margin', 'ultimate-store-kit'), | |
| 789 | - // 'type' => Controls_Manager::DIMENSIONS, | |
| 790 | - // 'size_units' => ['px', '%', 'em'], | |
| 791 | - // 'selectors' => [ | |
| 792 | - // 'menu_order' => esc_html__('Menu Order', 'ultimate-store-kit'), | |
| 793 | - // '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-badge-wrap .usk-badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 794 | - // ], | |
| 795 | - // ] | |
| 796 | - // ); | |
| 797 | - // $this->add_group_control( | |
| 798 | - // Group_Control_Typography::get_type(), | |
| 799 | - // [ | |
| 800 | - // 'name' => 'badge_typography', | |
| 801 | - // 'label' => esc_html__( | |
| 802 | - // 'Typography', | |
| 803 | - // 'ultimate-store-kit' | |
| 804 | - // ), | |
| 805 | - // 'selector' => '{{WRAPPER}} .usk-list-wrap .usk-badge-label-wrapper .usk-badge-wrap .usk-badge', | |
| 806 | - // ] | |
| 807 | - // ); | |
| 808 | - // $this->end_controls_section(); | |
| 809 | 664 | $this->render_thumbs_settings(); |
| 810 | 665 | } |
| 811 | 666 | |
| 812 | 667 | public function render_thumbs_settings() { |
| @@ -816,25 +671,13 @@ | ||
| 816 | 671 | 'label' => __('Settings', 'ultimate-store-kit'), |
| 817 | 672 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 818 | 673 | ] |
| 819 | 674 | ); |
| 675 | + | |
| 820 | 676 | $this->add_control( |
| 821 | - 'thumbs_effect', | |
| 677 | + 'thumbs_autoplay', | |
| 822 | 678 | [ |
| 823 | - 'label' => __('Effect', 'ultimate-store-kit'), | |
| 824 | - 'type' => Controls_Manager::SELECT, | |
| 825 | - 'options' => [ | |
| 826 | - 'fade' => __('Fade', 'ultimate-store-kit'), | |
| 827 | - 'slide' => __('Slide', 'ultimate-store-kit'), | |
| 828 | - ], | |
| 829 | - 'default' => 'fade', | |
| 830 | - 'dynamic' => ['active' => true], | |
| 831 | - ] | |
| 832 | - ); | |
| 833 | - $this->add_control( | |
| 834 | - 'thumbs_loop', | |
| 835 | - [ | |
| 836 | - 'label' => __('Loop', 'ultimate-store-kit'), | |
| 679 | + 'label' => __('Auto Play', 'ultimate-store-kit'), | |
| 837 | 680 | 'type' => Controls_Manager::SWITCHER, |
| 838 | 681 | 'label_on' => __('Yes', 'ultimate-store-kit'), |
| 839 | 682 | 'label_off' => __('No', 'ultimate-store-kit'), |
| 840 | 683 | 'return_value' => 'yes', |
| @@ -840,12 +683,13 @@ | ||
| 840 | 683 | 'return_value' => 'yes', |
| 841 | 684 | 'default' => 'yes', |
| 842 | 685 | ] |
| 843 | 686 | ); |
| 687 | + | |
| 844 | 688 | $this->add_control( |
| 845 | - 'thumbs_autoplay', | |
| 689 | + 'thumbs_loop', | |
| 846 | 690 | [ |
| 847 | - 'label' => __('Auto Play', 'ultimate-store-kit'), | |
| 691 | + 'label' => __('Loop', 'ultimate-store-kit'), | |
| 848 | 692 | 'type' => Controls_Manager::SWITCHER, |
| 849 | 693 | 'label_on' => __('Yes', 'ultimate-store-kit'), |
| 850 | 694 | 'label_off' => __('No', 'ultimate-store-kit'), |
| 851 | 695 | 'return_value' => 'yes', |
| @@ -851,8 +695,9 @@ | ||
| 851 | 695 | 'return_value' => 'yes', |
| 852 | 696 | 'default' => 'yes', |
| 853 | 697 | ] |
| 854 | 698 | ); |
| 699 | + | |
| 855 | 700 | $this->add_control( |
| 856 | 701 | 'thumbs_autoplay_speed', |
| 857 | 702 | [ |
| 858 | 703 | 'label' => __('Delay', 'ultimate-store-kit'), |
| @@ -887,8 +732,42 @@ | ||
| 887 | 732 | ] |
| 888 | 733 | ] |
| 889 | 734 | ); |
| 890 | 735 | |
| 736 | + $this->add_control( | |
| 737 | + 'thumbs_effect', | |
| 738 | + [ | |
| 739 | + 'label' => __('Effect', 'ultimate-store-kit'), | |
| 740 | + 'type' => Controls_Manager::SELECT, | |
| 741 | + 'options' => [ | |
| 742 | + 'fade' => __('Fade', 'ultimate-store-kit'), | |
| 743 | + 'slide' => __('Slide', 'ultimate-store-kit'), | |
| 744 | + 'creative' => __('Creative', 'ultimate-store-kit'), | |
| 745 | + ], | |
| 746 | + 'default' => 'fade', | |
| 747 | + 'dynamic' => ['active' => true], | |
| 748 | + ] | |
| 749 | + ); | |
| 750 | + //creative effect control | |
| 751 | + $this->add_control( | |
| 752 | + 'creative_effect', | |
| 753 | + [ | |
| 754 | + 'label' => esc_html__('Creative Effect', 'ultimate-store-kit'), | |
| 755 | + 'type' => Controls_Manager::SELECT, | |
| 756 | + 'default' => 'creative-1', | |
| 757 | + 'options' => [ | |
| 758 | + 'creative-1' => esc_html__('Creative 1', 'ultimate-store-kit'), | |
| 759 | + 'creative-2' => esc_html__('Creative 2', 'ultimate-store-kit'), | |
| 760 | + 'creative-3' => esc_html__('Creative 3', 'ultimate-store-kit'), | |
| 761 | + 'creative-4' => esc_html__('Creative 4', 'ultimate-store-kit'), | |
| 762 | + 'creative-5' => esc_html__('Creative 5', 'ultimate-store-kit'), | |
| 763 | + ], | |
| 764 | + 'condition' => [ | |
| 765 | + 'thumbs_effect' => 'creative', | |
| 766 | + ], | |
| 767 | + ] | |
| 768 | + ); | |
| 769 | + | |
| 891 | 770 | $this->end_controls_section(); |
| 892 | 771 | } |
| 893 | 772 | |
| 894 | 773 | public function render_items() { |
| @@ -893,12 +772,12 @@ | ||
| 893 | 772 | |
| 894 | 773 | public function render_items() { |
| 895 | 774 | $settings = $this->get_settings_for_display(); |
| 896 | 775 | $args = [ |
| 897 | - 'taxonomy' => 'product_cat', | |
| 776 | + 'taxonomy' => 'product_cat', | |
| 898 | 777 | 'orderby' => isset($settings['orderby']) ? $settings['orderby'] : 'name', |
| 899 | 778 | 'order' => isset($settings['order']) ? $settings['order'] : 'ASC', |
| 900 | - 'hide_empty' => isset($settings['hide_empty']) && ($settings['hide_empty'] == 'yes') ? 0 : 1, | |
| 779 | + 'hide_empty' => isset($settings['hide_empty']) && ($settings['hide_empty'] == 'yes') ? 1 : 0, | |
| 901 | 780 | ]; |
| 902 | 781 | if (isset($settings['cats_include_by_id']) && !empty($settings['cats_include_by_id'])) { |
| 903 | 782 | $args['include'] = $settings['cats_include_by_id']; |
| 904 | 783 | } |
| @@ -909,20 +788,21 @@ | ||
| 909 | 788 | $taxonomies = get_terms($args); |
| 910 | 789 | if (!(empty($taxonomies))) : |
| 911 | 790 | $index = 50; |
| 912 | 791 | foreach ($taxonomies as $category) : |
| 913 | - // $index | |
| 914 | 792 | if ($category->parent == 0 && get_term_children($category->term_id, 'product_cat')) : |
| 915 | 793 | $this->add_render_attribute('sub-category-item', [ |
| 916 | 794 | 'class' => [ |
| 917 | - 'usk-sub-category-item' | |
| 795 | + 'usk-item' | |
| 918 | 796 | ], |
| 919 | 797 | 'data-settings' => [ |
| 920 | 798 | wp_json_encode(array_filter([ |
| 921 | - "autoplay" => ("yes" == $settings["thumbs_autoplay"]) ? ["delay" => $settings["thumbs_autoplay_speed"] + $index += rand(500, 1500)] : false, | |
| 799 | + "autoplay" => ("yes" == $settings["thumbs_autoplay"]) ? ["delay" => $settings["thumbs_autoplay_speed"] + $index += wp_rand(500, 1500)] : false, | |
| 922 | 800 | "loop" => ($settings["thumbs_loop"] == "yes") ? true : false, |
| 923 | 801 | "speed" => $settings["thumbs_slide_speed"]["size"], |
| 802 | + "fadeEffect" => ['crossFade' => true], | |
| 924 | 803 | "effect" => $settings["thumbs_effect"], |
| 804 | + "creativeEffect" => isset($settings["creative_effect"]) ? $settings["creative_effect"] : false, | |
| 925 | 805 | ])) |
| 926 | 806 | ] |
| 927 | 807 | ], null, true); |
| 928 | 808 | ?> |
| @@ -932,9 +812,20 @@ | ||
| 932 | 812 | <?php |
| 933 | 813 | $parentcategory_thumb_id = get_term_meta($category->term_id, 'thumbnail_id', true); |
| 934 | 814 | $images = [$parentcategory_thumb_id]; |
| 935 | 815 | |
| 936 | - foreach ($taxonomies as $subcategory) : | |
| 816 | + // Get subcategories for the specified parent category | |
| 817 | + $args = array( | |
| 818 | + 'taxonomy' => 'product_cat', | |
| 819 | + 'orderby' => isset($settings['orderby']) ? $settings['orderby'] : 'name', | |
| 820 | + 'order' => isset($settings['order']) ? $settings['order'] : 'ASC', | |
| 821 | + 'hide_empty' => isset($settings['hide_empty']) && ($settings['hide_empty'] == 'yes') ? 1 : 0, | |
| 822 | + 'parent' => $category->term_id, | |
| 823 | + ); | |
| 824 | + | |
| 825 | + $subcategories = get_terms($args); | |
| 826 | + | |
| 827 | + foreach ($subcategories as $subcategory) : | |
| 937 | 828 | if ($subcategory->parent == $category->term_id) { |
| 938 | 829 | $subcategory_thumb_id = get_term_meta($subcategory->term_id, 'thumbnail_id', true); |
| 939 | 830 | $images[] = $subcategory_thumb_id; |
| 940 | 831 | } |
| @@ -942,12 +833,12 @@ | ||
| 942 | 833 | |
| 943 | 834 | foreach ($images as $image_id) : |
| 944 | 835 | $img_url = wp_get_attachment_image_url($image_id, $settings['category_thumbnail_size']); |
| 945 | 836 | if (!(empty($img_url))) : ?> |
| 946 | - <div class="usk-item swiper-slide"> | |
| 947 | - <a href="#" class="usk-image-wrap"> | |
| 837 | + <div class="swiper-slide"> | |
| 838 | + <div class="usk-image-wrap"> | |
| 948 | 839 | <img class="usk-img" src="<?php echo esc_url($img_url); ?>" /> |
| 949 | - </a> | |
| 840 | + </div> | |
| 950 | 841 | </div> |
| 951 | 842 | <?php |
| 952 | 843 | endif; |
| 953 | 844 | endforeach; |
| @@ -953,24 +844,35 @@ | ||
| 953 | 844 | endforeach; |
| 954 | 845 | ?> |
| 955 | 846 | </div> |
| 956 | 847 | </div> |
| 957 | - <div class="usk-category-content"> | |
| 848 | + <div class="usk-content"> | |
| 958 | 849 | |
| 959 | - <?php printf('<%1$s class="usk-category-name">%2$s</%1$s>', esc_attr($settings['title_tags']), esc_html($category->name)); ?> | |
| 960 | - <ul class="usk-category-list"> | |
| 850 | + <?php printf( | |
| 851 | + '<%1$s class="usk-name">%2$s</%1$s>', | |
| 852 | + esc_attr( Utils::get_valid_html_tag($settings['title_tags']) ), | |
| 853 | + esc_html($category->name) | |
| 854 | + ); | |
| 855 | + ?> | |
| 856 | + <div class="usk-list"> | |
| 961 | 857 | <?php |
| 962 | - foreach ($taxonomies as $key => $subcategory) : | |
| 963 | - if (($subcategory->parent == $category->term_id) && ($subcategory->count > 0)) { | |
| 964 | - printf('<li><a href="%1$s">%2$s</a></li>', esc_url(get_term_link($subcategory->term_id, 'product_cat')), esc_html($subcategory->name)); | |
| 858 | + foreach ($subcategories as $key => $subcategory) : | |
| 859 | + if ($subcategory->parent == $category->term_id) { | |
| 860 | + printf('<a href="%1$s">%2$s</a>', esc_url(get_term_link($subcategory->term_id, 'product_cat')), esc_html($subcategory->name)); | |
| 965 | 861 | } |
| 966 | 862 | endforeach; |
| 967 | 863 | ?> |
| 968 | - </ul> | |
| 864 | + </div> | |
| 969 | 865 | |
| 970 | 866 | <div class="usk-link-btn"> |
| 971 | - <?php printf('<a href="%2$s"><span>%1$s</span><i class="usk-icon-arrow-right-8"></i>', esc_html('All ' . $category->name . ''), esc_url(get_term_link($category->term_id, 'product_cat'))); ?> | |
| 972 | - </a> | |
| 867 | + <?php | |
| 868 | + printf( | |
| 869 | + '<a href="%2$s"><span>%1$s</span><i class="usk-icon-arrow-right-8"></i></a>', | |
| 870 | + /* translators: %s: Category name */ | |
| 871 | + sprintf(esc_html__('All %s', 'ultimate-store-kit'), esc_html($category->name)), | |
| 872 | + esc_url(get_term_link($category->term_id, 'product_cat')) | |
| 873 | + ); | |
| 874 | + ?> | |
| 973 | 875 | </div> |
| 974 | 876 | </div> |
| 975 | 877 | </div> |
| 976 | 878 | <?php |
| @@ -980,9 +882,9 @@ | ||
| 980 | 882 | endif; |
| 981 | 883 | } |
| 982 | 884 | public function render() { |
| 983 | 885 | ?> |
| 984 | - <div class="usk-sub-category usk-sub-category-style-1"> | |
| 886 | + <div class="usk-sub-category"> | |
| 985 | 887 | <?php $this->render_items(); ?> |
| 986 | 888 | </div> |
| 987 | 889 | <?php |
| 988 | 890 | } |