up-sells.php
1667 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Elementor; |
| 4 | |
| 5 | use ShopEngine\Widgets\Products; |
| 6 | |
| 7 | defined('ABSPATH') || exit; |
| 8 | |
| 9 | class ShopEngine_Up_Sells extends \ShopEngine\Base\Widget |
| 10 | { |
| 11 | |
| 12 | public function config() { |
| 13 | return new ShopEngine_Up_Sells_Config(); |
| 14 | } |
| 15 | |
| 16 | protected function register_controls() { |
| 17 | |
| 18 | /* |
| 19 | * Content Tab |
| 20 | */ |
| 21 | $this->start_controls_section( |
| 22 | 'shopengine_up_sells_product_content_section', |
| 23 | [ |
| 24 | 'label' => esc_html__('Content', 'shopengine'), |
| 25 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 26 | ] |
| 27 | ); |
| 28 | |
| 29 | $this->add_control( |
| 30 | 'shopengine_up_sells_product_enable_slider', |
| 31 | [ |
| 32 | 'label' => esc_html__('Enable Slider', 'shopengine'), |
| 33 | 'type' => Controls_Manager::SWITCHER, |
| 34 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 35 | 'label_off' => esc_html__('No', 'shopengine'), |
| 36 | 'return_value' => 'yes', |
| 37 | 'default' => 'yes', |
| 38 | 'separator' => 'before', |
| 39 | 'description' => esc_html__('Slider dosen\'t work if up-sells products and products to show is smaller than or equal to slides per view.', 'shopengine'), |
| 40 | ] |
| 41 | ); |
| 42 | |
| 43 | $this->add_control( |
| 44 | 'shopengine_up_sells_product_show_flash_sale', |
| 45 | [ |
| 46 | 'label' => esc_html__('Flash Sale', 'shopengine'), |
| 47 | 'type' => Controls_Manager::SWITCHER, |
| 48 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 49 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 50 | 'return_value' => 'yes', |
| 51 | 'default' => 'yes', |
| 52 | 'selectors' => [ |
| 53 | '{{WRAPPER}} .shopengine-up-sells .up-sells .onsale' => 'display: block;', |
| 54 | ], |
| 55 | ] |
| 56 | ); |
| 57 | |
| 58 | $this->add_control( |
| 59 | 'shopengine_up_sells_product_show_sale_price', |
| 60 | [ |
| 61 | 'label' => esc_html__('Sale Price', 'shopengine'), |
| 62 | 'type' => Controls_Manager::SWITCHER, |
| 63 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 64 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 65 | 'return_value' => 'yes', |
| 66 | 'default' => 'yes', |
| 67 | 'selectors' => [ |
| 68 | '{{WRAPPER}} .shopengine-up-sells .up-sells .price del' => 'display: inline-block;', |
| 69 | ], |
| 70 | ] |
| 71 | ); |
| 72 | |
| 73 | $this->add_control( |
| 74 | 'shopengine_up_sells_product_show_cart_btn', |
| 75 | [ |
| 76 | 'label' => esc_html__('Cart Button', 'shopengine'), |
| 77 | 'type' => Controls_Manager::SWITCHER, |
| 78 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 79 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 80 | 'return_value' => 'yes', |
| 81 | 'default' => 'yes', |
| 82 | 'selectors' => [ |
| 83 | '{{WRAPPER}} .shopengine-up-sells .up-sells .button' => 'display: block;', |
| 84 | ], |
| 85 | ] |
| 86 | ); |
| 87 | |
| 88 | $this->add_control( |
| 89 | 'shopengine_up_sells_product_to_show', |
| 90 | [ |
| 91 | 'label' => esc_html__('Products to Show', 'shopengine'), |
| 92 | 'description' => esc_html__('How many products want show in total.', 'shopengine'), |
| 93 | 'type' => Controls_Manager::NUMBER, |
| 94 | 'default' => 4, |
| 95 | 'min' => 1, |
| 96 | 'max' => 50, |
| 97 | 'separator' => 'before', |
| 98 | ] |
| 99 | ); |
| 100 | |
| 101 | $this->add_responsive_control( |
| 102 | 'shopengine_up_sells_product_columns', |
| 103 | [ |
| 104 | 'label' => esc_html__('Columns', 'shopengine'), |
| 105 | 'description' => esc_html__('How many products want show per row.', 'shopengine'), |
| 106 | 'type' => Controls_Manager::NUMBER, |
| 107 | 'default' => 4, |
| 108 | 'tablet_default' => 2, |
| 109 | 'mobile_default' => 1, |
| 110 | 'min' => 1, |
| 111 | 'max' => 12, |
| 112 | 'selectors' => [ |
| 113 | '{{WRAPPER}} .shopengine-up-sells ul.products' => 'display: grid; grid-template-columns: repeat({{SIZE}}, 1fr) !important;', |
| 114 | ], |
| 115 | 'condition' => [ |
| 116 | 'shopengine_up_sells_product_enable_slider!' => 'yes', |
| 117 | ], |
| 118 | ] |
| 119 | ); |
| 120 | |
| 121 | $this->end_controls_section(); |
| 122 | |
| 123 | /* |
| 124 | * Content Tab - Slider Controls |
| 125 | */ |
| 126 | $this->start_controls_section( |
| 127 | 'shopengine_up_sells_product_slider_controls_section', |
| 128 | [ |
| 129 | 'label' => esc_html__('Slider Controls', 'shopengine'), |
| 130 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 131 | 'condition' => [ |
| 132 | 'shopengine_up_sells_product_enable_slider' => 'yes', |
| 133 | ], |
| 134 | ] |
| 135 | ); |
| 136 | |
| 137 | $this->add_control( |
| 138 | 'shopengine_up_sells_product_slider_perview', |
| 139 | [ |
| 140 | 'label' => esc_html__('Slides Per View', 'shopengine'), |
| 141 | 'type' => Controls_Manager::NUMBER, |
| 142 | 'default' => 4, |
| 143 | 'min' => 1, |
| 144 | 'max' => 12, |
| 145 | 'description' => esc_html__('This value will be the number of slides to show in viewport.', 'shopengine'), |
| 146 | ] |
| 147 | ); |
| 148 | |
| 149 | $this->add_control( |
| 150 | 'shopengine_up_sells_product_slider_loop', |
| 151 | [ |
| 152 | 'label' => esc_html__('Loop', 'shopengine'), |
| 153 | 'type' => Controls_Manager::SWITCHER, |
| 154 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 155 | 'label_off' => esc_html__('No', 'shopengine'), |
| 156 | 'default' => 'yes', |
| 157 | 'return_value' => 'yes', |
| 158 | ] |
| 159 | ); |
| 160 | |
| 161 | $this->add_control( |
| 162 | 'shopengine_up_sells_product_slider_autoplay', |
| 163 | [ |
| 164 | 'label' => esc_html__('Autoplay', 'shopengine'), |
| 165 | 'type' => Controls_Manager::SWITCHER, |
| 166 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 167 | 'label_off' => esc_html__('No', 'shopengine'), |
| 168 | 'default' => 'yes', |
| 169 | 'return_value' => 'yes', |
| 170 | ] |
| 171 | ); |
| 172 | |
| 173 | $this->add_control( |
| 174 | 'shopengine_up_sells_product_slider_autoplay_delay', |
| 175 | [ |
| 176 | 'label' => esc_html__('Slide Speed', 'shopengine'), |
| 177 | 'type' => Controls_Manager::NUMBER, |
| 178 | 'default' => 3000, |
| 179 | 'min' => 0, |
| 180 | 'max' => 10000, |
| 181 | 'condition' => [ |
| 182 | 'shopengine_up_sells_product_slider_autoplay' => 'yes', |
| 183 | ], |
| 184 | ] |
| 185 | ); |
| 186 | |
| 187 | $this->add_control( |
| 188 | 'shopengine_up_sells_product_slider_show_arrows', |
| 189 | [ |
| 190 | 'label' => esc_html__('Show Arrows', 'shopengine'), |
| 191 | 'type' => Controls_Manager::SWITCHER, |
| 192 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 193 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 194 | 'default' => 'yes', |
| 195 | 'return_value' => 'yes', |
| 196 | ] |
| 197 | ); |
| 198 | |
| 199 | $this->add_control( |
| 200 | 'shopengine_up_sells_product_slider_show_dots', |
| 201 | [ |
| 202 | 'label' => esc_html__('Show Dots', 'shopengine'), |
| 203 | 'type' => Controls_Manager::SWITCHER, |
| 204 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 205 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 206 | 'default' => 'yes', |
| 207 | 'return_value' => 'yes', |
| 208 | ] |
| 209 | ); |
| 210 | |
| 211 | |
| 212 | $this->add_control( |
| 213 | 'shopengine_up_sells_product_slider_left_arrow_icon', |
| 214 | [ |
| 215 | 'label' => esc_html__('Left Arrow', 'shopengine'), |
| 216 | 'type' => Controls_Manager::ICONS, |
| 217 | 'fa4compatibility' => 'icon', |
| 218 | 'default' => [ |
| 219 | 'value' => 'fas fa-chevron-left', |
| 220 | 'library' => 'fa-solid', |
| 221 | ], |
| 222 | 'condition' => [ |
| 223 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 224 | ], |
| 225 | ] |
| 226 | ); |
| 227 | |
| 228 | $this->add_control( |
| 229 | 'shopengine_up_sells_product_slider_right_arrow_icon', |
| 230 | [ |
| 231 | 'label' => esc_html__('Right Arrow', 'shopengine'), |
| 232 | 'type' => Controls_Manager::ICONS, |
| 233 | 'fa4compatibility' => 'icon', |
| 234 | 'default' => [ |
| 235 | 'value' => 'fas fa-chevron-right', |
| 236 | 'library' => 'fa-solid', |
| 237 | ], |
| 238 | 'condition' => [ |
| 239 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 240 | ], |
| 241 | ] |
| 242 | ); |
| 243 | |
| 244 | $this->add_control( |
| 245 | 'shopengine_up_sells_product_slider_dots_size', |
| 246 | [ |
| 247 | 'label' => esc_html__('Dots Size (px)', 'shopengine'), |
| 248 | 'type' => Controls_Manager::SLIDER, |
| 249 | 'size_units' => ['px'], |
| 250 | 'range' => [ |
| 251 | 'px' => [ |
| 252 | 'min' => 0, |
| 253 | 'max' => 50, |
| 254 | 'step' => 1, |
| 255 | ], |
| 256 | ], |
| 257 | 'default' => [ |
| 258 | 'unit' => 'px', |
| 259 | 'size' => 6, |
| 260 | ], |
| 261 | 'selectors' => [ |
| 262 | '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', |
| 263 | ], |
| 264 | 'condition' => [ |
| 265 | 'shopengine_up_sells_product_slider_show_dots' => 'yes', |
| 266 | ], |
| 267 | 'separator' => 'before', |
| 268 | ] |
| 269 | ); |
| 270 | |
| 271 | $this->add_control( |
| 272 | 'shopengine_up_sells_product_slider_dots_size_active', |
| 273 | [ |
| 274 | 'label' => esc_html__('Active Dots Size (px)', 'shopengine'), |
| 275 | 'type' => Controls_Manager::SLIDER, |
| 276 | 'size_units' => ['px'], |
| 277 | 'range' => [ |
| 278 | 'px' => [ |
| 279 | 'min' => 0, |
| 280 | 'max' => 50, |
| 281 | 'step' => 1, |
| 282 | ], |
| 283 | ], |
| 284 | 'default' => [ |
| 285 | 'unit' => 'px', |
| 286 | 'size' => 15, |
| 287 | ], |
| 288 | 'selectors' => [ |
| 289 | '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet.swiper-pagination-bullet-active' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', |
| 290 | ], |
| 291 | 'condition' => [ |
| 292 | 'shopengine_up_sells_product_slider_show_dots' => 'yes', |
| 293 | ], |
| 294 | ] |
| 295 | ); |
| 296 | |
| 297 | $this->end_controls_section(); |
| 298 | |
| 299 | /* |
| 300 | * Content Tab - Advanced Slider Controls |
| 301 | */ |
| 302 | $this->start_controls_section( |
| 303 | 'shopengine_up_sells_product_advance_controls', |
| 304 | [ |
| 305 | 'label' => esc_html__('Advanced', 'shopengine'), |
| 306 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 307 | ] |
| 308 | ); |
| 309 | |
| 310 | $this->add_control( |
| 311 | 'shopengine_up_sells_product_orderby', |
| 312 | [ |
| 313 | 'label' => esc_html__('Order By', 'shopengine'), |
| 314 | 'type' => Controls_Manager::SELECT, |
| 315 | 'default' => 'rand', |
| 316 | 'options' => [ |
| 317 | 'date' => esc_html__('Date', 'shopengine'), |
| 318 | 'title' => esc_html__('Title', 'shopengine'), |
| 319 | 'price' => esc_html__('Price', 'shopengine'), |
| 320 | 'popularity' => esc_html__('Popularity', 'shopengine'), |
| 321 | 'rating' => esc_html__('Rating', 'shopengine'), |
| 322 | 'rand' => esc_html__('Random', 'shopengine'), |
| 323 | 'menu_order' => esc_html__('Menu Order', 'shopengine'), |
| 324 | 'modified' => esc_html__('Modified Date', 'shopengine'), |
| 325 | ], |
| 326 | ] |
| 327 | ); |
| 328 | |
| 329 | $this->add_control( |
| 330 | 'shopengine_up_sells_product_order', |
| 331 | [ |
| 332 | 'label' => esc_html__('Order', 'shopengine'), |
| 333 | 'type' => Controls_Manager::SELECT, |
| 334 | 'default' => 'desc', |
| 335 | 'options' => [ |
| 336 | 'desc' => esc_html__('DESC', 'shopengine'), |
| 337 | 'asc' => esc_html__('ASC', 'shopengine'), |
| 338 | ], |
| 339 | ] |
| 340 | ); |
| 341 | |
| 342 | $this->end_controls_section(); |
| 343 | |
| 344 | /* |
| 345 | * Style Tab - Products Wrap |
| 346 | */ |
| 347 | $this->start_controls_section( |
| 348 | 'shopengine_up_sells_product_items_section', |
| 349 | [ |
| 350 | 'label' => esc_html__('Items', 'shopengine'), |
| 351 | 'tab' => Controls_Manager::TAB_STYLE, |
| 352 | ] |
| 353 | ); |
| 354 | |
| 355 | $this->add_responsive_control( |
| 356 | 'shopengine_up_sells_product_text_align', |
| 357 | [ |
| 358 | 'label' => esc_html__('Text Align', 'shopengine'), |
| 359 | 'type' => Controls_Manager::CHOOSE, |
| 360 | 'options' => [ |
| 361 | 'left' => [ |
| 362 | 'title' => esc_html__('Left', 'shopengine'), |
| 363 | 'icon' => 'eicon-text-align-left', |
| 364 | ], |
| 365 | 'center' => [ |
| 366 | 'title' => esc_html__('Center', 'shopengine'), |
| 367 | 'icon' => 'eicon-text-align-center', |
| 368 | ], |
| 369 | 'right' => [ |
| 370 | 'title' => esc_html__('Right', 'shopengine'), |
| 371 | 'icon' => 'eicon-text-align-right', |
| 372 | ], |
| 373 | ], |
| 374 | 'default' => 'left', |
| 375 | 'selectors_dictionary' => [ |
| 376 | 'left' => 'text-align: left; justify-content: flex-start;', |
| 377 | 'center' => 'text-align: center; justify-content: center;', |
| 378 | 'right' => 'text-align: right; justify-content: flex-end;', |
| 379 | ], |
| 380 | 'selectors' => [ |
| 381 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.product, .price)' => '{{VALUE}}', |
| 382 | '.rtl {{WRAPPER}}.elementor-align-left .shopengine-up-sells .up-sells :is(.product, .price)' => 'text-align:right;', |
| 383 | '.rtl {{WRAPPER}}.elementor-align-right .shopengine-up-sells .up-sells :is(.product, .price)' => 'text-align:left;' |
| 384 | ], |
| 385 | 'prefix_class' => 'elementor%s-align-', |
| 386 | ] |
| 387 | ); |
| 388 | |
| 389 | $this->add_responsive_control( |
| 390 | 'shopengine_up_sells_product_column_gap', |
| 391 | [ |
| 392 | 'label' => esc_html__('Column Gap (px)', 'shopengine'), |
| 393 | 'type' => Controls_Manager::SLIDER, |
| 394 | 'size_units' => ['px'], |
| 395 | 'range' => [ |
| 396 | 'px' => [ |
| 397 | 'min' => 0, |
| 398 | 'max' => 100, |
| 399 | 'step' => 1, |
| 400 | ], |
| 401 | ], |
| 402 | 'default' => [ |
| 403 | 'unit' => 'px', |
| 404 | 'size' => 30, |
| 405 | ], |
| 406 | 'selectors' => [ |
| 407 | '{{WRAPPER}} .shopengine-up-sells.slider-disabled ul.products' => 'grid-gap: {{SIZE}}{{UNIT}};', |
| 408 | '.elementor-editor-active {{WRAPPER}} .shopengine-up-sells.slider-enabled ul.products > li' => 'margin-right: {{SIZE}}{{UNIT}} !important;', |
| 409 | ] |
| 410 | ] |
| 411 | ); |
| 412 | |
| 413 | $this->add_control( |
| 414 | 'shopengine_up_sells_product_buttons', |
| 415 | [ |
| 416 | 'label' => esc_html__( 'Buttons', 'shopengine' ), |
| 417 | 'type' => Controls_Manager::HEADING, |
| 418 | 'separator' => 'before', |
| 419 | ] |
| 420 | ); |
| 421 | |
| 422 | $this->add_control( |
| 423 | 'shopengine_up_sells_product_btns_space_between', |
| 424 | [ |
| 425 | 'label' => esc_html__('Space In-between (px)', 'shopengine'), |
| 426 | 'type' => Controls_Manager::SLIDER, |
| 427 | 'size_units' => ['px'], |
| 428 | 'range' => [ |
| 429 | 'px' => [ |
| 430 | 'min' => 0, |
| 431 | 'max' => 50, |
| 432 | 'step' => 1, |
| 433 | ], |
| 434 | ], |
| 435 | 'default' => [ |
| 436 | 'unit' => 'px', |
| 437 | 'size' => 10, |
| 438 | ], |
| 439 | 'selectors' => [ |
| 440 | '{{WRAPPER}} .shopengine-up-sells .up-sells .products li a:not(.woocommerce-LoopProduct-link, :last-child)' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 441 | ], |
| 442 | ] |
| 443 | ); |
| 444 | |
| 445 | |
| 446 | $this->end_controls_section(); |
| 447 | |
| 448 | /* |
| 449 | * Style Tab - Flash Sale |
| 450 | */ |
| 451 | $this->start_controls_section( |
| 452 | 'shopengine_up_sells_product_flash_sale', |
| 453 | [ |
| 454 | 'label' => esc_html__('Flash Sale', 'shopengine'), |
| 455 | 'tab' => Controls_Manager::TAB_STYLE, |
| 456 | 'condition' => [ |
| 457 | 'shopengine_up_sells_product_show_flash_sale' => 'yes', |
| 458 | ], |
| 459 | ] |
| 460 | ); |
| 461 | |
| 462 | $this->add_control( |
| 463 | 'shopengine_up_sells_product_flash_sale_color', |
| 464 | [ |
| 465 | 'label' => esc_html__('Color', 'shopengine'), |
| 466 | 'type' => Controls_Manager::COLOR, |
| 467 | 'default' => '#FFFFFF', |
| 468 | 'alpha' => false, |
| 469 | 'selectors' => [ |
| 470 | '{{WRAPPER}} .shopengine-up-sells .onsale' => 'color: {{VALUE}};', |
| 471 | ], |
| 472 | ] |
| 473 | ); |
| 474 | |
| 475 | $this->add_control( |
| 476 | 'shopengine_up_sells_product_flash_sale_bg_color', |
| 477 | [ |
| 478 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 479 | 'type' => Controls_Manager::COLOR, |
| 480 | 'default' => '#4285f4', |
| 481 | 'alpha' => false, |
| 482 | 'selectors' => [ |
| 483 | '{{WRAPPER}} .shopengine-up-sells .onsale' => 'background-color: {{VALUE}};', |
| 484 | ], |
| 485 | ] |
| 486 | ); |
| 487 | |
| 488 | $this->add_group_control( |
| 489 | Group_Control_Typography::get_type(), |
| 490 | [ |
| 491 | 'name' => 'shopengine_up_sells_product_flash_sale_badge_typography', |
| 492 | 'label' => esc_html__('Typography', 'shopengine'), |
| 493 | 'selector' => '{{WRAPPER}} .shopengine-up-sells .onsale', |
| 494 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'], |
| 495 | 'fields_options' => [ |
| 496 | 'typography' => [ |
| 497 | 'default' => 'custom', |
| 498 | ], |
| 499 | 'font_weight' => [ |
| 500 | 'default' => '400', |
| 501 | ], |
| 502 | 'font_size' => [ |
| 503 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 504 | 'default' => [ |
| 505 | 'size' => '12', |
| 506 | 'unit' => 'px', |
| 507 | ], |
| 508 | 'size_units' => ['px'], |
| 509 | ], |
| 510 | 'text_transform' => [ |
| 511 | 'default' => '', |
| 512 | ], |
| 513 | 'line_height' => [ |
| 514 | 'label' => esc_html__('Line Height (px)', 'shopengine'), |
| 515 | 'default' => [ |
| 516 | 'size' => '44', |
| 517 | 'unit' => 'px', |
| 518 | ], |
| 519 | 'size_units' => ['px'], |
| 520 | 'tablet_default' => [ |
| 521 | 'unit' => 'px', |
| 522 | ], |
| 523 | 'mobile_default' => [ |
| 524 | 'unit' => 'px', |
| 525 | ], |
| 526 | ], |
| 527 | ], |
| 528 | ] |
| 529 | ); |
| 530 | |
| 531 | $this->add_responsive_control( |
| 532 | 'shopengine_up_sells_product_flash_sale_badge_size', |
| 533 | [ |
| 534 | 'label' => esc_html__('Badge Size (px)', 'shopengine'), |
| 535 | 'type' => Controls_Manager::SLIDER, |
| 536 | 'size_units' => ['px'], |
| 537 | 'range' => [ |
| 538 | 'px' => [ |
| 539 | 'min' => 0, |
| 540 | 'max' => 100, |
| 541 | 'step' => 1, |
| 542 | ], |
| 543 | ], |
| 544 | 'default' => [ |
| 545 | 'unit' => 'px', |
| 546 | 'size' => 44, |
| 547 | ], |
| 548 | 'selectors' => [ |
| 549 | '{{WRAPPER}} .shopengine-up-sells .onsale' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};', |
| 550 | ], |
| 551 | 'separator' => 'before', |
| 552 | ] |
| 553 | ); |
| 554 | |
| 555 | $this->add_responsive_control( |
| 556 | 'shopengine_up_sells_product_flash_sale_badge_border_radius', |
| 557 | [ |
| 558 | 'label' => esc_html__('Badge Border Radius (px)', 'shopengine'), |
| 559 | 'type' => Controls_Manager::SLIDER, |
| 560 | 'size_units' => ['px'], |
| 561 | 'range' => [ |
| 562 | 'px' => [ |
| 563 | 'min' => 0, |
| 564 | 'max' => 100, |
| 565 | 'step' => 1, |
| 566 | ], |
| 567 | ], |
| 568 | 'default' => [ |
| 569 | 'unit' => 'px', |
| 570 | 'size' => 100, |
| 571 | ], |
| 572 | 'selectors' => [ |
| 573 | '{{WRAPPER}} .shopengine-up-sells .onsale' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 574 | ], |
| 575 | ] |
| 576 | ); |
| 577 | |
| 578 | $this->add_responsive_control( |
| 579 | 'shopengine_up_sells_product_flash_sale_padding', |
| 580 | [ |
| 581 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 582 | 'type' => Controls_Manager::DIMENSIONS, |
| 583 | 'size_units' => ['px'], |
| 584 | 'default' => [ |
| 585 | 'top' => '0', |
| 586 | 'right' => '0', |
| 587 | 'bottom' => '0', |
| 588 | 'left' => '0', |
| 589 | 'unit' => 'px', |
| 590 | 'isLinked' => true, |
| 591 | ], |
| 592 | 'selectors' => [ |
| 593 | '{{WRAPPER}} .shopengine-up-sells .onsale' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 594 | '.rtl {{WRAPPER}} .shopengine-up-sells .onsale' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 595 | ], |
| 596 | 'separator' => 'before', |
| 597 | ] |
| 598 | ); |
| 599 | |
| 600 | $this->add_responsive_control( |
| 601 | 'shopengine_up_sells_product_flash_sale_position', |
| 602 | [ |
| 603 | 'label' => esc_html__('Position', 'shopengine'), |
| 604 | 'type' => Controls_Manager::CHOOSE, |
| 605 | 'options' => [ |
| 606 | 'left' => [ |
| 607 | 'title' => esc_html__('Left', 'shopengine'), |
| 608 | 'icon' => 'eicon-h-align-left', |
| 609 | ], |
| 610 | 'right' => [ |
| 611 | 'title' => esc_html__('Right', 'shopengine'), |
| 612 | 'icon' => 'eicon-h-align-right', |
| 613 | ], |
| 614 | ], |
| 615 | 'default' => 'left', |
| 616 | 'separator' => 'before' |
| 617 | ] |
| 618 | ); |
| 619 | |
| 620 | $this->add_responsive_control( |
| 621 | 'shopengine_up_sells_product_flash_sale_position_horizontal', |
| 622 | [ |
| 623 | 'label' => esc_html__('Horizontal', 'shopengine'), |
| 624 | 'type' => Controls_Manager::SLIDER, |
| 625 | 'size_units' => ['px', '%'], |
| 626 | 'range' => [ |
| 627 | 'px' => [ |
| 628 | 'min' => -100, |
| 629 | 'max' => 100, |
| 630 | 'step' => 5, |
| 631 | ], |
| 632 | '%' => [ |
| 633 | 'min' => 0, |
| 634 | 'max' => 100, |
| 635 | ], |
| 636 | ], |
| 637 | 'default' => [ |
| 638 | 'unit' => 'px', |
| 639 | 'size' => 20, |
| 640 | ], |
| 641 | 'selectors' => [ |
| 642 | '{{WRAPPER}} .shopengine-up-sells .up-sells .onsale' => '{{shopengine_up_sells_product_flash_sale_position.VALUE}}: {{SIZE}}{{UNIT}};', |
| 643 | ], |
| 644 | ] |
| 645 | ); |
| 646 | |
| 647 | $this->add_responsive_control( |
| 648 | 'shopengine_up_sells_product_flash_sale_position_vertical', |
| 649 | [ |
| 650 | 'label' => esc_html__('Vertical', 'shopengine'), |
| 651 | 'type' => Controls_Manager::SLIDER, |
| 652 | 'size_units' => ['px', '%'], |
| 653 | 'range' => [ |
| 654 | 'px' => [ |
| 655 | 'min' => -100, |
| 656 | 'max' => 100, |
| 657 | 'step' => 5, |
| 658 | ], |
| 659 | '%' => [ |
| 660 | 'min' => 0, |
| 661 | 'max' => 100, |
| 662 | ], |
| 663 | ], |
| 664 | 'default' => [ |
| 665 | 'unit' => 'px', |
| 666 | 'size' => 20, |
| 667 | ], |
| 668 | 'selectors' => [ |
| 669 | '{{WRAPPER}} .shopengine-up-sells .up-sells .onsale' => 'top: {{SIZE}}{{UNIT}};', |
| 670 | ], |
| 671 | ] |
| 672 | ); |
| 673 | |
| 674 | $this->end_controls_section(); |
| 675 | |
| 676 | /* |
| 677 | * Style Tab - Products Image |
| 678 | */ |
| 679 | $this->start_controls_section( |
| 680 | 'shopengine_up_sells_product_image_section', |
| 681 | [ |
| 682 | 'label' => esc_html__('Image', 'shopengine'), |
| 683 | 'tab' => Controls_Manager::TAB_STYLE, |
| 684 | ] |
| 685 | ); |
| 686 | |
| 687 | $this->add_control( |
| 688 | 'shopengine_up_sells_product_image_bg_color', |
| 689 | [ |
| 690 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 691 | 'type' => Controls_Manager::COLOR, |
| 692 | 'alpha' => false, |
| 693 | 'selectors' => [ |
| 694 | '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'background-color: {{VALUE}};', |
| 695 | ], |
| 696 | ] |
| 697 | ); |
| 698 | |
| 699 | $this->add_responsive_control( |
| 700 | 'shopengine_up_sells_product_image_height', |
| 701 | [ |
| 702 | 'label' => esc_html__('Height (px)', 'shopengine'), |
| 703 | 'description' => esc_html__('Leave empty for auto height', 'shopengine'), |
| 704 | 'type' => Controls_Manager::SLIDER, |
| 705 | 'size_units' => ['px'], |
| 706 | 'range' => [ |
| 707 | 'px' => [ |
| 708 | 'min' => 0, |
| 709 | 'max' => 500, |
| 710 | 'step' => 5, |
| 711 | ], |
| 712 | ], |
| 713 | 'default' => [ |
| 714 | 'size' => '', |
| 715 | ], |
| 716 | 'selectors' => [ |
| 717 | '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'height: {{SIZE}}{{UNIT}} !important;', |
| 718 | ], |
| 719 | ] |
| 720 | ); |
| 721 | |
| 722 | $this->add_control( |
| 723 | 'shopengine_related_image_auto_fit', |
| 724 | [ |
| 725 | 'label' => esc_html__('Auto Image Fit', 'shopengine'), |
| 726 | 'type' => Controls_Manager::SWITCHER, |
| 727 | 'default' => false, |
| 728 | 'return_value' => true, |
| 729 | 'selectors' => [ |
| 730 | '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'object-fit: cover; object-position:center center', |
| 731 | ], |
| 732 | ] |
| 733 | ); |
| 734 | |
| 735 | |
| 736 | $this->add_responsive_control( |
| 737 | 'shopengine_up_sells_product_image_padding', |
| 738 | [ |
| 739 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 740 | 'type' => Controls_Manager::DIMENSIONS, |
| 741 | 'size_units' => ['px'], |
| 742 | 'default' => [ |
| 743 | 'top' => '0', |
| 744 | 'right' => '0', |
| 745 | 'bottom' => '8', |
| 746 | 'left' => '0', |
| 747 | 'isLinked' => false, |
| 748 | ], |
| 749 | 'selectors' => [ |
| 750 | '{{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 751 | '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells .product img' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 752 | ], |
| 753 | 'separator' => 'before', |
| 754 | ] |
| 755 | ); |
| 756 | |
| 757 | $this->end_controls_section(); |
| 758 | |
| 759 | /* |
| 760 | * Style Tab - Products Title |
| 761 | */ |
| 762 | $this->start_controls_section( |
| 763 | 'shopengine_up_sells_product_title_section', |
| 764 | [ |
| 765 | 'label' => esc_html__('Title', 'shopengine'), |
| 766 | 'tab' => Controls_Manager::TAB_STYLE, |
| 767 | ] |
| 768 | ); |
| 769 | |
| 770 | $this->add_control( |
| 771 | 'shopengine_up_sells_product_title_color', |
| 772 | [ |
| 773 | 'label' => esc_html__('Color', 'shopengine'), |
| 774 | 'type' => Controls_Manager::COLOR, |
| 775 | 'default' => '#101010', |
| 776 | 'alpha' => false, |
| 777 | 'selectors' => [ |
| 778 | '{{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title' => 'color: {{VALUE}};', |
| 779 | ], |
| 780 | ] |
| 781 | ); |
| 782 | |
| 783 | $this->add_group_control( |
| 784 | Group_Control_Typography::get_type(), |
| 785 | [ |
| 786 | 'name' => 'shopengine_up_sells_product_title_typography', |
| 787 | 'label' => esc_html__('Typography', 'shopengine'), |
| 788 | 'selector' => '{{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title', |
| 789 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'], |
| 790 | 'fields_options' => [ |
| 791 | 'typography' => [ |
| 792 | 'default' => 'custom', |
| 793 | ], |
| 794 | 'font_weight' => [ |
| 795 | 'default' => '500', |
| 796 | ], |
| 797 | 'font_size' => [ |
| 798 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 799 | 'default' => [ |
| 800 | 'size' => '15', |
| 801 | 'unit' => 'px', |
| 802 | ], |
| 803 | 'size_units' => ['px'], |
| 804 | ], |
| 805 | 'text_transform' => [ |
| 806 | 'default' => 'none', |
| 807 | ], |
| 808 | 'line_height' => [ |
| 809 | 'label' => esc_html__('Line Height (px)', 'shopengine'), |
| 810 | 'default' => [ |
| 811 | 'size' => '20', |
| 812 | 'unit' => 'px', |
| 813 | ], |
| 814 | 'size_units' => ['px'], |
| 815 | 'tablet_default' => [ |
| 816 | 'unit' => 'px', |
| 817 | ], |
| 818 | 'mobile_default' => [ |
| 819 | 'unit' => 'px', |
| 820 | ], |
| 821 | ], |
| 822 | ], |
| 823 | ] |
| 824 | ); |
| 825 | |
| 826 | $this->add_responsive_control( |
| 827 | 'shopengine_up_sells_product_title_padding', |
| 828 | [ |
| 829 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 830 | 'type' => Controls_Manager::DIMENSIONS, |
| 831 | 'size_units' => ['px'], |
| 832 | 'default' => [ |
| 833 | 'top' => '0', |
| 834 | 'right' => '0', |
| 835 | 'bottom' => '8', |
| 836 | 'left' => '0', |
| 837 | 'isLinked' => false, |
| 838 | ], |
| 839 | 'selectors' => [ |
| 840 | '{{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 841 | '.rtl {{WRAPPER}} .shopengine-up-sells .woocommerce-loop-product__title' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 842 | ], |
| 843 | 'separator' => 'before', |
| 844 | ] |
| 845 | ); |
| 846 | |
| 847 | $this->end_controls_section(); |
| 848 | |
| 849 | /* |
| 850 | * Style Tab - Products Rating |
| 851 | */ |
| 852 | $this->start_controls_section( |
| 853 | 'shopengine_up_sells_product_rating_section', |
| 854 | [ |
| 855 | 'label' => esc_html__('Rating', 'shopengine'), |
| 856 | 'tab' => Controls_Manager::TAB_STYLE, |
| 857 | ] |
| 858 | ); |
| 859 | |
| 860 | $this->add_control( |
| 861 | 'shopengine_up_sells_product_rating_start_color', |
| 862 | [ |
| 863 | 'label' => esc_html__('Color', 'shopengine'), |
| 864 | 'type' => Controls_Manager::COLOR, |
| 865 | 'default' => '#fec42d', |
| 866 | 'alpha' => false, |
| 867 | 'selectors' => [ |
| 868 | '{{WRAPPER}} .shopengine-up-sells .products .star-rating' => 'color: {{VALUE}};', |
| 869 | '{{WRAPPER}} .shopengine-up-sells .products .star-rating::before' => 'color: {{VALUE}};', |
| 870 | ], |
| 871 | ] |
| 872 | ); |
| 873 | |
| 874 | $this->add_responsive_control( |
| 875 | 'shopengine_up_sells_product_rating_start_size', |
| 876 | [ |
| 877 | 'label' => esc_html__('Star Size (px)', 'shopengine'), |
| 878 | 'type' => Controls_Manager::SLIDER, |
| 879 | 'size_units' => ['px'], |
| 880 | 'range' => [ |
| 881 | 'px' => [ |
| 882 | 'min' => 0, |
| 883 | 'max' => 50, |
| 884 | 'step' => 1, |
| 885 | ], |
| 886 | ], |
| 887 | 'default' => [ |
| 888 | 'unit' => 'px', |
| 889 | 'size' => 12, |
| 890 | ], |
| 891 | 'selectors' => [ |
| 892 | '{{WRAPPER}} .shopengine-up-sells .products .product .star-rating' => 'font-size: {{SIZE}}{{UNIT}} !important;', |
| 893 | ], |
| 894 | ] |
| 895 | ); |
| 896 | |
| 897 | $this->add_responsive_control( |
| 898 | 'shopengine_up_sells_product_rating_start_margin_bottom', |
| 899 | [ |
| 900 | 'label' => esc_html__('Margin Bottom (px)', 'shopengine'), |
| 901 | 'type' => Controls_Manager::SLIDER, |
| 902 | 'size_units' => ['px'], |
| 903 | 'range' => [ |
| 904 | 'px' => [ |
| 905 | 'min' => 0, |
| 906 | 'max' => 50, |
| 907 | 'step' => 1, |
| 908 | ], |
| 909 | ], |
| 910 | 'default' => [ |
| 911 | 'unit' => 'px', |
| 912 | 'size' => 8, |
| 913 | ], |
| 914 | 'selectors' => [ |
| 915 | '{{WRAPPER}} .shopengine-up-sells .products .product .star-rating' => 'margin-bottom: {{SIZE}}{{UNIT}};', |
| 916 | ], |
| 917 | ] |
| 918 | ); |
| 919 | |
| 920 | $this->end_controls_section(); |
| 921 | |
| 922 | /* |
| 923 | * Style Tab - Products Price |
| 924 | */ |
| 925 | $this->start_controls_section( |
| 926 | 'shopengine_up_sells_product_price_section', |
| 927 | [ |
| 928 | 'label' => esc_html__('Price', 'shopengine'), |
| 929 | 'tab' => Controls_Manager::TAB_STYLE, |
| 930 | ] |
| 931 | ); |
| 932 | |
| 933 | $this->add_control( |
| 934 | 'shopengine_up_sells_product_price_color', |
| 935 | [ |
| 936 | 'label' => esc_html__('Color', 'shopengine'), |
| 937 | 'type' => Controls_Manager::COLOR, |
| 938 | 'default' => '#101010', |
| 939 | 'alpha' => false, |
| 940 | 'selectors' => [ |
| 941 | '{{WRAPPER}} .shopengine-up-sells :is(.price, .price span, .price .amount)' => 'color: {{VALUE}};', |
| 942 | ], |
| 943 | ] |
| 944 | ); |
| 945 | |
| 946 | $this->add_control( |
| 947 | 'shopengine_up_sells_product_sale_price_color', |
| 948 | [ |
| 949 | 'label' => esc_html__('Sale Price Color', 'shopengine'), |
| 950 | 'type' => Controls_Manager::COLOR, |
| 951 | 'default' => '#101010', |
| 952 | 'alpha' => false, |
| 953 | 'selectors' => [ |
| 954 | '{{WRAPPER}} .shopengine-up-sells .price :is(del span, del .amount)' => 'color: {{VALUE}};', |
| 955 | ], |
| 956 | 'condition' => [ |
| 957 | 'shopengine_up_sells_product_show_sale_price' => 'yes', |
| 958 | ], |
| 959 | ] |
| 960 | ); |
| 961 | |
| 962 | $this->add_group_control( |
| 963 | Group_Control_Typography::get_type(), |
| 964 | [ |
| 965 | 'name' => 'shopengine_up_sells_product_price_typography', |
| 966 | 'selector' => '{{WRAPPER}} .shopengine-up-sells :is(.price, .price .amount, .price ins, .price del)', |
| 967 | 'exclude' => ['text_transform', 'text_decoration', 'font_style', 'letter_spacing'], |
| 968 | 'fields_options' => [ |
| 969 | 'typography' => [ |
| 970 | 'default' => 'custom', |
| 971 | ], |
| 972 | 'font_weight' => [ |
| 973 | 'default' => '700', |
| 974 | ], |
| 975 | 'font_size' => [ |
| 976 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 977 | 'size_units' => ['px'], |
| 978 | 'default' => [ |
| 979 | 'size' => '18', |
| 980 | 'unit' => 'px' |
| 981 | ] |
| 982 | ], |
| 983 | 'line_height' => [ |
| 984 | 'label' => esc_html__('Line Height (px)', 'shopengine'), |
| 985 | 'default' => [ |
| 986 | 'size' => '24', |
| 987 | 'unit' => 'px', |
| 988 | ], |
| 989 | 'size_units' => ['px'], |
| 990 | 'tablet_default' => [ |
| 991 | 'unit' => 'px', |
| 992 | ], |
| 993 | 'mobile_default' => [ |
| 994 | 'unit' => 'px', |
| 995 | ], |
| 996 | ], |
| 997 | ], |
| 998 | ] |
| 999 | ); |
| 1000 | |
| 1001 | $this->add_responsive_control( |
| 1002 | 'shopengine_up_sells_product_price_padding', |
| 1003 | [ |
| 1004 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 1005 | 'type' => Controls_Manager::DIMENSIONS, |
| 1006 | 'size_units' => ['px'], |
| 1007 | 'default' => [ |
| 1008 | 'top' => '0', |
| 1009 | 'right' => '0', |
| 1010 | 'bottom' => '8', |
| 1011 | 'left' => '0', |
| 1012 | 'isLinked' => false, |
| 1013 | ], |
| 1014 | 'selectors' => [ |
| 1015 | '{{WRAPPER}} .shopengine-up-sells .price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1016 | '.rtl {{WRAPPER}} .shopengine-up-sells .price' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1017 | ], |
| 1018 | 'separator' => 'before', |
| 1019 | ] |
| 1020 | ); |
| 1021 | |
| 1022 | $this->end_controls_section(); |
| 1023 | |
| 1024 | /* |
| 1025 | * Style Tab - Products Rating |
| 1026 | */ |
| 1027 | $this->start_controls_section( |
| 1028 | 'shopengine_up_sells_product_add_cart_btn_section', |
| 1029 | [ |
| 1030 | 'label' => esc_html__('Add To Cart', 'shopengine'), |
| 1031 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1032 | 'condition' => [ |
| 1033 | 'shopengine_up_sells_product_show_cart_btn' => 'yes', |
| 1034 | ], |
| 1035 | ] |
| 1036 | ); |
| 1037 | |
| 1038 | $this->add_control( |
| 1039 | 'shopengine_upsell_button_move_end', |
| 1040 | [ |
| 1041 | 'label' => esc_html__('Position End', 'shopengine'), |
| 1042 | 'type' => Controls_Manager::SWITCHER, |
| 1043 | 'default' => false, |
| 1044 | 'return_value' => true, |
| 1045 | 'selectors' => [ |
| 1046 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'order: 1', |
| 1047 | ], |
| 1048 | ] |
| 1049 | ); |
| 1050 | |
| 1051 | $this->add_group_control( |
| 1052 | Group_Control_Typography::get_type(), |
| 1053 | [ |
| 1054 | 'name' => 'shopengine_up_sells_product_add_cart_typography', |
| 1055 | 'label' => esc_html__('Typography', 'shopengine'), |
| 1056 | 'selector' => '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)', |
| 1057 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'], |
| 1058 | 'fields_options' => [ |
| 1059 | 'typography' => [ |
| 1060 | 'default' => 'custom', |
| 1061 | ], |
| 1062 | 'font_weight' => [ |
| 1063 | 'default' => '500', |
| 1064 | ], |
| 1065 | 'font_size' => [ |
| 1066 | 'default' => [ |
| 1067 | 'size' => '13', |
| 1068 | 'unit' => 'px', |
| 1069 | ], |
| 1070 | 'size_units' => ['px'], |
| 1071 | ], |
| 1072 | 'text_transform' => [ |
| 1073 | 'default' => 'uppercase', |
| 1074 | ], |
| 1075 | 'line_height' => [ |
| 1076 | 'label' => esc_html__('Line Height (px)', 'shopengine'), |
| 1077 | 'default' => [ |
| 1078 | 'size' => '18', |
| 1079 | 'unit' => 'px', |
| 1080 | ], |
| 1081 | 'size_units' => ['px'], |
| 1082 | 'tablet_default' => [ |
| 1083 | 'unit' => 'px', |
| 1084 | ], |
| 1085 | 'mobile_default' => [ |
| 1086 | 'unit' => 'px', |
| 1087 | ], |
| 1088 | ], |
| 1089 | ], |
| 1090 | 'separator' => 'before', |
| 1091 | ] |
| 1092 | ); |
| 1093 | |
| 1094 | $this->start_controls_tabs( |
| 1095 | 'shopengine_up_sells_product_add_cart_btn_style_tabs', |
| 1096 | [ |
| 1097 | 'separator' => 'before', |
| 1098 | ] |
| 1099 | ); |
| 1100 | |
| 1101 | $this->start_controls_tab( |
| 1102 | 'shopengine_up_sells_product_add_cart_btn_tab_normal', |
| 1103 | [ |
| 1104 | 'label' => esc_html__('Normal', 'shopengine'), |
| 1105 | ] |
| 1106 | ); |
| 1107 | |
| 1108 | $this->add_control( |
| 1109 | 'shopengine_up_sells_product_add_cart_btn_color', |
| 1110 | [ |
| 1111 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 1112 | 'type' => Controls_Manager::COLOR, |
| 1113 | 'default' => '#FFFFFF', |
| 1114 | 'alpha' => false, |
| 1115 | 'selectors' => [ |
| 1116 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'color: {{VALUE}};', |
| 1117 | ], |
| 1118 | ] |
| 1119 | ); |
| 1120 | |
| 1121 | $this->add_control( |
| 1122 | 'shopengine_up_sells_product_add_cart_btn_bg_color', |
| 1123 | [ |
| 1124 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 1125 | 'type' => Controls_Manager::COLOR, |
| 1126 | 'default' => '#3E3E3E', |
| 1127 | 'alpha' => false, |
| 1128 | 'selectors' => [ |
| 1129 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'background-color: {{VALUE}};', |
| 1130 | ], |
| 1131 | ] |
| 1132 | ); |
| 1133 | |
| 1134 | $this->end_controls_tab(); |
| 1135 | |
| 1136 | $this->start_controls_tab( |
| 1137 | 'shopengine_up_sells_product_add_cart_btn_tab_hover', |
| 1138 | [ |
| 1139 | 'label' => esc_html__('Hover', 'shopengine'), |
| 1140 | ] |
| 1141 | ); |
| 1142 | |
| 1143 | $this->add_control( |
| 1144 | 'shopengine_up_sells_product_add_cart_btn_hover_color', |
| 1145 | [ |
| 1146 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 1147 | 'type' => Controls_Manager::COLOR, |
| 1148 | 'default' => '#FFFFFF', |
| 1149 | 'alpha' => false, |
| 1150 | 'selectors' => [ |
| 1151 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart):hover' => 'color: {{VALUE}};', |
| 1152 | ], |
| 1153 | ] |
| 1154 | ); |
| 1155 | |
| 1156 | $this->add_control( |
| 1157 | 'shopengine_up_sells_product_add_cart_btn_hover_bg_color', |
| 1158 | [ |
| 1159 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 1160 | 'type' => Controls_Manager::COLOR, |
| 1161 | 'default' => '#332d2d', |
| 1162 | 'alpha' => false, |
| 1163 | 'selectors' => [ |
| 1164 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart):hover' => 'background-color: {{VALUE}};', |
| 1165 | ], |
| 1166 | ] |
| 1167 | ); |
| 1168 | |
| 1169 | $this->add_control( |
| 1170 | 'shopengine_up_sells_product_add_cart_btn_hover_border_color', |
| 1171 | [ |
| 1172 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 1173 | 'type' => Controls_Manager::COLOR, |
| 1174 | 'selectors' => [ |
| 1175 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart):hover' => 'border-color: {{VALUE}};', |
| 1176 | ], |
| 1177 | ] |
| 1178 | ); |
| 1179 | |
| 1180 | $this->end_controls_tab(); |
| 1181 | $this->end_controls_tabs(); |
| 1182 | |
| 1183 | $this->add_responsive_control( |
| 1184 | 'shopengine_up_sells_product_add_cart_btn_padding', |
| 1185 | [ |
| 1186 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 1187 | 'type' => Controls_Manager::DIMENSIONS, |
| 1188 | 'size_units' => ['px'], |
| 1189 | 'default' => [ |
| 1190 | 'top' => '8', |
| 1191 | 'right' => '15', |
| 1192 | 'bottom' => '8', |
| 1193 | 'left' => '15', |
| 1194 | 'unit' => 'px', |
| 1195 | 'isLinked' => false, |
| 1196 | ], |
| 1197 | 'selectors' => [ |
| 1198 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1199 | '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1200 | ], |
| 1201 | 'separator' => 'before', |
| 1202 | ] |
| 1203 | ); |
| 1204 | |
| 1205 | $this->add_group_control( |
| 1206 | Group_Control_Border::get_type(), |
| 1207 | [ |
| 1208 | 'name' => 'shopengine_up_sells_product_add_cart_border', |
| 1209 | 'label' => esc_html__('Border', 'shopengine'), |
| 1210 | 'selector' => '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)', |
| 1211 | 'separator' => 'before', |
| 1212 | ] |
| 1213 | ); |
| 1214 | |
| 1215 | $this->add_control( |
| 1216 | 'shopengine_up_sells_product_add_cart_border_radius', |
| 1217 | [ |
| 1218 | 'label' => esc_html__('Border Radius (px)', 'shopengine'), |
| 1219 | 'type' => Controls_Manager::DIMENSIONS, |
| 1220 | 'size_units' => ['px'], |
| 1221 | 'default' => [ |
| 1222 | 'top' => '0', |
| 1223 | 'right' => '0', |
| 1224 | 'bottom' => '0', |
| 1225 | 'left' => '0', |
| 1226 | 'unit' => 'px', |
| 1227 | 'isLinked' => true, |
| 1228 | ], |
| 1229 | 'selectors' => [ |
| 1230 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1231 | '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1232 | ], |
| 1233 | ] |
| 1234 | ); |
| 1235 | |
| 1236 | $this->add_responsive_control( |
| 1237 | 'shopengine_up_sells_product_add_cart_btn_margin', |
| 1238 | [ |
| 1239 | 'label' => esc_html__('Margin (px)', 'shopengine'), |
| 1240 | 'type' => Controls_Manager::DIMENSIONS, |
| 1241 | 'size_units' => ['px'], |
| 1242 | 'default' => [ |
| 1243 | 'top' => '0', |
| 1244 | 'right' => '0', |
| 1245 | 'bottom' => '0', |
| 1246 | 'left' => '0', |
| 1247 | 'isLinked' => false, |
| 1248 | ], |
| 1249 | 'selectors' => [ |
| 1250 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1251 | '.rtl {{WRAPPER}} .shopengine-up-sells .up-sells :is(.button, .added_to_cart)' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 1252 | ], |
| 1253 | 'separator' => 'before', |
| 1254 | ] |
| 1255 | ); |
| 1256 | |
| 1257 | $this->end_controls_section(); |
| 1258 | |
| 1259 | /* |
| 1260 | * Style Tab - Slider |
| 1261 | */ |
| 1262 | $this->start_controls_section( |
| 1263 | 'shopengine_up_sells_product_slider_style_section', |
| 1264 | [ |
| 1265 | 'label' => esc_html__('Slider Style', 'shopengine'), |
| 1266 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1267 | 'conditions' => [ |
| 1268 | 'relation' => 'and', |
| 1269 | 'terms' => [ |
| 1270 | [ |
| 1271 | 'name' => 'shopengine_up_sells_product_enable_slider', |
| 1272 | 'operator' => '===', |
| 1273 | 'value' => 'yes' |
| 1274 | ], |
| 1275 | [ |
| 1276 | 'relation' => 'or', |
| 1277 | 'terms' => [ |
| 1278 | [ |
| 1279 | 'name' => 'shopengine_up_sells_product_slider_show_arrows', |
| 1280 | 'operator' => '===', |
| 1281 | 'value' => 'yes' |
| 1282 | ], |
| 1283 | [ |
| 1284 | 'name' => 'shopengine_up_sells_product_slider_show_dots', |
| 1285 | 'operator' => '===', |
| 1286 | 'value' => 'yes' |
| 1287 | ] |
| 1288 | ] |
| 1289 | ] |
| 1290 | ] |
| 1291 | ] |
| 1292 | ] |
| 1293 | ); |
| 1294 | |
| 1295 | $this->add_control( |
| 1296 | 'shopengine_up_sells_product_slider_arrows_style', |
| 1297 | [ |
| 1298 | 'label' => esc_html__( 'Arrows', 'shopengine' ), |
| 1299 | 'type' => Controls_Manager::HEADING, |
| 1300 | 'condition' => [ |
| 1301 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 1302 | ], |
| 1303 | ] |
| 1304 | ); |
| 1305 | |
| 1306 | $this->add_control( |
| 1307 | 'shopengine_up_sells_product_slider_arrow_size', |
| 1308 | [ |
| 1309 | 'label' => esc_html__('Arrow Size (px)', 'shopengine'), |
| 1310 | 'type' => Controls_Manager::SLIDER, |
| 1311 | 'size_units' => ['px'], |
| 1312 | 'range' => [ |
| 1313 | 'px' => [ |
| 1314 | 'min' => 0, |
| 1315 | 'max' => 100, |
| 1316 | 'step' => 5, |
| 1317 | ], |
| 1318 | ], |
| 1319 | 'default' => [ |
| 1320 | 'unit' => 'px', |
| 1321 | 'size' => 40, |
| 1322 | ], |
| 1323 | 'selectors' => [ |
| 1324 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-next, .swiper-button-prev)' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};', |
| 1325 | ], |
| 1326 | 'condition' => [ |
| 1327 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 1328 | ], |
| 1329 | 'separator' => 'before', |
| 1330 | ] |
| 1331 | ); |
| 1332 | |
| 1333 | $this->add_control( |
| 1334 | 'shopengine_up_sells_product_slider_arrow_icon_size', |
| 1335 | [ |
| 1336 | 'label' => esc_html__('Icon Size (px)', 'shopengine'), |
| 1337 | 'type' => Controls_Manager::SLIDER, |
| 1338 | 'size_units' => ['px'], |
| 1339 | 'range' => [ |
| 1340 | 'px' => [ |
| 1341 | 'min' => 0, |
| 1342 | 'max' => 100, |
| 1343 | 'step' => 5, |
| 1344 | ], |
| 1345 | ], |
| 1346 | 'default' => [ |
| 1347 | 'unit' => 'px', |
| 1348 | 'size' => 25, |
| 1349 | ], |
| 1350 | 'selectors' => [ |
| 1351 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1352 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev svg, .swiper-button-next svg)' => 'width: {{SIZE}}{{UNIT}};', |
| 1353 | ], |
| 1354 | 'condition' => [ |
| 1355 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 1356 | ], |
| 1357 | ] |
| 1358 | ); |
| 1359 | |
| 1360 | $this->add_control( |
| 1361 | 'shopengine_up_sells_product_slider_arrow_position', |
| 1362 | [ |
| 1363 | 'label' => esc_html__('Arrow Position (y-axis)', 'shopengine'), |
| 1364 | 'type' => Controls_Manager::SLIDER, |
| 1365 | 'size_units' => ['%'], |
| 1366 | 'range' => [ |
| 1367 | '%' => [ |
| 1368 | 'min' => 0, |
| 1369 | 'max' => 100, |
| 1370 | 'step' => 1, |
| 1371 | ], |
| 1372 | ], |
| 1373 | 'default' => [ |
| 1374 | 'unit' => '%', |
| 1375 | 'size' => 30, |
| 1376 | ], |
| 1377 | 'selectors' => [ |
| 1378 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'top: {{SIZE}}{{UNIT}};', |
| 1379 | ], |
| 1380 | 'condition' => [ |
| 1381 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 1382 | ], |
| 1383 | 'separator' => 'before', |
| 1384 | ] |
| 1385 | ); |
| 1386 | |
| 1387 | $this->start_controls_tabs( |
| 1388 | 'shopengine_up_sells_product_slider_arrows_tabs', |
| 1389 | [ |
| 1390 | 'condition' => [ |
| 1391 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 1392 | ], |
| 1393 | ] |
| 1394 | ); |
| 1395 | |
| 1396 | $this->start_controls_tab( |
| 1397 | 'shopengine_up_sells_product_slider_arrows_tab_normal', |
| 1398 | [ |
| 1399 | 'label' => esc_html__('Normal', 'shopengine'), |
| 1400 | ] |
| 1401 | ); |
| 1402 | |
| 1403 | $this->add_control( |
| 1404 | 'shopengine_up_sells_product_slider_arrows_color', |
| 1405 | [ |
| 1406 | 'label' => esc_html__('Color', 'shopengine'), |
| 1407 | 'type' => Controls_Manager::COLOR, |
| 1408 | 'default' => '#FFFFFF', |
| 1409 | 'alpha' => false, |
| 1410 | 'selectors' => [ |
| 1411 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'color: {{VALUE}};', |
| 1412 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev svg, .swiper-button-next svg)' => 'fill: {{VALUE}};', |
| 1413 | ], |
| 1414 | ] |
| 1415 | ); |
| 1416 | |
| 1417 | $this->add_control( |
| 1418 | 'shopengine_up_sells_product_slider_arrows_bg_color', |
| 1419 | [ |
| 1420 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 1421 | 'type' => Controls_Manager::COLOR, |
| 1422 | 'default' => '#3E3E3E', |
| 1423 | 'selectors' => [ |
| 1424 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'background-color: {{VALUE}};', |
| 1425 | ], |
| 1426 | ] |
| 1427 | ); |
| 1428 | |
| 1429 | $this->end_controls_tab(); |
| 1430 | |
| 1431 | $this->start_controls_tab( |
| 1432 | 'shopengine_up_sells_product_slider_arrows_tab_hover', |
| 1433 | [ |
| 1434 | 'label' => esc_html__('Hover', 'shopengine'), |
| 1435 | ] |
| 1436 | ); |
| 1437 | |
| 1438 | $this->add_control( |
| 1439 | 'shopengine_up_sells_product_slider_arrows_hover_color', |
| 1440 | [ |
| 1441 | 'label' => esc_html__('Color', 'shopengine'), |
| 1442 | 'type' => Controls_Manager::COLOR, |
| 1443 | 'default' => '#FFFFFF', |
| 1444 | 'alpha' => false, |
| 1445 | 'selectors' => [ |
| 1446 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next):hover' => 'color: {{VALUE}};', |
| 1447 | ], |
| 1448 | ] |
| 1449 | ); |
| 1450 | |
| 1451 | $this->add_control( |
| 1452 | 'shopengine_up_sells_product_slider_arrows_hover_bg_color', |
| 1453 | [ |
| 1454 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 1455 | 'type' => Controls_Manager::COLOR, |
| 1456 | 'default' => '#332d2d', |
| 1457 | 'selectors' => [ |
| 1458 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next):hover' => 'background-color: {{VALUE}};', |
| 1459 | ], |
| 1460 | ] |
| 1461 | ); |
| 1462 | |
| 1463 | $this->add_control( |
| 1464 | 'shopengine_up_sells_product_slider_arrows_hover_border_color', |
| 1465 | [ |
| 1466 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 1467 | 'type' => Controls_Manager::COLOR, |
| 1468 | 'selectors' => [ |
| 1469 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next):hover' => 'border-color: {{VALUE}};', |
| 1470 | ], |
| 1471 | ] |
| 1472 | ); |
| 1473 | |
| 1474 | $this->end_controls_tab(); |
| 1475 | $this->end_controls_tabs(); |
| 1476 | |
| 1477 | $this->add_group_control( |
| 1478 | Group_Control_Border::get_type(), |
| 1479 | [ |
| 1480 | 'name' => 'shopengine_up_sells_product_slider_arrows_border', |
| 1481 | 'label' => esc_html__('Border', 'shopengine'), |
| 1482 | 'selector' => '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)', |
| 1483 | 'condition' => [ |
| 1484 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 1485 | ], |
| 1486 | 'separator' => 'before', |
| 1487 | ] |
| 1488 | ); |
| 1489 | |
| 1490 | $this->add_control( |
| 1491 | 'shopengine_up_sells_product_slider_arrows_border_radius', |
| 1492 | [ |
| 1493 | 'label' => esc_html__('Border Radius (px)', 'shopengine'), |
| 1494 | 'type' => Controls_Manager::DIMENSIONS, |
| 1495 | 'size_units' => ['px'], |
| 1496 | 'default' => [ |
| 1497 | 'top' => '0', |
| 1498 | 'right' => '0', |
| 1499 | 'bottom' => '0', |
| 1500 | 'left' => '0', |
| 1501 | 'unit' => 'px', |
| 1502 | 'isLinked' => true, |
| 1503 | ], |
| 1504 | 'selectors' => [ |
| 1505 | '{{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1506 | '.rtl {{WRAPPER}} .shopengine-up-sells :is(.swiper-button-prev, .swiper-button-next)' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1507 | ], |
| 1508 | 'condition' => [ |
| 1509 | 'shopengine_up_sells_product_slider_show_arrows' => 'yes', |
| 1510 | ], |
| 1511 | ] |
| 1512 | ); |
| 1513 | |
| 1514 | $this->add_control( |
| 1515 | 'shopengine_up_sells_product_slider_style_divider', |
| 1516 | [ |
| 1517 | 'type' => Controls_Manager::DIVIDER, |
| 1518 | 'conditions' => [ |
| 1519 | 'relation' => 'and', |
| 1520 | 'terms' => [ |
| 1521 | [ |
| 1522 | 'name' => 'shopengine_up_sells_product_slider_show_arrows', |
| 1523 | 'operator' => '===', |
| 1524 | 'value' => 'yes' |
| 1525 | ], |
| 1526 | [ |
| 1527 | 'name' => 'shopengine_up_sells_product_slider_show_dots', |
| 1528 | 'operator' => '===', |
| 1529 | 'value' => 'yes' |
| 1530 | ] |
| 1531 | ] |
| 1532 | ] |
| 1533 | ] |
| 1534 | ); |
| 1535 | |
| 1536 | $this->add_control( |
| 1537 | 'shopengine_up_sells_product_slider_dots_style', |
| 1538 | [ |
| 1539 | 'label' => esc_html__( 'Dots', 'shopengine' ), |
| 1540 | 'type' => Controls_Manager::HEADING, |
| 1541 | 'condition' => [ |
| 1542 | 'shopengine_up_sells_product_slider_show_dots' => 'yes', |
| 1543 | ], |
| 1544 | ] |
| 1545 | ); |
| 1546 | |
| 1547 | $this->add_control( |
| 1548 | 'shopengine_up_sells_product_slider_dots_color', |
| 1549 | [ |
| 1550 | 'label' => esc_html__('Color', 'shopengine'), |
| 1551 | 'type' => Controls_Manager::COLOR, |
| 1552 | 'default' => '#c9c9c9', |
| 1553 | 'alpha' => false, |
| 1554 | 'selectors' => [ |
| 1555 | '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet' => 'background: {{VALUE}};', |
| 1556 | ], |
| 1557 | 'condition' => [ |
| 1558 | 'shopengine_up_sells_product_slider_show_dots' => 'yes', |
| 1559 | ], |
| 1560 | ] |
| 1561 | ); |
| 1562 | |
| 1563 | $this->add_control( |
| 1564 | 'shopengine_up_sells_product_slider_active_dots_color', |
| 1565 | [ |
| 1566 | 'label' => esc_html__('Active Color', 'shopengine'), |
| 1567 | 'type' => Controls_Manager::COLOR, |
| 1568 | 'default' => '#f03d3f', |
| 1569 | 'alpha' => false, |
| 1570 | 'selectors' => [ |
| 1571 | '{{WRAPPER}} .shopengine-up-sells .swiper-pagination-bullet-active' => 'border-color: {{VALUE}};', |
| 1572 | ], |
| 1573 | 'condition' => [ |
| 1574 | '$shopengine_up_sells_product_slider_show_dots' => 'yes', |
| 1575 | ], |
| 1576 | ] |
| 1577 | ); |
| 1578 | |
| 1579 | $this->add_responsive_control( |
| 1580 | 'shopengine_up_sells_product_slider_dot_wrap_margin', |
| 1581 | [ |
| 1582 | 'label' => esc_html__('Wrap Margin (px)', 'shopengine'), |
| 1583 | 'type' => Controls_Manager::DIMENSIONS, |
| 1584 | 'size_units' => ['px'], |
| 1585 | 'default' => [ |
| 1586 | 'top' => '20', |
| 1587 | 'right' => '0', |
| 1588 | 'bottom' => '0', |
| 1589 | 'left' => '0', |
| 1590 | 'isLinked' => false, |
| 1591 | ], |
| 1592 | 'selectors' => [ |
| 1593 | '{{WRAPPER}} .shopengine-up-sells .swiper-pagination' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1594 | '.rtl {{WRAPPER}} .shopengine-up-sells .swiper-pagination' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1595 | ], |
| 1596 | 'condition' => [ |
| 1597 | '$shopengine_up_sells_product_slider_show_dots' => 'yes', |
| 1598 | ], |
| 1599 | 'separator' => 'before', |
| 1600 | ] |
| 1601 | ); |
| 1602 | |
| 1603 | $this->end_controls_section(); |
| 1604 | |
| 1605 | /* |
| 1606 | * Style Tab - Global Font |
| 1607 | */ |
| 1608 | $this->start_controls_section( |
| 1609 | 'shopengine_up_sells_product_global_font_section', |
| 1610 | [ |
| 1611 | 'label' => esc_html__('Global Font', 'shopengine'), |
| 1612 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1613 | ] |
| 1614 | ); |
| 1615 | |
| 1616 | $this->add_control( |
| 1617 | 'shopengine_up_sells_product_global_font_family', |
| 1618 | [ |
| 1619 | 'label' => esc_html__('Font Family', 'shopengine'), |
| 1620 | 'description' => esc_html__('This font family is set for this specific widget.', 'shopengine'), |
| 1621 | 'type' => Controls_Manager::FONT, |
| 1622 | 'selectors' => [ |
| 1623 | '{{WRAPPER}} .shopengine-up-sells .up-sells :is(.onsale, .woocommerce-loop-product__title, .price, del, ins, .button)' => 'font-family: {{VALUE}};', |
| 1624 | ], |
| 1625 | ] |
| 1626 | ); |
| 1627 | |
| 1628 | $this->end_controls_section(); |
| 1629 | } |
| 1630 | |
| 1631 | public function get_icon_html($icon) { |
| 1632 | |
| 1633 | if($icon) { |
| 1634 | ob_start(); |
| 1635 | \Elementor\Icons_Manager::render_icon($icon, ['aria-hidden' => 'true']); |
| 1636 | $icon = ob_get_clean(); |
| 1637 | } else { |
| 1638 | $icon = ''; |
| 1639 | } |
| 1640 | |
| 1641 | return $icon; |
| 1642 | } |
| 1643 | |
| 1644 | protected function screen() { |
| 1645 | $settings = $this->get_settings_for_display(); |
| 1646 | shopengine_content_render(\ShopEngine\Utils\Helper::render($this->view_render($settings))); |
| 1647 | } |
| 1648 | |
| 1649 | protected function view_render($settings = []) { |
| 1650 | |
| 1651 | extract($settings); |
| 1652 | |
| 1653 | $post_type = get_post_type(); |
| 1654 | |
| 1655 | $product = \ShopEngine\Widgets\Products::instance()->get_product($post_type); |
| 1656 | |
| 1657 | if(empty($product)) { |
| 1658 | return; |
| 1659 | } |
| 1660 | |
| 1661 | |
| 1662 | $tpl = Products::instance()->get_widget_template($this->get_name()); |
| 1663 | |
| 1664 | include $tpl; |
| 1665 | } |
| 1666 | } |
| 1667 |