archive-products.php
3033 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Elementor; |
| 4 | |
| 5 | use ShopEngine\Widgets\Products; |
| 6 | |
| 7 | defined('ABSPATH') || exit; |
| 8 | |
| 9 | |
| 10 | class ShopEngine_Archive_Products extends \ShopEngine\Base\Widget |
| 11 | { |
| 12 | |
| 13 | public function config() |
| 14 | { |
| 15 | return new ShopEngine_Archive_Products_Config(); |
| 16 | } |
| 17 | |
| 18 | |
| 19 | protected function register_controls() |
| 20 | { |
| 21 | /* |
| 22 | =============================== |
| 23 | Layout Panel |
| 24 | =============================== |
| 25 | */ |
| 26 | $this->start_controls_section( |
| 27 | 'shopengine_section_layout', |
| 28 | [ |
| 29 | 'label' => esc_html__('Layout', 'shopengine'), |
| 30 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 31 | ] |
| 32 | ); |
| 33 | |
| 34 | $this->add_control( |
| 35 | 'shopengine_layout_note', |
| 36 | [ |
| 37 | 'type' => Controls_Manager::RAW_HTML, |
| 38 | 'raw' => esc_html__('you can manage the number of columns and rows from woocommerce customizer(product catalog)', 'shopengine'), |
| 39 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 40 | ] |
| 41 | ); |
| 42 | |
| 43 | |
| 44 | $this->end_controls_section(); // end ./ Layout Panel |
| 45 | |
| 46 | /* |
| 47 | ============================ |
| 48 | Content Panel |
| 49 | ============================ |
| 50 | */ |
| 51 | |
| 52 | $this->start_controls_section( |
| 53 | 'shopengine_section_content', |
| 54 | [ |
| 55 | 'label' => esc_html__('Content', 'shopengine'), |
| 56 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 57 | ] |
| 58 | ); |
| 59 | |
| 60 | $this->add_control( |
| 61 | 'shopengine_archive_product_title_header_size', |
| 62 | [ |
| 63 | 'label' => esc_html__('Archive Product Title', 'shopengine'), |
| 64 | 'type' => Controls_Manager::SELECT, |
| 65 | 'description' => esc_html__("The H1 tag is important for SEO, accessibility and usability, so ideally, you should have one on each page of your site. A H1 tag should describe what the content of the given page is all about", 'shopengine'), |
| 66 | 'options' => [ |
| 67 | 'h1' => 'H1', |
| 68 | 'h2' => 'H2', |
| 69 | 'h3' => 'H3', |
| 70 | 'h4' => 'H4', |
| 71 | 'h5' => 'H5', |
| 72 | 'h6' => 'H6', |
| 73 | 'div' => 'Div', |
| 74 | 'span' => 'Span', |
| 75 | 'p' => 'P', |
| 76 | ], |
| 77 | 'default' => 'h1', |
| 78 | 'prefix_class' => 'shopengine_archive_product_title_', |
| 79 | 'selectors' => [ |
| 80 | '{{WRAPPER}} .archive-product-title' => 'margin: 0; padding: 0;', |
| 81 | ], |
| 82 | ] |
| 83 | ); |
| 84 | |
| 85 | $this->add_control( |
| 86 | 'shopengine_show_sale_flash', |
| 87 | [ |
| 88 | 'label' => esc_html__('Flash Sale Badge', 'shopengine'), |
| 89 | 'type' => Controls_Manager::SWITCHER, |
| 90 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 91 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 92 | 'return_value' => 'yes', |
| 93 | 'default' => 'yes', |
| 94 | 'selectors' => [ |
| 95 | '{{WRAPPER}} .shopengine-archive-products .product .onsale' => 'display: block;', |
| 96 | ], |
| 97 | ] |
| 98 | ); |
| 99 | |
| 100 | $this->add_control( |
| 101 | 'shopengine_is_cats', |
| 102 | [ |
| 103 | 'label' => esc_html__('Show Categories', 'shopengine'), |
| 104 | 'type' => Controls_Manager::SWITCHER, |
| 105 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 106 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 107 | 'return_value' => 'yes', |
| 108 | 'default' => 'yes', |
| 109 | ] |
| 110 | ); |
| 111 | |
| 112 | $this->add_control( |
| 113 | 'shopengine_is_details', |
| 114 | [ |
| 115 | 'label' => esc_html__('Show Description', 'shopengine'), |
| 116 | 'type' => Controls_Manager::SWITCHER, |
| 117 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 118 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 119 | 'return_value' => 'yes', |
| 120 | 'default' => 'no', |
| 121 | ] |
| 122 | ); |
| 123 | |
| 124 | $this->add_control( |
| 125 | 'shopengine_archive_product_show_rating', |
| 126 | [ |
| 127 | 'label' => esc_html__('Rating', 'shopengine'), |
| 128 | 'type' => Controls_Manager::SWITCHER, |
| 129 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 130 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 131 | 'return_value' => 'yes', |
| 132 | 'default' => 'yes', |
| 133 | 'selectors' => [ |
| 134 | '{{WRAPPER}} .shopengine-archive-products :is(.shopengine-product-rating-review-count, .star-rating, .review-rating) ' => 'display: inline-flex;', |
| 135 | ], |
| 136 | ] |
| 137 | ); |
| 138 | |
| 139 | $this->add_control( |
| 140 | 'shopengine_show_regular_price', |
| 141 | [ |
| 142 | 'label' => esc_html__('Show Regular Price', 'shopengine'), |
| 143 | 'type' => Controls_Manager::SWITCHER, |
| 144 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 145 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 146 | 'return_value' => 'yes', |
| 147 | 'default' => 'yes', |
| 148 | 'selectors' => [ |
| 149 | '{{WRAPPER}} .shopengine-archive-products .product .price del' => 'display: block;', |
| 150 | ], |
| 151 | ] |
| 152 | ); |
| 153 | |
| 154 | $this->add_control( |
| 155 | 'shopengine_group_btns', |
| 156 | [ |
| 157 | 'label' => esc_html__('Button Group', 'shopengine'), |
| 158 | 'type' => Controls_Manager::SWITCHER, |
| 159 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 160 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 161 | ] |
| 162 | ); |
| 163 | |
| 164 | $this->add_control( |
| 165 | 'shopengine_action_buttons_heading', |
| 166 | [ |
| 167 | 'label' => esc_html__('Action Buttons', 'shopengine'), |
| 168 | 'type' => Controls_Manager::HEADING, |
| 169 | 'separator' => 'before', |
| 170 | 'condition' => [ |
| 171 | 'shopengine_group_btns' => 'yes', |
| 172 | ], |
| 173 | ] |
| 174 | ); |
| 175 | |
| 176 | $this->add_control( |
| 177 | 'shopengine_show_wishlist', |
| 178 | [ |
| 179 | 'label' => esc_html__('Show Wishlist', 'shopengine'), |
| 180 | 'type' => Controls_Manager::SWITCHER, |
| 181 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 182 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 183 | 'return_value' => 'yes', |
| 184 | 'default' => 'yes', |
| 185 | 'condition' => [ |
| 186 | 'shopengine_group_btns' => 'yes', |
| 187 | ], |
| 188 | ] |
| 189 | ); |
| 190 | |
| 191 | $this->add_control( |
| 192 | 'shopengine_show_quickview', |
| 193 | [ |
| 194 | 'label' => esc_html__('Show Quick View', 'shopengine'), |
| 195 | 'type' => Controls_Manager::SWITCHER, |
| 196 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 197 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 198 | 'return_value' => 'yes', |
| 199 | 'default' => 'yes', |
| 200 | 'condition' => [ |
| 201 | 'shopengine_group_btns' => 'yes', |
| 202 | ], |
| 203 | ] |
| 204 | ); |
| 205 | |
| 206 | $this->add_control( |
| 207 | 'shopengine_show_add_to_cart', |
| 208 | [ |
| 209 | 'label' => esc_html__('Show Add to Cart', 'shopengine'), |
| 210 | 'type' => Controls_Manager::SWITCHER, |
| 211 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 212 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 213 | 'return_value' => 'yes', |
| 214 | 'default' => 'yes', |
| 215 | 'condition' => [ |
| 216 | 'shopengine_group_btns' => 'yes', |
| 217 | ], |
| 218 | ] |
| 219 | ); |
| 220 | |
| 221 | $this->add_control( |
| 222 | 'shopengine_show_comparison', |
| 223 | [ |
| 224 | 'label' => esc_html__('Show Comparison', 'shopengine'), |
| 225 | 'type' => Controls_Manager::SWITCHER, |
| 226 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 227 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 228 | 'return_value' => 'yes', |
| 229 | 'default' => 'yes', |
| 230 | 'condition' => [ |
| 231 | 'shopengine_group_btns' => 'yes', |
| 232 | ], |
| 233 | ] |
| 234 | ); |
| 235 | |
| 236 | $this->add_control( |
| 237 | 'shopengine_show_direct_checkout', |
| 238 | [ |
| 239 | 'label' => esc_html__('Show Direct Checkout', 'shopengine'), |
| 240 | 'type' => Controls_Manager::SWITCHER, |
| 241 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 242 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 243 | 'return_value' => 'yes', |
| 244 | 'default' => 'yes', |
| 245 | 'condition' => [ |
| 246 | 'shopengine_group_btns' => 'yes', |
| 247 | ], |
| 248 | ] |
| 249 | ); |
| 250 | |
| 251 | $this->add_control( |
| 252 | 'shopengine_is_hover_details', |
| 253 | [ |
| 254 | 'label' => esc_html__('Footer on Hover Style', 'shopengine'), |
| 255 | 'type' => Controls_Manager::SWITCHER, |
| 256 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 257 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 258 | 'return_value' => 'yes', |
| 259 | 'default' => 'no', |
| 260 | ] |
| 261 | ); |
| 262 | |
| 263 | $this->add_control( |
| 264 | 'shopengine_is_tooltip', |
| 265 | [ |
| 266 | 'label' => esc_html__('Add Tooltip', 'shopengine'), |
| 267 | 'type' => Controls_Manager::SWITCHER, |
| 268 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 269 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 270 | 'return_value' => 'yes', |
| 271 | 'default' => 'no', |
| 272 | ] |
| 273 | ); |
| 274 | |
| 275 | if(class_exists('\ShopEngine_Pro\Widgets\Free_Widget_Pro_Feature\Archive_Products\Archive_Products')) { |
| 276 | \ShopEngine_Pro\Widgets\Free_Widget_Pro_Feature\Archive_Products\Archive_Products::content($this); |
| 277 | } |
| 278 | |
| 279 | $this->add_control( |
| 280 | 'shopengine_independent_add_to_cart', |
| 281 | [ |
| 282 | 'label' => esc_html__('Show Only Add to Cart', 'shopengine'), |
| 283 | 'type' => Controls_Manager::SWITCHER, |
| 284 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 285 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 286 | 'return_value' => 'yes', |
| 287 | 'default' => 'no', |
| 288 | 'description' => esc_html__('Shows only Add to Cart — hides wishlist, comparison, quick view & direct checkout.', 'shopengine'), |
| 289 | ] |
| 290 | ); |
| 291 | |
| 292 | $this->add_control( |
| 293 | 'shopengine_independent_add_to_cart_position', |
| 294 | [ |
| 295 | 'label' => esc_html__('Position', 'shopengine'), |
| 296 | 'type' => Controls_Manager::SELECT, |
| 297 | 'options' => [ |
| 298 | 'bottom' => esc_html__('Bottom (below content)', 'shopengine'), |
| 299 | 'top' => esc_html__('Top (below image)', 'shopengine'), |
| 300 | ], |
| 301 | 'default' => 'bottom', |
| 302 | 'condition' => [ |
| 303 | 'shopengine_independent_add_to_cart' => 'yes', |
| 304 | ], |
| 305 | ] |
| 306 | ); |
| 307 | |
| 308 | $this->end_controls_section(); // end ./ Content Panel |
| 309 | |
| 310 | /* |
| 311 | =============================== |
| 312 | pagination settings |
| 313 | =============================== |
| 314 | */ |
| 315 | |
| 316 | $this->start_controls_section( |
| 317 | 'shopengine_pagination_settings', |
| 318 | [ |
| 319 | 'label' => esc_html__('Pagination', 'shopengine'), |
| 320 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 321 | ] |
| 322 | ); |
| 323 | |
| 324 | $this->add_control( |
| 325 | 'shopengine_pagination_style', |
| 326 | [ |
| 327 | 'label' => esc_html__('Pagination Style', 'shopengine'), |
| 328 | 'type' => Controls_Manager::SELECT, |
| 329 | 'default' => 'numeric', |
| 330 | 'options' => [ |
| 331 | 'numeric' => esc_html__('Numeric', 'shopengine'), |
| 332 | 'default' => esc_html__('Default', 'shopengine'), |
| 333 | 'load-more' => esc_html__('Load More', 'shopengine'), |
| 334 | 'load-more-on-scroll' => esc_html__('Load More On Scroll', 'shopengine'), |
| 335 | ], |
| 336 | ] |
| 337 | ); |
| 338 | |
| 339 | |
| 340 | $this->add_control( |
| 341 | 'shopengine_pagination_prev_icon', |
| 342 | [ |
| 343 | 'label' => esc_html__('Previous Icon', 'shopengine'), |
| 344 | 'type' => Controls_Manager::ICONS, |
| 345 | 'default' => [ |
| 346 | 'value' => 'eicon-chevron-left', |
| 347 | 'library' => 'eicons', |
| 348 | ], |
| 349 | 'condition' => [ |
| 350 | 'shopengine_pagination_style' => 'numeric', |
| 351 | ], |
| 352 | ] |
| 353 | ); |
| 354 | |
| 355 | $this->add_control( |
| 356 | 'shopengine_pagination_next_icon', |
| 357 | [ |
| 358 | 'label' => esc_html__('Next Icon', 'shopengine'), |
| 359 | 'type' => Controls_Manager::ICONS, |
| 360 | 'default' => [ |
| 361 | 'value' => 'eicon-chevron-right', |
| 362 | 'library' => 'eicons', |
| 363 | ], |
| 364 | 'condition' => [ |
| 365 | 'shopengine_pagination_style' => 'numeric', |
| 366 | ], |
| 367 | ] |
| 368 | ); |
| 369 | |
| 370 | $this->add_control( |
| 371 | 'shopengine_pagination_prev_text', |
| 372 | [ |
| 373 | 'label' => esc_html__('Previous button', 'shopengine'), |
| 374 | 'type' => Controls_Manager::TEXT, |
| 375 | 'default' => esc_html__('Previous', 'shopengine'), |
| 376 | 'placeholder' => esc_html__('Enter previous button text', 'shopengine'), |
| 377 | 'condition' => [ |
| 378 | 'shopengine_pagination_style' => 'default', |
| 379 | ], |
| 380 | ] |
| 381 | ); |
| 382 | |
| 383 | $this->add_control( |
| 384 | 'shopengine_pagination_next_text', |
| 385 | [ |
| 386 | 'label' => esc_html__('Next button', 'shopengine'), |
| 387 | 'type' => Controls_Manager::TEXT, |
| 388 | 'default' => esc_html__('Next', 'shopengine'), |
| 389 | 'placeholder' => esc_html__('Enter Next button text', 'shopengine'), |
| 390 | 'condition' => [ |
| 391 | 'shopengine_pagination_style' => 'default', |
| 392 | ], |
| 393 | ] |
| 394 | ); |
| 395 | |
| 396 | $this->add_control( |
| 397 | 'shopengine_pagination_loadmore_text', |
| 398 | [ |
| 399 | 'label' => esc_html__('Load more button text', 'shopengine'), |
| 400 | 'type' => Controls_Manager::TEXT, |
| 401 | 'default' => esc_html__('Load More', 'shopengine'), |
| 402 | 'placeholder' => esc_html__('Enter load more button text', 'shopengine'), |
| 403 | 'label_block' => true, |
| 404 | 'conditions' => [ |
| 405 | 'relation' => 'or', |
| 406 | 'terms' => [ |
| 407 | [ |
| 408 | 'name' => 'shopengine_pagination_style', |
| 409 | 'operator' => '==', |
| 410 | 'value' => 'load-more', |
| 411 | ], |
| 412 | [ |
| 413 | 'name' => 'shopengine_pagination_style', |
| 414 | 'operator' => '==', |
| 415 | 'value' => 'load-more-on-scroll', |
| 416 | ], |
| 417 | ], |
| 418 | ], |
| 419 | ] |
| 420 | ); |
| 421 | |
| 422 | $this->end_controls_section(); // end ./ Content Panel |
| 423 | |
| 424 | /* |
| 425 | =============================== |
| 426 | Custom Ordering settings |
| 427 | =============================== |
| 428 | */ |
| 429 | |
| 430 | $this->start_controls_section( |
| 431 | 'shopengine_custom_ordering_settings', |
| 432 | [ |
| 433 | 'label' => esc_html__('Custom Ordering', 'shopengine'), |
| 434 | 'tab' => Controls_Manager::TAB_LAYOUT, |
| 435 | ] |
| 436 | ); |
| 437 | |
| 438 | $this->add_control( |
| 439 | 'shopengine_add_to_cart_data_ordering_enable', |
| 440 | [ |
| 441 | 'label' => esc_html__('Enable Ordering?', 'shopengine'), |
| 442 | 'type' => Controls_Manager::SWITCHER, |
| 443 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 444 | 'label_off' => esc_html__('No', 'shopengine'), |
| 445 | 'default' => "yes", |
| 446 | 'return_value' => "yes", |
| 447 | 'selectors' => [ |
| 448 | '{{WRAPPER}} .shopengine-archive-products.shopengine-hover-disable .products .product' => 'display: flex; flex-direction: row; flex-wrap: wrap; align-items: center !important;', |
| 449 | //'{{WRAPPER}} .shopengine-archive-products.shopengine-hover-disable .products .product a.woocommerce-LoopProduct-link' => 'width: 100%; order: -99;', |
| 450 | '{{WRAPPER}} .shopengine-archive-products .shopengine-product-description-btn-group' => 'display: flex; flex-direction: row; flex-wrap: wrap; align-items: center !important;', |
| 451 | ], |
| 452 | ] |
| 453 | ); |
| 454 | |
| 455 | $default = [ |
| 456 | [ |
| 457 | 'list_title' => esc_html__('Quick View', 'shopengine'), |
| 458 | 'list_key' => 'quick-view', |
| 459 | ], |
| 460 | [ |
| 461 | 'list_title' => esc_html__('Wishlist', 'shopengine'), |
| 462 | 'list_key' => 'wishlist', |
| 463 | ], |
| 464 | [ |
| 465 | 'list_title' => esc_html__('Add to Cart', 'shopengine'), |
| 466 | 'list_key' => 'add-to-cart', |
| 467 | ], |
| 468 | [ |
| 469 | 'list_title' => esc_html__('Comparison', 'shopengine'), |
| 470 | 'list_key' => 'comparison', |
| 471 | ], |
| 472 | [ |
| 473 | 'list_title' => esc_html__('Direct Checkout (PRO)', 'shopengine'), |
| 474 | 'list_key' => 'direct-checkout', |
| 475 | ], |
| 476 | ]; |
| 477 | |
| 478 | $repeater = new Repeater(); |
| 479 | $this->add_control( |
| 480 | 'shopengine_custom_ordering_list', |
| 481 | [ |
| 482 | 'label' => esc_html__('Ordering List', 'shopengine'), |
| 483 | 'type' => Controls_Manager::REPEATER, |
| 484 | 'fields' => $repeater->get_controls(), |
| 485 | 'default' => $default, |
| 486 | 'title_field' => '{{{ list_title }}}', |
| 487 | 'item_actions' => [ |
| 488 | 'add' => false, |
| 489 | 'duplicate' => false, |
| 490 | 'remove' => false, |
| 491 | 'sort' => true, |
| 492 | ], |
| 493 | 'condition' => [ |
| 494 | 'shopengine_add_to_cart_data_ordering_enable' => 'yes', |
| 495 | ] |
| 496 | ] |
| 497 | ); |
| 498 | |
| 499 | // Product Info Ordering |
| 500 | $this->add_control( |
| 501 | 'shopengine_enable_product_info_ordering', |
| 502 | [ |
| 503 | 'label' => esc_html__('Enable Product Info Ordering?', 'shopengine'), |
| 504 | 'type' => Controls_Manager::SWITCHER, |
| 505 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 506 | 'label_off' => esc_html__('No', 'shopengine'), |
| 507 | 'default' => 'yes', |
| 508 | 'return_value' => 'yes', |
| 509 | 'separator' => 'before', |
| 510 | ] |
| 511 | ); |
| 512 | |
| 513 | $product_info_default = [ |
| 514 | [ |
| 515 | 'list_title' => esc_html__('Product Title', 'shopengine'), |
| 516 | 'list_key' => 'title', |
| 517 | ], |
| 518 | [ |
| 519 | 'list_title' => esc_html__('Rating', 'shopengine'), |
| 520 | 'list_key' => 'rating', |
| 521 | ], |
| 522 | [ |
| 523 | 'list_title' => esc_html__('Price', 'shopengine'), |
| 524 | 'list_key' => 'price', |
| 525 | ], |
| 526 | ]; |
| 527 | |
| 528 | $product_info_repeater = new Repeater(); |
| 529 | $this->add_control( |
| 530 | 'shopengine_product_info_ordering_list', |
| 531 | [ |
| 532 | 'label' => esc_html__('Product Info Order', 'shopengine'), |
| 533 | 'type' => Controls_Manager::REPEATER, |
| 534 | 'fields' => $product_info_repeater->get_controls(), |
| 535 | 'default' => $product_info_default, |
| 536 | 'title_field' => '{{{ list_title }}}', |
| 537 | 'item_actions' => [ |
| 538 | 'add' => false, |
| 539 | 'duplicate' => false, |
| 540 | 'remove' => false, |
| 541 | 'sort' => true, |
| 542 | ], |
| 543 | 'condition' => [ |
| 544 | 'shopengine_enable_product_info_ordering' => 'yes', |
| 545 | ] |
| 546 | ] |
| 547 | ); |
| 548 | $this->end_controls_section(); // end ./ Content Panel |
| 549 | |
| 550 | |
| 551 | /* |
| 552 | --------------------------------- |
| 553 | Container controls |
| 554 | --------------------------------- |
| 555 | */ |
| 556 | $this->start_controls_section( |
| 557 | 'shopengine_section_container_styles', |
| 558 | [ |
| 559 | 'label' => esc_html__('Product Container', 'shopengine'), |
| 560 | 'tab' => Controls_Manager::TAB_STYLE, |
| 561 | ] |
| 562 | ); |
| 563 | |
| 564 | $this->add_responsive_control( |
| 565 | 'shopengine_container_text_align', |
| 566 | [ |
| 567 | 'label' => esc_html__('Alignment', 'shopengine'), |
| 568 | 'type' => Controls_Manager::CHOOSE, |
| 569 | 'options' => [ |
| 570 | 'left' => [ |
| 571 | 'title' => esc_html__('Left', 'shopengine'), |
| 572 | 'icon' => 'eicon-text-align-left', |
| 573 | ], |
| 574 | 'center' => [ |
| 575 | 'title' => esc_html__('Center', 'shopengine'), |
| 576 | 'icon' => 'eicon-text-align-center', |
| 577 | ], |
| 578 | 'right' => [ |
| 579 | 'title' => esc_html__('Right', 'shopengine'), |
| 580 | 'icon' => 'eicon-text-align-right', |
| 581 | ], |
| 582 | ], |
| 583 | 'default' => 'left', |
| 584 | 'selectors_dictionary' => [ |
| 585 | 'left' => '-webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start;text-align:left;', |
| 586 | 'center' => '-webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;text-align:center;', |
| 587 | 'right' => '-webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end;text-align:right;', |
| 588 | ], |
| 589 | 'selectors' => [ |
| 590 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .product > a' => '{{VALUE}}', |
| 591 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .shopengine-product-description-btn-group' => '{{VALUE}}', |
| 592 | '{{WRAPPER}} .shopengine-archive-products.shopengine-hover-disable .products .product' => '{{VALUE}}', |
| 593 | '.rtl {{WRAPPER}}.elementor-align-left a.woocommerce-LoopProduct-link' => 'text-align:right;', |
| 594 | '.rtl {{WRAPPER}}.elementor-align-right a.woocommerce-LoopProduct-link' => 'text-align:left;', |
| 595 | ], |
| 596 | 'prefix_class' => 'elementor%s-align-', |
| 597 | 'separator' => 'after', |
| 598 | ] |
| 599 | ); |
| 600 | |
| 601 | $this->add_control( |
| 602 | 'shopengine_background', |
| 603 | [ |
| 604 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 605 | 'type' => Controls_Manager::COLOR, |
| 606 | 'alpha' => false, |
| 607 | 'selectors' => [ |
| 608 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container' => 'background-color: {{VALUE}};', |
| 609 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container .shopengine-product-description-footer' => 'background-color: {{VALUE}};', |
| 610 | ], |
| 611 | ] |
| 612 | ); |
| 613 | |
| 614 | // Hover background color |
| 615 | $this->add_control( |
| 616 | 'shopengine_container_hover_bg', |
| 617 | [ |
| 618 | 'label' => esc_html__('Hover Background', 'shopengine'), |
| 619 | 'type' => Controls_Manager::COLOR, |
| 620 | 'selectors' => [ |
| 621 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container:hover' => 'background-color: {{VALUE}};', |
| 622 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container:hover .shopengine-product-description-footer' => 'background-color: {{VALUE}};', |
| 623 | ], |
| 624 | ] |
| 625 | ); |
| 626 | |
| 627 | $this->add_group_control( |
| 628 | Group_Control_Border::get_type(), |
| 629 | [ |
| 630 | 'name' => 'shopengine__border', |
| 631 | 'selector' => '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container', |
| 632 | 'fields_options' => [ |
| 633 | 'color' => [ |
| 634 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 635 | 'responsive' => true, |
| 636 | ], |
| 637 | 'width' => [ |
| 638 | 'selectors' => [ |
| 639 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 640 | '.rtl {{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}', |
| 641 | ] |
| 642 | ] |
| 643 | ], |
| 644 | ] |
| 645 | ); |
| 646 | |
| 647 | // Hover border |
| 648 | $this->add_group_control( |
| 649 | Group_Control_Border::get_type(), |
| 650 | [ |
| 651 | 'name' => 'shopengine__border_hover', |
| 652 | 'label' => esc_html__('Hover Border', 'shopengine'), |
| 653 | 'selector' => '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container:hover', |
| 654 | 'fields_options' => [ |
| 655 | 'border' => [ |
| 656 | 'label' => esc_html__('Hover Border Type', 'shopengine'), |
| 657 | ], |
| 658 | 'color' => [ |
| 659 | 'label' => esc_html__('Hover Border Color', 'shopengine'), |
| 660 | ], |
| 661 | 'width' => [ |
| 662 | 'selectors' => [ |
| 663 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container:hover' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 664 | ], |
| 665 | ], |
| 666 | ], |
| 667 | ] |
| 668 | ); |
| 669 | |
| 670 | $this->add_group_control( |
| 671 | Group_Control_Box_Shadow::get_type(), |
| 672 | [ |
| 673 | // Default box shadow (non-hover) |
| 674 | 'name' => 'shopengine_container_box_shadow', |
| 675 | 'label' => esc_html__('Box Shadow', 'shopengine'), |
| 676 | 'selector' => '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container', |
| 677 | 'fields_options' => [ |
| 678 | 'box_shadow' => [ |
| 679 | 'default' => [ |
| 680 | 'horizontal' => 0, |
| 681 | 'vertical' => 1, |
| 682 | 'blur' => 3, |
| 683 | 'spread' => 0, |
| 684 | 'color' => 'rgba(0,0,0,0.06)', |
| 685 | ], |
| 686 | ], |
| 687 | |
| 688 | ], |
| 689 | ] |
| 690 | ); |
| 691 | |
| 692 | $this->add_group_control( |
| 693 | Group_Control_Box_Shadow::get_type(), |
| 694 | [ |
| 695 | 'name' => 'shopengine_container_box_shadow_hover', |
| 696 | 'label' => esc_html__('Hover Box Shadow', 'shopengine'), |
| 697 | 'selector' => '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container:hover', |
| 698 | ] |
| 699 | ); |
| 700 | |
| 701 | $this->add_responsive_control( |
| 702 | 'shopengine_margin', |
| 703 | [ |
| 704 | 'label' => esc_html__('Product Gap', 'shopengine'), |
| 705 | 'type' => Controls_Manager::SLIDER, |
| 706 | 'range' => [ |
| 707 | 'px' => [ |
| 708 | 'min' => 0, |
| 709 | 'max' => 200, |
| 710 | ], |
| 711 | ], |
| 712 | 'default' => [ |
| 713 | 'size' => 20, |
| 714 | 'unit' => 'px', |
| 715 | ], |
| 716 | |
| 717 | 'selectors' => [ |
| 718 | '{{WRAPPER}} .shopengine-archive-products.shopengine-grid ul.products' => 'grid-gap: {{SIZE}}{{UNIT}} !important;', |
| 719 | ], |
| 720 | ] |
| 721 | ); |
| 722 | |
| 723 | $this->add_responsive_control( |
| 724 | 'shopengine_archive_products_container_row_spacing', |
| 725 | [ |
| 726 | 'label' => esc_html__('Row Spacing (px)', 'shopengine'), |
| 727 | 'type' => Controls_Manager::SLIDER, |
| 728 | 'size_units' => ['px'], |
| 729 | 'default' => [ |
| 730 | 'size' => 50, |
| 731 | ], |
| 732 | 'selectors' => [ |
| 733 | '{{WRAPPER}} .shopengine-archive-products .products .archive-product-container' => 'margin-bottom: {{SIZE}}px;', |
| 734 | ], |
| 735 | 'separator' => 'before', |
| 736 | ] |
| 737 | ); |
| 738 | |
| 739 | $this->add_responsive_control( |
| 740 | 'shopengine_padding', |
| 741 | [ |
| 742 | 'label' => esc_html__('Padding', 'shopengine'), |
| 743 | 'type' => Controls_Manager::DIMENSIONS, |
| 744 | 'size_units' => ['px'], |
| 745 | 'selectors' => [ |
| 746 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 747 | '.rtl {{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .archive-product-container' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 748 | ], |
| 749 | ] |
| 750 | ); |
| 751 | |
| 752 | $this->end_controls_section(); |
| 753 | |
| 754 | /* |
| 755 | ============================= |
| 756 | Product Image section |
| 757 | ============================= |
| 758 | */ |
| 759 | $this->start_controls_section( |
| 760 | 'shopengine_section_style_img', |
| 761 | [ |
| 762 | 'label' => esc_html__('Product Image', 'shopengine'), |
| 763 | 'tab' => Controls_Manager::TAB_STYLE, |
| 764 | ] |
| 765 | ); |
| 766 | |
| 767 | $this->add_control( |
| 768 | 'shopengine_image_customize_note', |
| 769 | [ |
| 770 | 'type' => Controls_Manager::RAW_HTML, |
| 771 | 'raw' => esc_html__('Note: You can manage the image aspect ratio and cropping from Appearance > Customize > WooCommerce > Product Images.', 'shopengine'), |
| 772 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 773 | ] |
| 774 | ); |
| 775 | |
| 776 | $this->add_control( |
| 777 | 'shopengine_image_bg_color', |
| 778 | [ |
| 779 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 780 | 'type' => Controls_Manager::COLOR, |
| 781 | 'alpha' => false, |
| 782 | 'selectors' => [ |
| 783 | '{{WRAPPER}} .shopengine-archive-products .product .attachment-woocommerce_thumbnail' => 'background-color: {{VALUE}};', |
| 784 | ], |
| 785 | ] |
| 786 | ); |
| 787 | |
| 788 | $this->add_control( |
| 789 | 'shopengine_image_height_switch', |
| 790 | [ |
| 791 | 'label' => esc_html__('Use image height', 'shopengine'), |
| 792 | 'type' => Controls_Manager::SWITCHER, |
| 793 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 794 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 795 | 'return_value' => 'yes', |
| 796 | 'default' => '', |
| 797 | ] |
| 798 | ); |
| 799 | |
| 800 | $this->add_responsive_control( |
| 801 | 'shopengine_image_height', |
| 802 | [ |
| 803 | 'label' => esc_html__('Height', 'shopengine'), |
| 804 | 'type' => Controls_Manager::SLIDER, |
| 805 | 'size_units' => ['px'], |
| 806 | 'range' => [ |
| 807 | 'px' => [ |
| 808 | 'min' => 0, |
| 809 | 'max' => 600, |
| 810 | 'step' => 5, |
| 811 | ], |
| 812 | ], |
| 813 | 'default' => [ |
| 814 | 'size' => 255, |
| 815 | ], |
| 816 | 'selectors' => [ |
| 817 | '{{WRAPPER}} .shopengine-archive-products .product .attachment-woocommerce_thumbnail' => 'height: {{SIZE}}{{UNIT}};', |
| 818 | ], |
| 819 | 'condition' => ['shopengine_image_height_switch' => 'yes'], |
| 820 | ] |
| 821 | ); |
| 822 | |
| 823 | $this->add_responsive_control( |
| 824 | 'shopengine_image_padding', |
| 825 | [ |
| 826 | 'label' => esc_html__('Padding', 'shopengine'), |
| 827 | 'type' => Controls_Manager::DIMENSIONS, |
| 828 | 'size_units' => ['px'], |
| 829 | 'selectors' => [ |
| 830 | '{{WRAPPER}} .shopengine-archive-products .product .attachment-woocommerce_thumbnail' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 831 | '.rtl {{WRAPPER}} .shopengine-archive-products .product .attachment-woocommerce_thumbnail' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 832 | ], |
| 833 | 'separator' => 'before', |
| 834 | ] |
| 835 | ); |
| 836 | $this->end_controls_section(); |
| 837 | |
| 838 | /* |
| 839 | ============================= |
| 840 | Product Category style |
| 841 | ============================= |
| 842 | */ |
| 843 | $this->start_controls_section( |
| 844 | 'shopengine_section_style_cats', |
| 845 | [ |
| 846 | 'label' => esc_html__('Product Categories', 'shopengine'), |
| 847 | 'tab' => Controls_Manager::TAB_STYLE, |
| 848 | 'condition' => [ |
| 849 | 'shopengine_is_cats' => 'yes', |
| 850 | ], |
| 851 | ] |
| 852 | ); |
| 853 | $this->add_control( |
| 854 | 'shopengine_cats_max', |
| 855 | [ |
| 856 | 'label' => esc_html__('Max Categories', 'shopengine'), |
| 857 | 'type' => Controls_Manager::NUMBER, |
| 858 | 'separator' => 'after', |
| 859 | 'default' => 1, |
| 860 | ] |
| 861 | ); |
| 862 | |
| 863 | $this->add_control( |
| 864 | 'shopengine_cats_color', |
| 865 | [ |
| 866 | 'label' => esc_html__('Color', 'shopengine'), |
| 867 | 'type' => Controls_Manager::COLOR, |
| 868 | 'alpha' => false, |
| 869 | 'default' => '#858585', |
| 870 | 'selectors' => [ |
| 871 | '{{WRAPPER}} .shopengine-archive-products .product-categories' => 'color: {{VALUE}};', |
| 872 | ], |
| 873 | ] |
| 874 | ); |
| 875 | |
| 876 | $this->add_group_control( |
| 877 | Group_Control_Typography::get_type(), |
| 878 | [ |
| 879 | 'name' => 'shopengine_cats_font', |
| 880 | 'label' => esc_html__('Typography', 'shopengine'), |
| 881 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .product-categories > li', |
| 882 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'], |
| 883 | 'fields_options' => [ |
| 884 | 'typography' => [ |
| 885 | 'default' => 'custom', |
| 886 | ], |
| 887 | 'font_weight' => [ |
| 888 | 'default' => '400', |
| 889 | ], |
| 890 | 'font_size' => [ |
| 891 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 892 | 'default' => [ |
| 893 | 'size' => '13', |
| 894 | 'unit' => 'px', |
| 895 | ], |
| 896 | 'size_units' => ['px'], |
| 897 | ], |
| 898 | 'line_height' => [ |
| 899 | 'label' => esc_html__('Line-height (px)', 'shopengine'), |
| 900 | 'default' => [ |
| 901 | 'size' => '14', |
| 902 | 'unit' => 'px', |
| 903 | ], |
| 904 | 'responsive' => false, |
| 905 | 'size_units' => ['px'], |
| 906 | ], |
| 907 | ], |
| 908 | ] |
| 909 | ); |
| 910 | |
| 911 | |
| 912 | $this->add_control( |
| 913 | 'shopengine_cats_spacing', |
| 914 | [ |
| 915 | 'label' => esc_html__('Padding', 'shopengine'), |
| 916 | 'type' => Controls_Manager::DIMENSIONS, |
| 917 | 'size_units' => ['px'], |
| 918 | 'default' => [ |
| 919 | 'top' => '15', |
| 920 | 'right' => '0', |
| 921 | 'bottom' => '5', |
| 922 | 'left' => '0', |
| 923 | 'isLinked' => false, |
| 924 | 'unit' => 'px', |
| 925 | ], |
| 926 | 'selectors' => [ |
| 927 | '{{WRAPPER}} .shopengine-archive-products .product-categories' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 928 | '.rtl {{WRAPPER}} .shopengine-archive-products .product-categories' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 929 | ], |
| 930 | 'separator' => 'before', |
| 931 | ] |
| 932 | ); |
| 933 | $this->end_controls_section(); |
| 934 | |
| 935 | /* |
| 936 | ============================= |
| 937 | product title start |
| 938 | ============================= |
| 939 | */ |
| 940 | |
| 941 | $this->start_controls_section( |
| 942 | 'shopengine_section_style_title', |
| 943 | [ |
| 944 | 'label' => esc_html__('Product Title', 'shopengine'), |
| 945 | 'tab' => Controls_Manager::TAB_STYLE, |
| 946 | ] |
| 947 | ); |
| 948 | |
| 949 | |
| 950 | $this->add_control( |
| 951 | 'shopengine_title_excerpt_enable', |
| 952 | [ |
| 953 | 'label' => esc_html__('Enable Title Excerpt', 'shopengine'), |
| 954 | 'type' => Controls_Manager::SWITCHER, |
| 955 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 956 | 'label_off' => esc_html__('No', 'shopengine'), |
| 957 | 'return_value' => 'yes', |
| 958 | 'default' => 'no', |
| 959 | 'description' => esc_html__('Enable to show a truncated title with a maximum word count.', 'shopengine'), |
| 960 | ] |
| 961 | ); |
| 962 | |
| 963 | // Number control for maximum words |
| 964 | $this->add_control( |
| 965 | 'shopengine_title_excerpt_length', |
| 966 | [ |
| 967 | 'label' => esc_html__('Max Words', 'shopengine'), |
| 968 | 'type' => Controls_Manager::NUMBER, |
| 969 | 'min' => 1, |
| 970 | 'max' => 50, |
| 971 | 'step' => 1, |
| 972 | 'default' => 5, |
| 973 | 'description' => esc_html__('Set the maximum number of words for the title excerpt.', 'shopengine'), |
| 974 | 'condition' => [ |
| 975 | 'shopengine_title_excerpt_enable' => 'yes', |
| 976 | ], |
| 977 | ] |
| 978 | ); |
| 979 | |
| 980 | $this->add_control( |
| 981 | 'shopengine_title_color', |
| 982 | [ |
| 983 | 'label' => esc_html__('Color', 'shopengine'), |
| 984 | 'type' => Controls_Manager::COLOR, |
| 985 | 'default' => '#101010', |
| 986 | 'alpha' => false, |
| 987 | 'selectors' => [ |
| 988 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .product .woocommerce-loop-product__title' => 'color: {{VALUE}};', |
| 989 | ], |
| 990 | ] |
| 991 | ); |
| 992 | |
| 993 | $this->add_control( |
| 994 | 'shopengine_title_hover_color', |
| 995 | [ |
| 996 | 'label' => esc_html__('Hover Color', 'shopengine'), |
| 997 | 'type' => Controls_Manager::COLOR, |
| 998 | 'alpha' => false, |
| 999 | 'selectors' => [ |
| 1000 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .product a:hover .woocommerce-loop-product__title' => 'color: {{VALUE}};', |
| 1001 | ], |
| 1002 | ] |
| 1003 | ); |
| 1004 | |
| 1005 | $this->add_group_control( |
| 1006 | Group_Control_Typography::get_type(), |
| 1007 | [ |
| 1008 | 'name' => 'shopengine_title_color_typography', |
| 1009 | 'label' => esc_html__('Typography', 'shopengine'), |
| 1010 | 'selector' => '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) ul.products li.product .woocommerce-loop-product__title', |
| 1011 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style'], |
| 1012 | 'fields_options' => [ |
| 1013 | 'typography' => [ |
| 1014 | 'default' => 'custom', |
| 1015 | ], |
| 1016 | 'font_weight' => [ |
| 1017 | 'default' => '500', |
| 1018 | ], |
| 1019 | 'font_size' => [ |
| 1020 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1021 | 'default' => [ |
| 1022 | 'size' => '16', |
| 1023 | 'unit' => 'px', |
| 1024 | ], |
| 1025 | 'size_units' => ['px'], |
| 1026 | ], |
| 1027 | 'text_transform' => [ |
| 1028 | 'default' => 'capitalize', |
| 1029 | ], |
| 1030 | 'line_height' => [ |
| 1031 | 'label' => esc_html__('Line Height (px)', 'shopengine'), |
| 1032 | 'default' => [ |
| 1033 | 'size' => '18', |
| 1034 | 'unit' => 'px', |
| 1035 | ], |
| 1036 | 'responsive' => false, |
| 1037 | 'size_units' => ['px'] // enable only px |
| 1038 | ], |
| 1039 | ], |
| 1040 | ] |
| 1041 | ); |
| 1042 | |
| 1043 | |
| 1044 | $this->add_responsive_control( |
| 1045 | 'shopengine_title_padding', |
| 1046 | [ |
| 1047 | 'label' => esc_html__('Padding', 'shopengine'), |
| 1048 | 'type' => Controls_Manager::DIMENSIONS, |
| 1049 | 'size_units' => ['px'], |
| 1050 | 'selectors' => [ |
| 1051 | '{{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .product .woocommerce-loop-product__title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1052 | '.rtl {{WRAPPER}} .shopengine-archive-products:not(.shopengine-archive-products--view-list) .product .woocommerce-loop-product__title' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1053 | ], |
| 1054 | 'separator' => 'before', |
| 1055 | ] |
| 1056 | ); |
| 1057 | $this->end_controls_section(); |
| 1058 | |
| 1059 | /* |
| 1060 | ============================= |
| 1061 | product price start |
| 1062 | ============================= |
| 1063 | */ |
| 1064 | $this->start_controls_section( |
| 1065 | 'shopengine_section_style_price', |
| 1066 | [ |
| 1067 | 'label' => esc_html__('Product Price', 'shopengine'), |
| 1068 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1069 | ] |
| 1070 | ); |
| 1071 | $this->add_control( |
| 1072 | 'shopengine_sell_price_color', |
| 1073 | [ |
| 1074 | 'label' => esc_html__('Color', 'shopengine'), |
| 1075 | 'type' => Controls_Manager::COLOR, |
| 1076 | 'default' => '#101010', |
| 1077 | 'alpha' => false, |
| 1078 | 'selectors' => [ |
| 1079 | '{{WRAPPER}} .shopengine-archive-products .product .price' => 'color: {{VALUE}};', |
| 1080 | ], |
| 1081 | ] |
| 1082 | ); |
| 1083 | |
| 1084 | $this->add_group_control( |
| 1085 | Group_Control_Typography::get_type(), |
| 1086 | [ |
| 1087 | 'name' => 'shopengine_product_price_typography', |
| 1088 | 'label' => esc_html__('Typography', 'shopengine'), |
| 1089 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .price .amount', |
| 1090 | 'exclude' => ['font_family', 'text_transform', 'font_style', 'text_decoration', 'letter_spacing'], |
| 1091 | 'fields_options' => [ |
| 1092 | 'typography' => [ |
| 1093 | 'default' => 'custom', |
| 1094 | ], |
| 1095 | 'font_weight' => [ |
| 1096 | 'default' => '700', |
| 1097 | ], |
| 1098 | 'font_size' => [ |
| 1099 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1100 | 'default' => [ |
| 1101 | 'size' => '18', |
| 1102 | 'unit' => 'px', |
| 1103 | ], |
| 1104 | 'size_units' => ['px'], |
| 1105 | ], |
| 1106 | 'line_height' => [ |
| 1107 | 'label' => esc_html__('Line Height (px)', 'shopengine'), |
| 1108 | 'default' => [ |
| 1109 | 'size' => '22', |
| 1110 | 'unit' => 'px', |
| 1111 | ], |
| 1112 | 'responsive' => false, |
| 1113 | 'size_units' => ['px'], |
| 1114 | ], |
| 1115 | ], |
| 1116 | ] |
| 1117 | ); |
| 1118 | |
| 1119 | $this->add_control( |
| 1120 | 'shopengine_price_reg_head', |
| 1121 | [ |
| 1122 | 'label' => esc_html__('Regular Price', 'shopengine'), |
| 1123 | 'type' => Controls_Manager::HEADING, |
| 1124 | 'separator' => 'before', |
| 1125 | 'condition' => [ |
| 1126 | 'shopengine_show_regular_price' => 'yes', |
| 1127 | ], |
| 1128 | ] |
| 1129 | ); |
| 1130 | |
| 1131 | $this->add_control( |
| 1132 | 'shopengine_price_reg_pos', |
| 1133 | [ |
| 1134 | 'label' => esc_html__('Position', 'shopengine'), |
| 1135 | 'type' => Controls_Manager::SELECT, |
| 1136 | 'options' => [ |
| 1137 | 'before' => esc_html__('Before', 'shopengine'), |
| 1138 | 'after' => esc_html__('After', 'shopengine'), |
| 1139 | ], |
| 1140 | 'default' => 'before', |
| 1141 | 'prefix_class' => 'shopengine-price-pos-', |
| 1142 | 'condition' => [ |
| 1143 | 'shopengine_show_regular_price' => 'yes', |
| 1144 | ], |
| 1145 | ] |
| 1146 | ); |
| 1147 | |
| 1148 | $this->add_responsive_control( |
| 1149 | 'shopengine_price_reg_size', |
| 1150 | [ |
| 1151 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1152 | 'type' => Controls_Manager::SLIDER, |
| 1153 | 'size_units' => ['px'], |
| 1154 | 'selectors' => [ |
| 1155 | '{{WRAPPER}} .shopengine-archive-products .price > del bdi' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1156 | ], |
| 1157 | 'condition' => [ |
| 1158 | 'shopengine_show_regular_price' => 'yes', |
| 1159 | ], |
| 1160 | ] |
| 1161 | ); |
| 1162 | |
| 1163 | $this->add_responsive_control( |
| 1164 | 'shopengine_price_padding', |
| 1165 | [ |
| 1166 | 'label' => esc_html__('Padding', 'shopengine'), |
| 1167 | 'type' => Controls_Manager::DIMENSIONS, |
| 1168 | 'size_units' => ['px'], |
| 1169 | 'selectors' => [ |
| 1170 | '{{WRAPPER}} .shopengine-archive-products .product .price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1171 | '.rtl {{WRAPPER}} .shopengine-archive-products .product .price' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1172 | ], |
| 1173 | 'separator' => 'before', |
| 1174 | ] |
| 1175 | ); |
| 1176 | |
| 1177 | $this->end_controls_section(); |
| 1178 | |
| 1179 | /* |
| 1180 | ===================================== |
| 1181 | Product Description |
| 1182 | ===================================== |
| 1183 | */ |
| 1184 | |
| 1185 | $this->start_controls_section( |
| 1186 | 'shopengine_product_description', |
| 1187 | [ |
| 1188 | 'label' => esc_html__('Product Description', 'shopengine'), |
| 1189 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1190 | 'condition' => [ |
| 1191 | 'shopengine_is_details' => 'yes', |
| 1192 | ], |
| 1193 | ] |
| 1194 | ); |
| 1195 | |
| 1196 | $this->add_control( |
| 1197 | 'shopengine_archive_description_color', |
| 1198 | [ |
| 1199 | 'label' => esc_html__('Color', 'shopengine'), |
| 1200 | 'type' => Controls_Manager::COLOR, |
| 1201 | 'alpha' => false, |
| 1202 | 'selectors' => [ |
| 1203 | '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'color: {{VALUE}};', |
| 1204 | ], |
| 1205 | ] |
| 1206 | ); |
| 1207 | |
| 1208 | $this->add_group_control( |
| 1209 | Group_Control_Typography::get_type(), |
| 1210 | [ |
| 1211 | 'name' => 'shopengine_archive_description_typography', |
| 1212 | 'label' => esc_html__('Typography', 'shopengine'), |
| 1213 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt', |
| 1214 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'line_height'], |
| 1215 | 'fields_options' => [ |
| 1216 | 'font_size' => [ |
| 1217 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1218 | 'size_units' => ['px'], |
| 1219 | ], |
| 1220 | ], |
| 1221 | ] |
| 1222 | ); |
| 1223 | |
| 1224 | $this->add_group_control( |
| 1225 | Group_Control_Border::get_type(), |
| 1226 | [ |
| 1227 | 'name' => 'shopengine_archive_description_border', |
| 1228 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt', |
| 1229 | 'fields_options' => [ |
| 1230 | 'border' => [ |
| 1231 | 'default' => 'solid', |
| 1232 | ], |
| 1233 | 'width' => [ |
| 1234 | 'label' => esc_html__('Border Width', 'shopengine'), |
| 1235 | 'default' => [ |
| 1236 | 'top' => '1', |
| 1237 | 'right' => '0', |
| 1238 | 'bottom' => '0', |
| 1239 | 'left' => '0', |
| 1240 | 'isLinked' => false, |
| 1241 | ], |
| 1242 | 'selectors' => [ |
| 1243 | '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1244 | '.rtl {{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1245 | ] |
| 1246 | ], |
| 1247 | 'color' => [ |
| 1248 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 1249 | 'default' => '#f2f2f2', |
| 1250 | ], |
| 1251 | ], |
| 1252 | ] |
| 1253 | ); |
| 1254 | |
| 1255 | $this->add_responsive_control( |
| 1256 | 'shopengine_archive_description_padding', |
| 1257 | [ |
| 1258 | 'label' => esc_html__('Padding', 'shopengine'), |
| 1259 | 'type' => Controls_Manager::DIMENSIONS, |
| 1260 | 'size_units' => ['px'], |
| 1261 | 'selectors' => [ |
| 1262 | '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1263 | '.rtl {{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1264 | ], |
| 1265 | 'separator' => 'before', |
| 1266 | ] |
| 1267 | ); |
| 1268 | |
| 1269 | $this->end_controls_section(); |
| 1270 | |
| 1271 | /* |
| 1272 | ===================================== |
| 1273 | Product Footer |
| 1274 | ===================================== |
| 1275 | */ |
| 1276 | |
| 1277 | $this->start_controls_section( |
| 1278 | 'shopengine_product_footer', |
| 1279 | [ |
| 1280 | 'label' => esc_html__('Product Footer', 'shopengine'), |
| 1281 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1282 | ] |
| 1283 | ); |
| 1284 | |
| 1285 | $this->add_responsive_control( |
| 1286 | 'shopengine_archive_footer_padding', |
| 1287 | [ |
| 1288 | 'label' => esc_html__('Padding', 'shopengine'), |
| 1289 | 'type' => Controls_Manager::DIMENSIONS, |
| 1290 | 'size_units' => ['px'], |
| 1291 | 'selectors' => [ |
| 1292 | '{{WRAPPER}} .shopengine-archive-products .product .shopengine-product-description-footer' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1293 | '.rtl {{WRAPPER}} .shopengine-archive-products .product .shopengine-product-description-footer' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1294 | ], |
| 1295 | ] |
| 1296 | ); |
| 1297 | |
| 1298 | $this->end_controls_section(); |
| 1299 | |
| 1300 | /* |
| 1301 | ===================================== |
| 1302 | Product Wrapper |
| 1303 | ===================================== |
| 1304 | */ |
| 1305 | |
| 1306 | $this->start_controls_section( |
| 1307 | 'shopengine_list_view_product_wrapper', |
| 1308 | [ |
| 1309 | 'label' => esc_html__('Product List View Wrapper', 'shopengine'), |
| 1310 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1311 | ] |
| 1312 | ); |
| 1313 | |
| 1314 | $this->start_controls_tabs( |
| 1315 | 'list_view_tabs' |
| 1316 | ); |
| 1317 | |
| 1318 | $this->start_controls_tab( |
| 1319 | 'style_normal_tab', |
| 1320 | [ |
| 1321 | 'label' => esc_html__( 'Normal', 'shopengine' ), |
| 1322 | ] |
| 1323 | ); |
| 1324 | |
| 1325 | $this->add_group_control( |
| 1326 | Group_Control_Border::get_type(), |
| 1327 | [ |
| 1328 | 'name' => 'shopengine_list_view_product_border', |
| 1329 | 'selector' => '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container', |
| 1330 | 'fields_options' => [ |
| 1331 | 'border' => [ |
| 1332 | ], |
| 1333 | 'width' => [ |
| 1334 | 'label' => esc_html__('Border Width', 'shopengine'), |
| 1335 | 'default' => [ |
| 1336 | 'top' => '0', |
| 1337 | 'right' => '0', |
| 1338 | 'bottom' => '0', |
| 1339 | 'left' => '0', |
| 1340 | ], |
| 1341 | 'selectors' => [ |
| 1342 | '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1343 | '.rtl {{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1344 | ], |
| 1345 | ], |
| 1346 | 'color' => [ |
| 1347 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 1348 | ], |
| 1349 | ], |
| 1350 | ] |
| 1351 | ); |
| 1352 | |
| 1353 | $this->add_control( |
| 1354 | 'shopengine_list_view_product_radius', |
| 1355 | [ |
| 1356 | 'label' => esc_html__('Border Radius', 'shopengine'), |
| 1357 | 'type' => Controls_Manager::DIMENSIONS, |
| 1358 | 'size_units' => ['px'], |
| 1359 | 'selectors' => [ |
| 1360 | '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow: hidden;', |
| 1361 | '.rtl {{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}; overflow: hidden;', |
| 1362 | '{{WRAPPER}} .shopengine-archive-products.shopengine-archive-products--view-list .shopengine-archive-products__left-image img' => 'display: block', |
| 1363 | ], |
| 1364 | ] |
| 1365 | ); |
| 1366 | |
| 1367 | $this->add_control( |
| 1368 | 'shopengine_list_view_product_bg_color', |
| 1369 | [ |
| 1370 | 'label' => esc_html__('Background', 'shopengine'), |
| 1371 | 'type' => Controls_Manager::COLOR, |
| 1372 | 'alpha' => false, |
| 1373 | 'selectors' => [ |
| 1374 | '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container' => 'background: {{VALUE}};', |
| 1375 | ], |
| 1376 | ] |
| 1377 | ); |
| 1378 | |
| 1379 | $this->add_group_control( |
| 1380 | Group_Control_Box_Shadow::get_type(), |
| 1381 | [ |
| 1382 | 'name' => 'shopengine_list_view_product_box_shadow', |
| 1383 | 'label' => esc_html__('Box Shadow', 'shopengine'), |
| 1384 | 'selector' => '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container', |
| 1385 | ] |
| 1386 | ); |
| 1387 | |
| 1388 | $this->end_controls_tab(); |
| 1389 | |
| 1390 | |
| 1391 | $this->start_controls_tab( |
| 1392 | 'style_Hover_tab', |
| 1393 | [ |
| 1394 | 'label' => esc_html__( 'Hover', 'shopengine' ), |
| 1395 | ] |
| 1396 | ); |
| 1397 | |
| 1398 | $this->add_group_control( |
| 1399 | Group_Control_Border::get_type(), |
| 1400 | [ |
| 1401 | 'name' => 'shopengine_list_view_product_border_hover', |
| 1402 | 'selector' => '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container:hover', |
| 1403 | 'fields_options' => [ |
| 1404 | 'border' => [ |
| 1405 | ], |
| 1406 | 'width' => [ |
| 1407 | 'label' => esc_html__('Border Width', 'shopengine'), |
| 1408 | 'default' => [ |
| 1409 | 'top' => '0', |
| 1410 | 'right' => '0', |
| 1411 | 'bottom' => '0', |
| 1412 | 'left' => '0', |
| 1413 | ], |
| 1414 | ], |
| 1415 | 'color' => [ |
| 1416 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 1417 | ], |
| 1418 | ], |
| 1419 | ] |
| 1420 | ); |
| 1421 | |
| 1422 | $this->add_control( |
| 1423 | 'shopengine_list_view_product_radius_hover', |
| 1424 | [ |
| 1425 | 'label' => esc_html__('Border Radius', 'shopengine'), |
| 1426 | 'type' => Controls_Manager::DIMENSIONS, |
| 1427 | 'size_units' => ['px'], |
| 1428 | 'selectors' => [ |
| 1429 | '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1430 | '.rtl {{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container:hover' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1431 | '{{WRAPPER}} .shopengine-archive-products.shopengine-archive-products--view-list .shopengine-archive-products__left-image img' => 'display: block', |
| 1432 | ], |
| 1433 | ] |
| 1434 | ); |
| 1435 | |
| 1436 | $this->add_control( |
| 1437 | 'shopengine_list_view_product_bg_color_hover', |
| 1438 | [ |
| 1439 | 'label' => esc_html__('Background', 'shopengine'), |
| 1440 | 'type' => Controls_Manager::COLOR, |
| 1441 | 'alpha' => false, |
| 1442 | 'selectors' => [ |
| 1443 | '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container:hover' => 'background: {{VALUE}};', |
| 1444 | ], |
| 1445 | ] |
| 1446 | ); |
| 1447 | |
| 1448 | $this->add_group_control( |
| 1449 | Group_Control_Box_Shadow::get_type(), |
| 1450 | [ |
| 1451 | 'name' => 'shopengine_list_view_product_box_shadow_hover', |
| 1452 | 'label' => esc_html__('Box Shadow', 'shopengine'), |
| 1453 | 'selector' => '{{WRAPPER}} .shopengine-archive-products--view-list .archive-product-container:hover', |
| 1454 | ] |
| 1455 | ); |
| 1456 | |
| 1457 | $this->end_controls_tab(); |
| 1458 | |
| 1459 | $this->end_controls_tabs(); |
| 1460 | |
| 1461 | $this->end_controls_section(); |
| 1462 | |
| 1463 | /* |
| 1464 | ---------------------------- |
| 1465 | Off tag |
| 1466 | ---------------------------- |
| 1467 | */ |
| 1468 | |
| 1469 | $this->start_controls_section( |
| 1470 | 'shopengine_off_tag', |
| 1471 | [ |
| 1472 | 'label' => esc_html__('Off Tag', 'shopengine'), |
| 1473 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1474 | 'condition' => [ |
| 1475 | 'shopengine_show_off_tag' => 'yes', |
| 1476 | ], |
| 1477 | ] |
| 1478 | ); |
| 1479 | |
| 1480 | $this->add_control( |
| 1481 | 'product_price_discount_badge_color', |
| 1482 | [ |
| 1483 | 'label' => esc_html__('Color', 'shopengine'), |
| 1484 | 'type' => Controls_Manager::COLOR, |
| 1485 | 'default' => '#FFFFFF', |
| 1486 | 'alpha' => false, |
| 1487 | 'selectors' => [ |
| 1488 | '{{WRAPPER}} .shopengine-discount-badge' => 'color: {{VALUE}};', |
| 1489 | ], |
| 1490 | ] |
| 1491 | ); |
| 1492 | |
| 1493 | $this->add_control( |
| 1494 | 'product_price_discount_badge_bg_color', |
| 1495 | [ |
| 1496 | 'label' => esc_html__('Background', 'shopengine'), |
| 1497 | 'type' => Controls_Manager::COLOR, |
| 1498 | 'default' => '#F54F29', |
| 1499 | 'alpha' => false, |
| 1500 | 'selectors' => [ |
| 1501 | '{{WRAPPER}} .shopengine-discount-badge' => 'background: {{VALUE}};', |
| 1502 | ], |
| 1503 | ] |
| 1504 | ); |
| 1505 | |
| 1506 | $this->add_responsive_control( |
| 1507 | 'product_price_discount_badge_padding', |
| 1508 | [ |
| 1509 | 'label' => esc_html__('Badge Padding', 'shopengine'), |
| 1510 | 'type' => Controls_Manager::DIMENSIONS, |
| 1511 | 'size_units' => ['px'], |
| 1512 | 'default' => [ |
| 1513 | 'top' => '0', |
| 1514 | 'right' => '10', |
| 1515 | 'bottom' => '0', |
| 1516 | 'left' => '10', |
| 1517 | 'unit' => 'px', |
| 1518 | 'isLinked' => false, |
| 1519 | ], |
| 1520 | 'selectors' => [ |
| 1521 | '{{WRAPPER}} .shopengine-discount-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1522 | '.rtl {{WRAPPER}} .shopengine-discount-badge' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1523 | ], |
| 1524 | ] |
| 1525 | ); |
| 1526 | |
| 1527 | $this->add_responsive_control( |
| 1528 | 'product_price_discount_badge_margin', |
| 1529 | [ |
| 1530 | 'label' => esc_html__('Badge Margin', 'shopengine'), |
| 1531 | 'type' => Controls_Manager::DIMENSIONS, |
| 1532 | 'size_units' => ['px'], |
| 1533 | 'default' => [ |
| 1534 | 'top' => '0', |
| 1535 | 'right' => '0', |
| 1536 | 'bottom' => '0', |
| 1537 | 'left' => '5', |
| 1538 | 'unit' => 'px', |
| 1539 | 'isLinked' => false, |
| 1540 | ], |
| 1541 | 'selectors' => [ |
| 1542 | '{{WRAPPER}} .shopengine-discount-badge' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1543 | '.rtl {{WRAPPER}} .shopengine-discount-badge' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1544 | ], |
| 1545 | ] |
| 1546 | ); |
| 1547 | |
| 1548 | $this->end_controls_section(); |
| 1549 | |
| 1550 | // end off tag |
| 1551 | /* |
| 1552 | ============================== |
| 1553 | Button settings |
| 1554 | ============================== |
| 1555 | */ |
| 1556 | |
| 1557 | $this->start_controls_section( |
| 1558 | 'shopengine_section_button', |
| 1559 | [ |
| 1560 | 'label' => esc_html__('Add To Cart Button', 'shopengine'), |
| 1561 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1562 | ] |
| 1563 | ); |
| 1564 | |
| 1565 | $this->add_responsive_control( |
| 1566 | 'shopengine_archvie_btn_padding', |
| 1567 | [ |
| 1568 | 'label' => esc_html__('Padding', 'shopengine'), |
| 1569 | 'type' => Controls_Manager::DIMENSIONS, |
| 1570 | 'size_units' => ['px'], |
| 1571 | 'default' => [ |
| 1572 | 'top' => '9', |
| 1573 | 'right' => '21', |
| 1574 | 'bottom' => '10', |
| 1575 | 'left' => '21', |
| 1576 | 'unit' => 'px', |
| 1577 | 'isLinked' => false, |
| 1578 | ], |
| 1579 | 'selectors' => [ |
| 1580 | '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1581 | '{{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1582 | '.rtl {{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 1583 | '.rtl {{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 1584 | ], |
| 1585 | ] |
| 1586 | ); |
| 1587 | |
| 1588 | $this->add_responsive_control( |
| 1589 | 'shopengine_archvie_btn_margin', |
| 1590 | [ |
| 1591 | 'label' => esc_html__('Margin', 'shopengine'), |
| 1592 | 'type' => Controls_Manager::DIMENSIONS, |
| 1593 | 'size_units' => ['px'], |
| 1594 | 'default' => [ |
| 1595 | 'top' => '0', |
| 1596 | 'right' => '0', |
| 1597 | 'bottom' => '0', |
| 1598 | 'left' => '0', |
| 1599 | 'unit' => 'px', |
| 1600 | 'isLinked' => true, |
| 1601 | ], |
| 1602 | 'selectors' => [ |
| 1603 | '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1604 | '{{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1605 | '.rtl {{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 1606 | '.rtl {{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 1607 | ], |
| 1608 | ] |
| 1609 | ); |
| 1610 | |
| 1611 | $this->add_control( |
| 1612 | 'shopengine_archvie_btn_radius', |
| 1613 | [ |
| 1614 | 'label' => esc_html__('Border Radius', 'shopengine'), |
| 1615 | 'type' => Controls_Manager::DIMENSIONS, |
| 1616 | 'size_units' => ['px'], |
| 1617 | 'selectors' => [ |
| 1618 | '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1619 | '{{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 1620 | '.rtl {{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 1621 | '.rtl {{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 1622 | ], |
| 1623 | ] |
| 1624 | ); |
| 1625 | |
| 1626 | $this->add_group_control( |
| 1627 | Group_Control_Typography::get_type(), |
| 1628 | [ |
| 1629 | 'name' => 'shopengine_archvie_btn_typography', |
| 1630 | 'label' => esc_html__('Button Typography', 'shopengine'), |
| 1631 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)', |
| 1632 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style', 'line_height'], |
| 1633 | 'fields_options' => [ |
| 1634 | 'font_size' => [ |
| 1635 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1636 | 'size_units' => ['px'], |
| 1637 | ], |
| 1638 | ], |
| 1639 | ] |
| 1640 | ); |
| 1641 | |
| 1642 | $this->add_group_control( |
| 1643 | Group_Control_Box_Shadow::get_type(), |
| 1644 | [ |
| 1645 | 'name' => 'shopengine_archvie_btn_box_shadow', |
| 1646 | 'label' => esc_html__('Box Shadow', 'shopengine'), |
| 1647 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .product .button[data-quantity]', |
| 1648 | ] |
| 1649 | ); |
| 1650 | |
| 1651 | |
| 1652 | $this->start_controls_tabs('shopengine_archvie_btn_tabs'); |
| 1653 | |
| 1654 | $this->start_controls_tab( |
| 1655 | 'shopengine_archvie_btn_tab_normal', |
| 1656 | [ |
| 1657 | 'label' => esc_html__('Normal', 'shopengine'), |
| 1658 | ] |
| 1659 | ); |
| 1660 | |
| 1661 | $this->add_control( |
| 1662 | 'shopengine_archvie_btn_normal_clr', |
| 1663 | [ |
| 1664 | 'label' => esc_html__('Color', 'shopengine'), |
| 1665 | 'type' => Controls_Manager::COLOR, |
| 1666 | 'default' => '#f1f1f1', |
| 1667 | 'alpha' => false, |
| 1668 | 'selectors' => [ |
| 1669 | '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'text-align:left;color: {{VALUE}} !important;', |
| 1670 | '{{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'text-align:left;color: {{VALUE}} !important;', |
| 1671 | ], |
| 1672 | ] |
| 1673 | ); |
| 1674 | |
| 1675 | $this->add_control( |
| 1676 | 'shopengine_archvie_btn_normal_bg', |
| 1677 | [ |
| 1678 | 'label' => esc_html__('Background', 'shopengine'), |
| 1679 | 'type' => Controls_Manager::COLOR, |
| 1680 | 'default' => '#505255', |
| 1681 | 'alpha' => false, |
| 1682 | 'selectors' => [ |
| 1683 | '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger)' => 'background: {{VALUE}} !important;', |
| 1684 | '{{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward)' => 'background: {{VALUE}} !important;', |
| 1685 | ], |
| 1686 | ] |
| 1687 | ); |
| 1688 | |
| 1689 | $this->end_controls_tab(); |
| 1690 | |
| 1691 | $this->start_controls_tab( |
| 1692 | 'shopengine_archvie_btn_tabs_hover', |
| 1693 | [ |
| 1694 | 'label' => esc_html__('Hover', 'shopengine'), |
| 1695 | ] |
| 1696 | ); |
| 1697 | |
| 1698 | $this->add_control( |
| 1699 | 'shopengine_archvie_btn_hover_clr', |
| 1700 | [ |
| 1701 | 'label' => esc_html__('Color', 'shopengine'), |
| 1702 | 'type' => Controls_Manager::COLOR, |
| 1703 | 'alpha' => false, |
| 1704 | 'default' => '#f1f1f1', |
| 1705 | 'selectors' => [ |
| 1706 | '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger):hover' => 'color: {{VALUE}} !important;', |
| 1707 | '{{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward):hover' => 'color: {{VALUE}} !important;', |
| 1708 | ], |
| 1709 | ] |
| 1710 | ); |
| 1711 | |
| 1712 | $this->add_control( |
| 1713 | 'shopengine_archvie_btn_hover_bg', |
| 1714 | [ |
| 1715 | 'label' => esc_html__('Background', 'shopengine'), |
| 1716 | 'type' => Controls_Manager::COLOR, |
| 1717 | 'default' => '#101010', |
| 1718 | 'alpha' => false, |
| 1719 | 'selectors' => [ |
| 1720 | '{{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger):hover' => 'background: {{VALUE}} !important;', |
| 1721 | '{{WRAPPER}} .shopengine-archive-products .shopengine-independent-add-to-cart :is(a.button:not(.shopengine-quickview-trigger), a.added_to_cart.wc-forward):hover' => 'background: {{VALUE}} !important;', |
| 1722 | ], |
| 1723 | ] |
| 1724 | ); |
| 1725 | |
| 1726 | |
| 1727 | $this->end_controls_tab(); |
| 1728 | $this->end_controls_tabs(); |
| 1729 | |
| 1730 | $this->add_control( |
| 1731 | 'shopengine_archvie_btn_gap', |
| 1732 | [ |
| 1733 | 'label' => esc_html__('Button Gap', 'shopengine'), |
| 1734 | 'type' => Controls_Manager::SLIDER, |
| 1735 | 'range' => [ |
| 1736 | 'px' => [ |
| 1737 | 'min' => 0, |
| 1738 | 'max' => 30, |
| 1739 | 'step' => 1, |
| 1740 | ], |
| 1741 | ], |
| 1742 | 'size_units' => ['px'], |
| 1743 | 'selectors' => [ |
| 1744 | '{{WRAPPER}} .shopengine-archive-products.shopengine-hover-disable .products .product' => 'column-gap: {{SIZE}}{{UNIT}};', |
| 1745 | ], |
| 1746 | ] |
| 1747 | ); |
| 1748 | |
| 1749 | $this->end_controls_section(); // end ./ Button settings |
| 1750 | |
| 1751 | /* |
| 1752 | ============================== |
| 1753 | product rating |
| 1754 | ============================== |
| 1755 | */ |
| 1756 | $this->start_controls_section( |
| 1757 | 'shopengine_section_rating', |
| 1758 | [ |
| 1759 | 'label' => esc_html__('Rating', 'shopengine'), |
| 1760 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1761 | 'condition' => [ |
| 1762 | 'shopengine_archive_product_show_rating' => 'yes', |
| 1763 | ], |
| 1764 | ] |
| 1765 | ); |
| 1766 | |
| 1767 | $this->add_control( |
| 1768 | 'shopengine_product_start_color', |
| 1769 | [ |
| 1770 | 'label' => esc_html__('Color', 'shopengine'), |
| 1771 | 'type' => Controls_Manager::COLOR, |
| 1772 | 'default' => '#FEC42D', |
| 1773 | 'alpha' => false, |
| 1774 | 'selectors' => [ |
| 1775 | '{{WRAPPER}} .shopengine-archive-products .product .star-rating' => 'color: {{VALUE}};', |
| 1776 | ], |
| 1777 | ] |
| 1778 | ); |
| 1779 | |
| 1780 | $this->add_control( |
| 1781 | 'shopengine_product_start_size', |
| 1782 | [ |
| 1783 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1784 | 'type' => Controls_Manager::SLIDER, |
| 1785 | 'range' => [ |
| 1786 | 'px' => [ |
| 1787 | 'min' => 0, |
| 1788 | 'max' => 50, |
| 1789 | 'step' => 1, |
| 1790 | ], |
| 1791 | ], |
| 1792 | 'default' => [ |
| 1793 | 'unit' => 'px', |
| 1794 | 'size' => 11, |
| 1795 | ], |
| 1796 | 'selectors' => [ |
| 1797 | '{{WRAPPER}} .shopengine-archive-products .product .star-rating, {{WRAPPER}} .shopengine-product-rating-review-count' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1798 | ], |
| 1799 | ] |
| 1800 | ); |
| 1801 | |
| 1802 | $this->add_responsive_control( |
| 1803 | 'shopengine_product_rating_gap', |
| 1804 | [ |
| 1805 | 'label' => esc_html__('Star Gap (px)', 'shopengine'), |
| 1806 | 'type' => Controls_Manager::SLIDER, |
| 1807 | 'size_units' => ['px'], |
| 1808 | 'selectors' => [ |
| 1809 | '{{WRAPPER}} .shopengine-archive-products .star-rating' => 'letter-spacing: {{SIZE}}{{UNIT}}; width: calc(5.4em + (4 * {{SIZE}}{{UNIT}}));', |
| 1810 | '.rtl {{WRAPPER}} .shopengine-archive-products .star-rating' => 'letter-spacing: {{SIZE}}{{UNIT}}; width: calc(5.4em + ({{SIZE}} * {{SIZE}}{{UNIT}}));', |
| 1811 | ], |
| 1812 | ] |
| 1813 | ); |
| 1814 | |
| 1815 | $this->add_responsive_control( |
| 1816 | 'shopengine_product_star_padding', |
| 1817 | [ |
| 1818 | 'label' => esc_html__('Margin', 'shopengine'), |
| 1819 | 'type' => Controls_Manager::DIMENSIONS, |
| 1820 | 'size_units' => ['px'], |
| 1821 | 'selectors' => [ |
| 1822 | '{{WRAPPER}} .shopengine-archive-products .product .star-rating' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1823 | '.rtl {{WRAPPER}} .shopengine-archive-products .product .star-rating' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1824 | ], |
| 1825 | ] |
| 1826 | ); |
| 1827 | |
| 1828 | |
| 1829 | $this->end_controls_section(); // end ./ product rating |
| 1830 | |
| 1831 | |
| 1832 | /* |
| 1833 | ============================== |
| 1834 | Sale Fash |
| 1835 | ============================== |
| 1836 | */ |
| 1837 | $this->start_controls_section( |
| 1838 | 'shopengine_section_sale_flash', |
| 1839 | [ |
| 1840 | 'label' => esc_html__('Flash Sale', 'shopengine'), |
| 1841 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1842 | 'condition' => [ |
| 1843 | 'shopengine_show_sale_flash' => 'yes', |
| 1844 | ], |
| 1845 | ] |
| 1846 | ); |
| 1847 | |
| 1848 | $this->add_control( |
| 1849 | 'shopengine_sale_flash_color', |
| 1850 | [ |
| 1851 | 'label' => esc_html__('Color', 'shopengine'), |
| 1852 | 'type' => Controls_Manager::COLOR, |
| 1853 | 'default' => '#FFFFFF', |
| 1854 | 'alpha' => false, |
| 1855 | 'selectors' => [ |
| 1856 | '{{WRAPPER}} .shopengine-archive-products .onsale' => 'color: {{VALUE}};', |
| 1857 | ], |
| 1858 | ] |
| 1859 | ); |
| 1860 | |
| 1861 | $this->add_control( |
| 1862 | 'shopengine_sale_flash_bg_color', |
| 1863 | [ |
| 1864 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 1865 | 'type' => Controls_Manager::COLOR, |
| 1866 | 'alpha' => false, |
| 1867 | 'default' => '#4285F4', |
| 1868 | 'selectors' => [ |
| 1869 | '{{WRAPPER}} .shopengine-archive-products .onsale' => 'background-color: {{VALUE}};', |
| 1870 | ], |
| 1871 | ] |
| 1872 | ); |
| 1873 | |
| 1874 | $this->add_group_control( |
| 1875 | Group_Control_Typography::get_type(), |
| 1876 | [ |
| 1877 | 'name' => 'shopengine_sale_flash_typography', |
| 1878 | 'label' => esc_html__('Typography', 'shopengine'), |
| 1879 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .onsale', |
| 1880 | 'exclude' => ['font_family', 'font_style', 'letter_spacing', 'line_height', 'text_decoration'], |
| 1881 | 'fields_options' => [ |
| 1882 | 'typography' => [ |
| 1883 | 'default' => 'custom', |
| 1884 | ], |
| 1885 | 'font_weight' => [ |
| 1886 | 'default' => '500', |
| 1887 | ], |
| 1888 | 'font_size' => [ |
| 1889 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1890 | 'default' => [ |
| 1891 | 'size' => '14', |
| 1892 | 'unit' => 'px', |
| 1893 | ], |
| 1894 | 'size_units' => ['px'], |
| 1895 | ], |
| 1896 | 'text_transform' => [ |
| 1897 | 'default' => 'capitalize', |
| 1898 | ], |
| 1899 | ], |
| 1900 | ] |
| 1901 | ); |
| 1902 | |
| 1903 | |
| 1904 | $this->add_control( |
| 1905 | 'shopengine_use_fixed_size', |
| 1906 | [ |
| 1907 | 'label' => esc_html__('Use padding', 'shopengine'), |
| 1908 | 'type' => Controls_Manager::SWITCHER, |
| 1909 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 1910 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 1911 | 'return_value' => 'yes', |
| 1912 | 'default' => '', |
| 1913 | ] |
| 1914 | ); |
| 1915 | |
| 1916 | $this->add_control( |
| 1917 | 'shopengine_sale_flash_radius', |
| 1918 | [ |
| 1919 | 'label' => esc_html__('Border Radius', 'shopengine'), |
| 1920 | 'type' => Controls_Manager::DIMENSIONS, |
| 1921 | 'size_units' => ['%', 'px'], |
| 1922 | 'default' => [ |
| 1923 | 'top' => '50', |
| 1924 | 'right' => '50', |
| 1925 | 'bottom' => '50', |
| 1926 | 'left' => '50', |
| 1927 | 'unit' => '%', |
| 1928 | 'isLinked' => true, |
| 1929 | ], |
| 1930 | 'selectors' => [ |
| 1931 | '{{WRAPPER}} .shopengine-archive-products .onsale' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1932 | '.rtl {{WRAPPER}} .shopengine-archive-products .onsale' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1933 | ], |
| 1934 | ] |
| 1935 | ); |
| 1936 | |
| 1937 | $this->add_control( |
| 1938 | 'shopengine_sale_flash_paddng', |
| 1939 | [ |
| 1940 | 'label' => esc_html__('Padding', 'shopengine'), |
| 1941 | 'type' => Controls_Manager::DIMENSIONS, |
| 1942 | 'size_units' => ['px'], |
| 1943 | 'condition' => ['shopengine_use_fixed_size' => 'yes'], |
| 1944 | 'selectors' => [ |
| 1945 | '{{WRAPPER}} .shopengine-archive-products .onsale' => 'line-height:initial; min-height:auto; min-width:auto; padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1946 | '.rtl {{WRAPPER}} .shopengine-archive-products .onsale' => 'line-height:initial; min-height:auto; min-width:auto; padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1947 | ], |
| 1948 | ] |
| 1949 | ); |
| 1950 | |
| 1951 | $this->add_control( |
| 1952 | 'shopengine_sale_flash_sizee', |
| 1953 | [ |
| 1954 | 'label' => esc_html__('Size', 'shopengine'), |
| 1955 | 'type' => Controls_Manager::SLIDER, |
| 1956 | 'size_units' => ['px'], |
| 1957 | 'condition' => ['shopengine_use_fixed_size' => ''], |
| 1958 | 'range' => [ |
| 1959 | 'px' => [ |
| 1960 | 'min' => 0, |
| 1961 | 'max' => 300, |
| 1962 | 'step' => 1, |
| 1963 | ], |
| 1964 | ], |
| 1965 | 'default' => [ |
| 1966 | 'unit' => 'px', |
| 1967 | 'size' => 50, |
| 1968 | ], |
| 1969 | 'selectors' => [ |
| 1970 | '{{WRAPPER}} .shopengine-archive-products .onsale' => 'min-width:auto; min-height:auto;padding:0; text-align:center; line-height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 1971 | ], |
| 1972 | ] |
| 1973 | ); |
| 1974 | |
| 1975 | // Position |
| 1976 | $this->add_control( |
| 1977 | 'shopengine_sale_flash_pos', |
| 1978 | [ |
| 1979 | 'label' => esc_html__('Position', 'shopengine'), |
| 1980 | 'type' => Controls_Manager::CHOOSE, |
| 1981 | 'options' => [ |
| 1982 | 'left' => [ |
| 1983 | 'title' => esc_html__('Left', 'shopengine'), |
| 1984 | 'icon' => 'eicon-chevron-left', |
| 1985 | ], |
| 1986 | 'right' => [ |
| 1987 | 'title' => esc_html__('Right', 'shopengine'), |
| 1988 | 'icon' => 'eicon-chevron-right', |
| 1989 | ], |
| 1990 | ], |
| 1991 | 'default' => 'left', |
| 1992 | 'toggle' => false, |
| 1993 | 'separator' => 'before', |
| 1994 | ] |
| 1995 | ); |
| 1996 | |
| 1997 | $this->add_responsive_control( |
| 1998 | 'shopengine_sale_flash_position_horizontial', |
| 1999 | [ |
| 2000 | 'label' => esc_html__('Horizontal', 'shopengine'), |
| 2001 | 'type' => Controls_Manager::SLIDER, |
| 2002 | 'size_units' => ['px', '%'], |
| 2003 | 'range' => [ |
| 2004 | 'px' => [ |
| 2005 | 'max' => 400, |
| 2006 | ], |
| 2007 | ], |
| 2008 | 'default' => [ |
| 2009 | 'unit' => 'px', |
| 2010 | 'size' => 20, |
| 2011 | ], |
| 2012 | 'selectors' => [ |
| 2013 | '{{WRAPPER}} .shopengine-archive-products .onsale' => '{{shopengine_sale_flash_pos.VALUE}}: {{SIZE}}{{UNIT}};', |
| 2014 | ], |
| 2015 | ] |
| 2016 | ); |
| 2017 | |
| 2018 | $this->add_responsive_control( |
| 2019 | 'shopengine_sale_flash_position_vertical', |
| 2020 | [ |
| 2021 | 'label' => esc_html__('Vertical', 'shopengine'), |
| 2022 | 'type' => Controls_Manager::SLIDER, |
| 2023 | 'size_units' => ['px', '%'], |
| 2024 | 'range' => [ |
| 2025 | 'px' => [ |
| 2026 | 'max' => 400, |
| 2027 | ], |
| 2028 | ], |
| 2029 | 'default' => [ |
| 2030 | 'unit' => 'px', |
| 2031 | 'size' => 20, |
| 2032 | ], |
| 2033 | 'selectors' => [ |
| 2034 | '{{WRAPPER}} .shopengine-archive-products .onsale' => 'top: {{SIZE}}{{UNIT}};', |
| 2035 | ], |
| 2036 | ] |
| 2037 | ); |
| 2038 | |
| 2039 | $this->end_controls_section(); // end ./ Flash Sale |
| 2040 | |
| 2041 | /* |
| 2042 | ---------------------------- |
| 2043 | Button group |
| 2044 | ---------------------------- |
| 2045 | */ |
| 2046 | |
| 2047 | |
| 2048 | $this->start_controls_section( |
| 2049 | 'shopengine_section_button_group', |
| 2050 | [ |
| 2051 | 'label' => esc_html__('Button group', 'shopengine'), |
| 2052 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2053 | 'condition' => [ |
| 2054 | 'shopengine_group_btns' => 'yes', |
| 2055 | ], |
| 2056 | ] |
| 2057 | ); |
| 2058 | |
| 2059 | $this->add_control( |
| 2060 | 'shopengine_group_btns_over_image', |
| 2061 | [ |
| 2062 | 'label' => esc_html__('Show Full Image On Mobile', 'shopengine'), |
| 2063 | 'type' => Controls_Manager::SWITCHER, |
| 2064 | 'label_on' => esc_html__('Show', 'shopengine'), |
| 2065 | 'label_off' => esc_html__('Hide', 'shopengine'), |
| 2066 | 'return_value' => 'yes', |
| 2067 | 'default' => 'no', |
| 2068 | 'prefix_class' => 'shopengine-disable-group-btn-over-image-', |
| 2069 | ] |
| 2070 | ); |
| 2071 | |
| 2072 | $this->add_control( |
| 2073 | 'shopengine_button_group_position', |
| 2074 | [ |
| 2075 | 'label' => esc_html__('Position', 'shopengine'), |
| 2076 | 'type' => Controls_Manager::CHOOSE, |
| 2077 | 'options' => [ |
| 2078 | 'bottom' => [ |
| 2079 | 'title' => esc_html__('Bottom', 'shopengine'), |
| 2080 | 'icon' => 'eicon-v-align-bottom', |
| 2081 | ], |
| 2082 | 'top' => [ |
| 2083 | 'title' => esc_html__('Top', 'shopengine'), |
| 2084 | 'icon' => 'eicon-v-align-top', |
| 2085 | ], |
| 2086 | 'left-top' => [ |
| 2087 | 'title' => esc_html__('Left Top', 'shopengine'), |
| 2088 | 'icon' => 'eicon-text-align-left', |
| 2089 | ], |
| 2090 | 'left-center' => [ |
| 2091 | 'title' => esc_html__('Left Center', 'shopengine'), |
| 2092 | 'icon' => 'eicon-h-align-left', |
| 2093 | ], |
| 2094 | 'right-top' => [ |
| 2095 | 'title' => esc_html__('Right Top', 'shopengine'), |
| 2096 | 'icon' => 'eicon-text-align-right', |
| 2097 | ], |
| 2098 | 'right-center' => [ |
| 2099 | 'title' => esc_html__('Right Center', 'shopengine'), |
| 2100 | 'icon' => 'eicon-h-align-right', |
| 2101 | ], |
| 2102 | ], |
| 2103 | 'default' => 'bottom', |
| 2104 | 'toggle' => false, |
| 2105 | 'render_type' => 'template', |
| 2106 | 'frontend_available' => true, |
| 2107 | 'selectors' => [ |
| 2108 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns.loop-product--btns-pos-bottom .loop-product--btns-inner' => 'display: flex;', |
| 2109 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns.loop-product--btns-pos-top .loop-product--btns-inner' => 'display: flex;', |
| 2110 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns.loop-product--btns-pos-bottom .loop-product--btns-inner.shopengine-justify-content-center' => 'justify-content: center; display: flex;', |
| 2111 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns.loop-product--btns-pos-top .loop-product--btns-inner.shopengine-justify-content-center' => 'justify-content: center; display: flex;', |
| 2112 | ], |
| 2113 | ] |
| 2114 | ); |
| 2115 | |
| 2116 | $this->add_control( |
| 2117 | 'shopengine_button_group_btn_bg_clr', |
| 2118 | [ |
| 2119 | 'label' => esc_html__('Button Group Background color', 'shopengine'), |
| 2120 | 'type' => Controls_Manager::COLOR, |
| 2121 | 'default' => '#FFFFFF', |
| 2122 | 'selectors' => [ |
| 2123 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a, button, .button)' => 'background: {{VALUE}} !important;', |
| 2124 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a, button, .button):hover' => 'background: {{VALUE}} !important;', |
| 2125 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner' => 'background-color: {{VALUE}} !important;', |
| 2126 | ], |
| 2127 | ] |
| 2128 | ); |
| 2129 | |
| 2130 | $this->add_control( |
| 2131 | 'shopengine_button_group_btn_clr', |
| 2132 | [ |
| 2133 | 'label' => esc_html__('Color', 'shopengine'), |
| 2134 | 'type' => Controls_Manager::COLOR, |
| 2135 | 'default' => '#101010', |
| 2136 | 'selectors' => [ |
| 2137 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a:not(.shopengine-wishlist) :is(i, span, svg, path, a::before)' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2138 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner .shopengine-wishlist path' => 'color: {{VALUE}} !important;', |
| 2139 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.button:not(.shopengine-quickview-trigger)::before' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2140 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a i' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2141 | ], |
| 2142 | ] |
| 2143 | ); |
| 2144 | |
| 2145 | $this->add_control( |
| 2146 | 'shopengine_button_group_btn_hover_active_clr', |
| 2147 | [ |
| 2148 | 'label' => esc_html__('Hover and Active Color', 'shopengine'), |
| 2149 | 'type' => Controls_Manager::COLOR, |
| 2150 | 'default' => '#F03D3F', |
| 2151 | 'selectors' => [ |
| 2152 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a:not(.shopengine-wishlist):hover :is(i, span, svg, path, a::before)' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2153 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner .shopengine-wishlist:hover :is(i, span, svg, path, a::before)' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2154 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner .shopengine-wishlist:hover path' => 'color: {{VALUE}} !important;', |
| 2155 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.button:hover:not(.shopengine-quickview-trigger)::before' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2156 | |
| 2157 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.active:not(.shopengine-wishlist) :is(i, span, svg, path, a::before)' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2158 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner .shopengine-wishlist.active path' => 'fill:{{VALUE}} !important; color: {{VALUE}} !important;', |
| 2159 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.button.active:not(.shopengine-quickview-trigger)::before' => 'fill: {{VALUE}} !important; color: {{VALUE}} !important;', |
| 2160 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button):hover' => 'color: {{VALUE}} !important;', |
| 2161 | ], |
| 2162 | ] |
| 2163 | ); |
| 2164 | |
| 2165 | |
| 2166 | $this->add_control( |
| 2167 | 'shopengine_button_group_sbtn_bg_clr', |
| 2168 | [ |
| 2169 | 'label' => esc_html__('Button Background color', 'shopengine'), |
| 2170 | 'type' => Controls_Manager::COLOR, |
| 2171 | 'default' => '#FFFFFF', |
| 2172 | 'selectors' => [ |
| 2173 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'background: {{VALUE}} !important;', |
| 2174 | ], |
| 2175 | ] |
| 2176 | ); |
| 2177 | $this->add_control( |
| 2178 | 'shopengine_button_group_sbtn_hbg_clr', |
| 2179 | [ |
| 2180 | 'label' => esc_html__('Button Hover Background', 'shopengine'), |
| 2181 | 'type' => Controls_Manager::COLOR, |
| 2182 | 'default' => '#FFFFFF', |
| 2183 | 'selectors' => [ |
| 2184 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button):hover' => 'background: {{VALUE}} !important;', |
| 2185 | ], |
| 2186 | ] |
| 2187 | ); |
| 2188 | |
| 2189 | $this->add_group_control( |
| 2190 | Group_Control_Border::get_type(), |
| 2191 | [ |
| 2192 | 'name' => 'shopengine_button_group_sbtn_border', |
| 2193 | 'fields_options' => [ |
| 2194 | 'border' => [ |
| 2195 | ], |
| 2196 | 'width' => [ |
| 2197 | 'label' => esc_html__('Border Width', 'shopengine'), |
| 2198 | 'default' => [ |
| 2199 | 'top' => '0', |
| 2200 | 'right' => '0', |
| 2201 | 'bottom' => '0', |
| 2202 | 'left' => '0', |
| 2203 | ], |
| 2204 | 'selectors' => [ |
| 2205 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2206 | '.rtl {{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 2207 | ], |
| 2208 | ], |
| 2209 | 'color' => [ |
| 2210 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 2211 | ], |
| 2212 | ], |
| 2213 | 'selector' => '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)', |
| 2214 | ] |
| 2215 | ); |
| 2216 | |
| 2217 | $this->add_group_control( |
| 2218 | Group_Control_Border::get_type(), |
| 2219 | [ |
| 2220 | 'name' => 'shopengine_button_group_sbtn_border_hover', |
| 2221 | 'fields_options' => [ |
| 2222 | 'border' => [ |
| 2223 | 'label' => esc_html__('Hover Border Type', 'shopengine'), |
| 2224 | ], |
| 2225 | 'width' => [ |
| 2226 | 'label' => esc_html__('Border Width', 'shopengine'), |
| 2227 | 'default' => [ |
| 2228 | 'top' => '0', |
| 2229 | 'right' => '0', |
| 2230 | 'bottom' => '0', |
| 2231 | 'left' => '0', |
| 2232 | ], |
| 2233 | 'selectors' => [ |
| 2234 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button):hover' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2235 | '.rtl {{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button):hover' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 2236 | ], |
| 2237 | ], |
| 2238 | 'color' => [ |
| 2239 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 2240 | ], |
| 2241 | ], |
| 2242 | 'selector' => '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button):hover', |
| 2243 | ] |
| 2244 | ); |
| 2245 | |
| 2246 | $this->add_control( |
| 2247 | 'shopengine_button_group_btn_icon_size', |
| 2248 | [ |
| 2249 | 'label' => esc_html__('Icon size', 'shopengine'), |
| 2250 | 'type' => Controls_Manager::SLIDER, |
| 2251 | 'size_units' => ['px'], |
| 2252 | 'range' => [ |
| 2253 | 'px' => [ |
| 2254 | 'min' => 0, |
| 2255 | 'max' => 100, |
| 2256 | 'step' => 1, |
| 2257 | ], |
| 2258 | ], |
| 2259 | 'default' => [ |
| 2260 | 'unit' => 'px', |
| 2261 | 'size' => 18, |
| 2262 | ], |
| 2263 | 'selectors' => [ |
| 2264 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(svg)' => 'width: {{SIZE}}{{UNIT}} !important;', |
| 2265 | '{{WRAPPER}} .shopengine-widget .shopengine-archive-products .loop-product--btns :is(a, i)::before' => 'font-size: {{SIZE}}{{UNIT}} !important;', |
| 2266 | ], |
| 2267 | ] |
| 2268 | ); |
| 2269 | |
| 2270 | $this->add_control( |
| 2271 | 'shopengine_button_group_btn_padding', |
| 2272 | [ |
| 2273 | 'label' => esc_html__('Padding', 'shopengine'), |
| 2274 | 'type' => Controls_Manager::DIMENSIONS, |
| 2275 | 'size_units' => ['px'], |
| 2276 | 'default' => [ |
| 2277 | 'top' => '5', |
| 2278 | 'right' => '5', |
| 2279 | 'bottom' => '5', |
| 2280 | 'left' => '5', |
| 2281 | 'unit' => 'px', |
| 2282 | 'isLinked' => false, |
| 2283 | ], |
| 2284 | 'selectors' => [ |
| 2285 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 2286 | '.rtl {{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}} !important;', |
| 2287 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner a.shopengine-wishlist.badge' => 'margin-left: 0px !important;', |
| 2288 | ], |
| 2289 | ] |
| 2290 | ); |
| 2291 | |
| 2292 | $this->add_responsive_control( |
| 2293 | 'shopengine_button_group_radius', |
| 2294 | [ |
| 2295 | 'label' => esc_html__('Border Radius', 'shopengine'), |
| 2296 | 'type' => Controls_Manager::DIMENSIONS, |
| 2297 | 'size_units' => ['px', '%'], |
| 2298 | 'selectors' => [ |
| 2299 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 2300 | ], |
| 2301 | ] |
| 2302 | ); |
| 2303 | |
| 2304 | $this->add_responsive_control( |
| 2305 | 'shopengine_button_group_width', |
| 2306 | [ |
| 2307 | 'label' => esc_html__('Width', 'shopengine'), |
| 2308 | 'type' => Controls_Manager::SLIDER, |
| 2309 | 'size_units' => ['px'], |
| 2310 | 'range' => [ |
| 2311 | 'px' => [ |
| 2312 | 'min' => 0, |
| 2313 | 'max' => 100, |
| 2314 | ], |
| 2315 | ], |
| 2316 | 'selectors' => [ |
| 2317 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'width: {{SIZE}}{{UNIT}} !important;', |
| 2318 | ], |
| 2319 | ] |
| 2320 | ); |
| 2321 | |
| 2322 | $this->add_responsive_control( |
| 2323 | 'shopengine_button_group_height', |
| 2324 | [ |
| 2325 | 'label' => esc_html__('Height', 'shopengine'), |
| 2326 | 'type' => Controls_Manager::SLIDER, |
| 2327 | 'size_units' => ['px'], |
| 2328 | 'range' => [ |
| 2329 | 'px' => [ |
| 2330 | 'min' => 0, |
| 2331 | 'max' => 100, |
| 2332 | ], |
| 2333 | ], |
| 2334 | 'selectors' => [ |
| 2335 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner :is(a:not(.wc-forward), button, .button)' => 'height: {{SIZE}}{{UNIT}} !important;', |
| 2336 | ], |
| 2337 | ] |
| 2338 | ); |
| 2339 | |
| 2340 | |
| 2341 | $this->add_control( |
| 2342 | 'shopengine_button_group_gap', |
| 2343 | [ |
| 2344 | 'label' => esc_html__('Column Gap', 'shopengine'), |
| 2345 | 'type' => Controls_Manager::SLIDER, |
| 2346 | 'size_units' => ['px'], |
| 2347 | 'range' => [ |
| 2348 | 'px' => [ |
| 2349 | 'min' => 0, |
| 2350 | 'max' => 100, |
| 2351 | 'step' => 1, |
| 2352 | ], |
| 2353 | ], |
| 2354 | 'default' => [ |
| 2355 | 'unit' => 'px', |
| 2356 | 'size' => 10, |
| 2357 | ], |
| 2358 | 'selectors' => [ |
| 2359 | '{{WRAPPER}} .shopengine-archive-products ul li .loop-product--btns .loop-product--btns-inner' => 'column-gap: {{SIZE}}{{UNIT}} !important; row-gap: {{SIZE}}{{UNIT}} !important; gap: {{SIZE}}{{UNIT}} !important;', |
| 2360 | ], |
| 2361 | ] |
| 2362 | ); |
| 2363 | |
| 2364 | $this->end_controls_section(); |
| 2365 | // end button group |
| 2366 | /* |
| 2367 | ---------------------------- |
| 2368 | Button Tooltip |
| 2369 | ---------------------------- |
| 2370 | */ |
| 2371 | |
| 2372 | $this->start_controls_section( |
| 2373 | 'shopengine_section_button_tooltip', |
| 2374 | [ |
| 2375 | 'label' => esc_html__('Button Tooltip', 'shopengine'), |
| 2376 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2377 | ] |
| 2378 | ); |
| 2379 | |
| 2380 | $this->add_control( |
| 2381 | 'shopengine_tooltip_horizontal_position', |
| 2382 | [ |
| 2383 | 'label' => esc_html__('Horizontal Position', 'shopengine'), |
| 2384 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 2385 | 'size_units' => ['px', '%'], |
| 2386 | 'range' => [ |
| 2387 | 'px' => [ |
| 2388 | 'min' => -100, |
| 2389 | 'max' => 100, |
| 2390 | 'step' => 1, |
| 2391 | ], |
| 2392 | '%' => [ |
| 2393 | 'min' => -100, |
| 2394 | 'max' => 100, |
| 2395 | 'step' => 1, |
| 2396 | ], |
| 2397 | ], |
| 2398 | 'selectors' => [ |
| 2399 | '{{WRAPPER}} .shopengine-widget .shopengine-archive-mode-grid .tooltiptext' => 'bottom: {{SIZE}}{{UNIT}};', |
| 2400 | ], |
| 2401 | ] |
| 2402 | ); |
| 2403 | |
| 2404 | $this->add_control( |
| 2405 | 'shopengine_tooltip_vertical_position', |
| 2406 | [ |
| 2407 | 'label' => esc_html__('Vertical Position', 'shopengine'), |
| 2408 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 2409 | 'size_units' => ['px', '%'], |
| 2410 | 'range' => [ |
| 2411 | 'px' => [ |
| 2412 | 'min' => -100, |
| 2413 | 'max' => 100, |
| 2414 | 'step' => 1, |
| 2415 | ], |
| 2416 | '%' => [ |
| 2417 | 'min' => -100, |
| 2418 | 'max' => 100, |
| 2419 | 'step' => 1, |
| 2420 | ], |
| 2421 | ], |
| 2422 | 'selectors' => [ |
| 2423 | '{{WRAPPER}} .shopengine-widget .shopengine-archive-mode-grid .tooltiptext' => 'left: {{SIZE}}{{UNIT}};', |
| 2424 | '.rtl {{WRAPPER}} .shopengine-widget .shopengine-archive-mode-grid .tooltiptext' => 'right: {{SIZE}}{{UNIT}};', |
| 2425 | ], |
| 2426 | ] |
| 2427 | ); |
| 2428 | |
| 2429 | $this->add_control( |
| 2430 | 'shopengine_tooltip_text_color', |
| 2431 | [ |
| 2432 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 2433 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2434 | 'default' => '', |
| 2435 | 'selectors' => [ |
| 2436 | '{{WRAPPER}} .shopengine-widget .shopengine-archive-mode-grid .tooltiptext' => 'color: {{VALUE}}!important', |
| 2437 | ], |
| 2438 | ] |
| 2439 | ); |
| 2440 | |
| 2441 | $this->add_control( |
| 2442 | 'shopengine_tooltip_background_color', |
| 2443 | [ |
| 2444 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 2445 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 2446 | 'default' => '', |
| 2447 | 'selectors' => [ |
| 2448 | '{{WRAPPER}} .shopengine-widget .shopengine-archive-mode-grid .tooltiptext' => 'background-color: {{VALUE}}', |
| 2449 | '{{WRAPPER}} .shopengine-widget .shopengine-archive-mode-grid .tooltiptext::after' => 'border-color: {{VALUE}} transparent transparent transparent', |
| 2450 | ], |
| 2451 | ] |
| 2452 | ); |
| 2453 | $this->add_group_control( |
| 2454 | \Elementor\Group_Control_Typography::get_type(), |
| 2455 | [ |
| 2456 | 'name' => 'shopengine_tooltip_text_typography', |
| 2457 | 'selector' => '{{WRAPPER}} .shopengine-widget .shopengine-archive-mode-grid .tooltiptext', |
| 2458 | 'exclude' => ['font_family', 'letter_spacing', 'text_decoration', 'font_style','word_spacing'], |
| 2459 | 'fields_options' => [ |
| 2460 | 'typography' => [ |
| 2461 | 'default' => 'custom', |
| 2462 | ], |
| 2463 | 'font_weight' => [ |
| 2464 | 'default' => '', |
| 2465 | ], |
| 2466 | 'font_size' => [ |
| 2467 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 2468 | 'size_units' => ['px'], |
| 2469 | ], |
| 2470 | 'line_height' => [ |
| 2471 | 'label' => esc_html__('Line-height (px)', 'shopengine'), |
| 2472 | 'responsive' => false, |
| 2473 | 'size_units' => ['px'], |
| 2474 | ], |
| 2475 | ], |
| 2476 | ] |
| 2477 | |
| 2478 | ); |
| 2479 | |
| 2480 | $this->end_controls_section(); |
| 2481 | |
| 2482 | /** |
| 2483 | * Section: Pagination |
| 2484 | */ |
| 2485 | $this->start_controls_section( |
| 2486 | 'shopengine_section_style_pagination', |
| 2487 | [ |
| 2488 | 'label' => esc_html__('Pagination', 'shopengine'), |
| 2489 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2490 | ] |
| 2491 | ); |
| 2492 | $this->add_responsive_control( |
| 2493 | 'shopengine_pagi_align', |
| 2494 | [ |
| 2495 | 'label' => esc_html__('Alignment', 'shopengine'), |
| 2496 | 'type' => Controls_Manager::CHOOSE, |
| 2497 | 'options' => [ |
| 2498 | 'left' => [ |
| 2499 | 'title' => esc_html__('Left', 'shopengine'), |
| 2500 | 'icon' => 'eicon-text-align-left', |
| 2501 | ], |
| 2502 | 'center' => [ |
| 2503 | 'title' => esc_html__('Center', 'shopengine'), |
| 2504 | 'icon' => 'eicon-text-align-center', |
| 2505 | ], |
| 2506 | 'right' => [ |
| 2507 | 'title' => esc_html__('Right', 'shopengine'), |
| 2508 | 'icon' => 'eicon-text-align-right', |
| 2509 | ], |
| 2510 | ], |
| 2511 | 'selectors_dictionary' => [ |
| 2512 | 'left' => '-webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start;', |
| 2513 | 'center' => '-webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;', |
| 2514 | 'right' => '-webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end;', |
| 2515 | ], |
| 2516 | 'selectors' => [ |
| 2517 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul' => '{{VALUE}}', |
| 2518 | ], |
| 2519 | ] |
| 2520 | ); |
| 2521 | |
| 2522 | $this->add_group_control( |
| 2523 | Group_Control_Typography::get_type(), |
| 2524 | [ |
| 2525 | 'name' => 'shopengine_pagi_font', |
| 2526 | 'label' => esc_html__('Typography', 'shopengine'), |
| 2527 | 'exclude' => ['font_family', 'line_height', 'text_transform', 'text_decoration', 'text_transform', 'letter_spacing'], |
| 2528 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination', |
| 2529 | 'fields_options' => [ |
| 2530 | 'font_size' => [ |
| 2531 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 2532 | 'default' => [ |
| 2533 | 'size' => '16', |
| 2534 | 'unit' => 'px', |
| 2535 | ], |
| 2536 | 'size_units' => ['px'], |
| 2537 | ], |
| 2538 | ], |
| 2539 | ] |
| 2540 | ); |
| 2541 | |
| 2542 | $this->add_responsive_control( |
| 2543 | 'shopengine_pagi_top_space', |
| 2544 | [ |
| 2545 | 'label' => esc_html__('Top Spacing (px)', 'shopengine'), |
| 2546 | 'type' => Controls_Manager::SLIDER, |
| 2547 | 'size_units' => ['px'], |
| 2548 | 'selectors' => [ |
| 2549 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination' => 'padding-top: {{SIZE}}{{UNIT}};', |
| 2550 | ], |
| 2551 | ] |
| 2552 | ); |
| 2553 | |
| 2554 | $this->start_controls_tabs('shopengine_pagi_tabs'); |
| 2555 | $this->start_controls_tab( |
| 2556 | 'shopengine_pagi_tab_normal', |
| 2557 | [ |
| 2558 | 'label' => esc_html__('Normal', 'shopengine'), |
| 2559 | ] |
| 2560 | ); |
| 2561 | $this->add_control( |
| 2562 | 'shopengine_pagi_n_color', |
| 2563 | [ |
| 2564 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 2565 | 'type' => Controls_Manager::COLOR, |
| 2566 | 'alpha' => false, |
| 2567 | 'selectors' => [ |
| 2568 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination' => 'color: {{VALUE}};', |
| 2569 | ], |
| 2570 | ] |
| 2571 | ); |
| 2572 | |
| 2573 | $this->add_control( |
| 2574 | 'shopengine_pagi_n_bgcolor', |
| 2575 | [ |
| 2576 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 2577 | 'type' => Controls_Manager::COLOR, |
| 2578 | 'alpha' => false, |
| 2579 | 'selectors' => [ |
| 2580 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots)' => 'background: {{VALUE}};', |
| 2581 | ], |
| 2582 | ] |
| 2583 | ); |
| 2584 | |
| 2585 | $this->add_group_control( |
| 2586 | Group_Control_Border::get_type(), |
| 2587 | [ |
| 2588 | 'name' => 'shopengine_pagi_n_bd', |
| 2589 | 'label' => esc_html__('Border', 'shopengine'), |
| 2590 | 'selector' => '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots)', |
| 2591 | 'fields_options' => [ |
| 2592 | 'width' => [ |
| 2593 | 'selectors' => [ |
| 2594 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots)' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 2595 | '.rtl {{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots)' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}', |
| 2596 | ] |
| 2597 | ] |
| 2598 | ], |
| 2599 | ] |
| 2600 | ); |
| 2601 | $this->add_responsive_control( |
| 2602 | 'shopengine_pagi_radius', |
| 2603 | [ |
| 2604 | 'label' => esc_html__('Border Radius', 'shopengine'), |
| 2605 | 'type' => Controls_Manager::SLIDER, |
| 2606 | 'size_units' => ['px', '%'], |
| 2607 | 'selectors' => [ |
| 2608 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2609 | ], |
| 2610 | 'separator' => 'before', |
| 2611 | ] |
| 2612 | ); |
| 2613 | $this->end_controls_tab(); |
| 2614 | |
| 2615 | $this->start_controls_tab( |
| 2616 | 'shopengine_pagi_tab_active', |
| 2617 | [ |
| 2618 | 'label' => esc_html__('Hover', 'shopengine'), |
| 2619 | ] |
| 2620 | ); |
| 2621 | $this->add_control( |
| 2622 | 'shopengine_pagi_h_color', |
| 2623 | [ |
| 2624 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 2625 | 'type' => Controls_Manager::COLOR, |
| 2626 | 'alpha' => false, |
| 2627 | 'selectors' => [ |
| 2628 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:hover:not(.current)' => 'color: {{VALUE}};' |
| 2629 | ], |
| 2630 | ] |
| 2631 | ); |
| 2632 | |
| 2633 | $this->add_control( |
| 2634 | 'shopengine_pagi_h_bgcolor', |
| 2635 | [ |
| 2636 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 2637 | 'type' => Controls_Manager::COLOR, |
| 2638 | 'alpha' => false, |
| 2639 | 'selectors' => [ |
| 2640 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:not(.dots):hover:not(.current)' => 'background: {{VALUE}};' |
| 2641 | ], |
| 2642 | ] |
| 2643 | ); |
| 2644 | |
| 2645 | $this->add_control( |
| 2646 | 'shopengine_pagi_h_bdc', |
| 2647 | [ |
| 2648 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 2649 | 'type' => Controls_Manager::COLOR, |
| 2650 | 'alpha' => false, |
| 2651 | 'selectors' => [ |
| 2652 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current' => 'border-color: {{VALUE}};', |
| 2653 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers:hover' => 'border-color: {{VALUE}};', |
| 2654 | ], |
| 2655 | ] |
| 2656 | ); |
| 2657 | $this->end_controls_tab(); |
| 2658 | |
| 2659 | $this->start_controls_tab( |
| 2660 | 'shopengine_pagi_tab_hover', |
| 2661 | [ |
| 2662 | 'label' => esc_html__('Active', 'shopengine'), |
| 2663 | ] |
| 2664 | ); |
| 2665 | /** |
| 2666 | * style: Active button |
| 2667 | */ |
| 2668 | $this->add_control( |
| 2669 | 'shopengine_pagi_ab_color', |
| 2670 | [ |
| 2671 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 2672 | 'type' => Controls_Manager::COLOR, |
| 2673 | 'alpha' => false, |
| 2674 | 'selectors' => [ |
| 2675 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current' => 'color: {{VALUE}};', |
| 2676 | ], |
| 2677 | |
| 2678 | ] |
| 2679 | ); |
| 2680 | $this->add_control( |
| 2681 | 'shopengine_pagi_bh_bgcolor', |
| 2682 | [ |
| 2683 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 2684 | 'type' => Controls_Manager::COLOR, |
| 2685 | 'alpha' => false, |
| 2686 | 'selectors' => [ |
| 2687 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current' => 'background: {{VALUE}};', |
| 2688 | ], |
| 2689 | ] |
| 2690 | ); |
| 2691 | |
| 2692 | $this->add_control( |
| 2693 | 'shopengine_pagi_ab_bdc', |
| 2694 | [ |
| 2695 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 2696 | 'type' => Controls_Manager::COLOR, |
| 2697 | 'alpha' => false, |
| 2698 | 'selectors' => [ |
| 2699 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current' => 'border-color: {{VALUE}};', |
| 2700 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current:hover' => 'border-color: {{VALUE}};', |
| 2701 | ], |
| 2702 | ] |
| 2703 | ); |
| 2704 | |
| 2705 | $this->add_responsive_control( |
| 2706 | 'shopengine_pagi_ab_radius', |
| 2707 | [ |
| 2708 | 'label' => esc_html__('Border Radius', 'shopengine'), |
| 2709 | 'type' => Controls_Manager::SLIDER, |
| 2710 | 'size_units' => ['px', '%'], |
| 2711 | 'selectors' => [ |
| 2712 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers.current' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2713 | ], |
| 2714 | 'separator' => 'before', |
| 2715 | ] |
| 2716 | ); |
| 2717 | |
| 2718 | $this->end_controls_tab(); |
| 2719 | |
| 2720 | $this->end_controls_tabs(); |
| 2721 | |
| 2722 | $this->add_responsive_control( |
| 2723 | 'shopengine_pagi_mg', |
| 2724 | [ |
| 2725 | 'label' => esc_html__('Margin (px)', 'shopengine'), |
| 2726 | 'type' => Controls_Manager::DIMENSIONS, |
| 2727 | 'size_units' => ['px'], |
| 2728 | 'default' => [ |
| 2729 | 'top' => '10', |
| 2730 | 'right' => '10', |
| 2731 | 'bottom' => '0', |
| 2732 | 'left' => '0', |
| 2733 | 'isLinked' => false, |
| 2734 | ], |
| 2735 | 'selectors' => [ |
| 2736 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2737 | '.rtl {{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'margin: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 2738 | ], |
| 2739 | 'separator' => 'before', |
| 2740 | ] |
| 2741 | ); |
| 2742 | |
| 2743 | $this->add_responsive_control( |
| 2744 | 'shopengine_pagi_pd', |
| 2745 | [ |
| 2746 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 2747 | 'type' => Controls_Manager::DIMENSIONS, |
| 2748 | 'size_units' => ['px'], |
| 2749 | 'selectors' => [ |
| 2750 | '{{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; min-width: 0;', |
| 2751 | '.rtl {{WRAPPER}} .shopengine-archive-products .woocommerce-pagination > ul > li > .page-numbers' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}; min-width: 0;', |
| 2752 | ], |
| 2753 | ] |
| 2754 | ); |
| 2755 | |
| 2756 | $this->end_controls_section(); |
| 2757 | |
| 2758 | |
| 2759 | /** |
| 2760 | * Section: Global Font |
| 2761 | */ |
| 2762 | $this->start_controls_section( |
| 2763 | 'shopengine_section_style_global', |
| 2764 | [ |
| 2765 | 'label' => esc_html__('Global Font', 'shopengine'), |
| 2766 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2767 | ] |
| 2768 | ); |
| 2769 | $this->add_control( |
| 2770 | 'shopengine_archive_products_font_family', |
| 2771 | [ |
| 2772 | 'label' => esc_html__('Font Family', 'shopengine'), |
| 2773 | 'description' => esc_html__('This font family is set for this specific widget.', 'shopengine'), |
| 2774 | 'type' => Controls_Manager::FONT, |
| 2775 | 'selectors' => [ |
| 2776 | '{{WRAPPER}} .shopengine-archive-products .product-categories > li, |
| 2777 | {{WRAPPER}} .shopengine-archive-products .product .woocommerce-loop-product__title, |
| 2778 | {{WRAPPER}} .shopengine-archive-products .product .price .amount, |
| 2779 | {{WRAPPER}} .shopengine-archive-products .product a.button:not(.shopengine-quickview-trigger), |
| 2780 | {{WRAPPER}} .shopengine-archive-products .onsale, |
| 2781 | {{WRAPPER}} .shopengine-archive-products .woocommerce-pagination, |
| 2782 | {{WRAPPER}} .shopengine-archive-products .product .shopengine-product-excerpt' => 'font-family: {{VALUE}};', |
| 2783 | ], |
| 2784 | ] |
| 2785 | ); |
| 2786 | $this->end_controls_section(); |
| 2787 | } |
| 2788 | |
| 2789 | /** |
| 2790 | * Returns CSS hide classes based on per-button visibility settings. |
| 2791 | * Used by show_product_action_btns() and render_footer_action_btns(). |
| 2792 | */ |
| 2793 | private function get_button_hide_classes() |
| 2794 | { |
| 2795 | $settings = $this->get_settings_for_display(); |
| 2796 | $classes = []; |
| 2797 | if (($settings['shopengine_show_wishlist'] ?? 'yes') !== 'yes') $classes[] = 'se-hide-wishlist'; |
| 2798 | if (($settings['shopengine_show_quickview'] ?? 'yes') !== 'yes') $classes[] = 'se-hide-quickview'; |
| 2799 | if (($settings['shopengine_show_add_to_cart'] ?? 'yes') !== 'yes') $classes[] = 'se-hide-add-to-cart'; |
| 2800 | if (($settings['shopengine_show_comparison'] ?? 'yes') !== 'yes') $classes[] = 'se-hide-comparison'; |
| 2801 | if (($settings['shopengine_show_direct_checkout'] ?? 'yes') !== 'yes') $classes[] = 'se-hide-direct-checkout'; |
| 2802 | return implode(' ', $classes); |
| 2803 | } |
| 2804 | |
| 2805 | /** |
| 2806 | * Renders footer action buttons (non-group-btn context). |
| 2807 | * Per-button visibility is handled by CSS hide classes on the wrapper. |
| 2808 | * Visual order is controlled via generate_order_item_css() CSS. |
| 2809 | */ |
| 2810 | public function render_footer_action_btns() |
| 2811 | { |
| 2812 | woocommerce_template_loop_add_to_cart(); |
| 2813 | } |
| 2814 | |
| 2815 | /** |
| 2816 | * Product Action Buttons |
| 2817 | */ |
| 2818 | public function open_product_thumb_wrap() |
| 2819 | { |
| 2820 | echo '<div class="shopengine-product-thumb-wrap">'; |
| 2821 | } |
| 2822 | |
| 2823 | public function show_product_action_btns() |
| 2824 | { |
| 2825 | $settings = $this->get_settings_for_display(); |
| 2826 | $data_attr = apply_filters('shopengine/group_btns/optional_tooltip_data_attr', ''); |
| 2827 | |
| 2828 | global $product; |
| 2829 | if (empty($product) || !($product instanceof \WC_Product)) { |
| 2830 | $product = wc_get_product(get_the_ID()); |
| 2831 | } |
| 2832 | if (empty($product)) { |
| 2833 | woocommerce_template_loop_product_link_close(); |
| 2834 | echo '</div>'; |
| 2835 | woocommerce_template_loop_product_link_open(); |
| 2836 | return; |
| 2837 | } |
| 2838 | |
| 2839 | $position = $settings['shopengine_button_group_position'] ?? 'bottom'; |
| 2840 | if ($position === 'left') $position = 'left-center'; |
| 2841 | if ($position === 'right') $position = 'right-center'; |
| 2842 | if (!in_array($position, ['bottom', 'top', 'left-top', 'left-center', 'right-top', 'right-center'], true)) { |
| 2843 | $position = 'bottom'; |
| 2844 | } |
| 2845 | |
| 2846 | $hide_classes = $this->get_button_hide_classes(); |
| 2847 | |
| 2848 | woocommerce_template_loop_product_link_close(); |
| 2849 | ?> |
| 2850 | <div class="loop-product--btns loop-product--btns-pos-<?php echo sanitize_html_class($position); ?> <?php echo esc_attr($hide_classes); ?>" <?php echo esc_attr($data_attr); ?>> |
| 2851 | <div class="loop-product--btns-inner shopengine-justify-content-center"> |
| 2852 | <?php woocommerce_template_loop_add_to_cart(); ?> |
| 2853 | </div> |
| 2854 | </div> |
| 2855 | </div> |
| 2856 | <?php |
| 2857 | woocommerce_template_loop_product_link_open(); |
| 2858 | } |
| 2859 | |
| 2860 | /** |
| 2861 | * Empty Product Rating |
| 2862 | */ |
| 2863 | public function show_empty_product_rating($html, $ratings, $count) |
| 2864 | { |
| 2865 | if ('0' === $ratings) : |
| 2866 | $html = '<div class="star-rating"></div>'; |
| 2867 | endif; |
| 2868 | |
| 2869 | global $product; |
| 2870 | |
| 2871 | $review_count = $product->get_review_count(); |
| 2872 | |
| 2873 | return '<div class="woocommerce-product-rating">' . $html . '<span class="shopengine-product-rating-review-count">(' . $review_count . ')</span></div>'; |
| 2874 | } |
| 2875 | |
| 2876 | /** |
| 2877 | * Product Categories |
| 2878 | */ |
| 2879 | public function show_product_cats() |
| 2880 | { |
| 2881 | $settings = $this->get_settings_for_display(); |
| 2882 | $terms = get_the_terms(get_the_ID(), 'product_cat'); |
| 2883 | |
| 2884 | if (empty($terms)) { |
| 2885 | return false; |
| 2886 | } |
| 2887 | |
| 2888 | $terms_count = count($terms); |
| 2889 | |
| 2890 | if ($terms_count > 0) { |
| 2891 | echo '<ul class="product-categories">'; |
| 2892 | foreach ($terms as $key => $term) { |
| 2893 | if ($settings['shopengine_cats_max'] === $key) { |
| 2894 | break; |
| 2895 | } |
| 2896 | |
| 2897 | echo '<li><span>' . esc_html($term->name) . '</span></li>'; |
| 2898 | } |
| 2899 | echo '</ul>'; |
| 2900 | } |
| 2901 | } |
| 2902 | |
| 2903 | private function generate_product_info_order_css($order_items) |
| 2904 | { |
| 2905 | $parent = '.elementor-element-' . $this->get_id() . ' .shopengine-archive-products'; |
| 2906 | |
| 2907 | $styles = $parent . ' .product a.woocommerce-LoopProduct-link { display: flex !important; flex-direction: column; }'; |
| 2908 | $styles .= $parent . ' .product .shopengine-product-description-footer { order: 999; }'; |
| 2909 | |
| 2910 | foreach ($order_items as $key => $item) { |
| 2911 | $order_number = $key + 1; |
| 2912 | switch ($item['list_key']) { |
| 2913 | case 'title': |
| 2914 | $styles .= $parent . ' .product .woocommerce-loop-product__title { order: ' . $order_number . '; }'; |
| 2915 | break; |
| 2916 | case 'price': |
| 2917 | $styles .= $parent . ' .product .price { order: ' . $order_number . '; }'; |
| 2918 | break; |
| 2919 | case 'rating': |
| 2920 | $styles .= $parent . ' .product .woocommerce-product-rating { order: ' . $order_number . '; }'; |
| 2921 | break; |
| 2922 | } |
| 2923 | } |
| 2924 | |
| 2925 | echo '<style>'; |
| 2926 | shopengine_content_render($styles); |
| 2927 | echo '</style>'; |
| 2928 | } |
| 2929 | |
| 2930 | private function generate_order_item_css($order_items) |
| 2931 | { |
| 2932 | $styles = ''; |
| 2933 | $parent_class = '.elementor-element-' . $this->get_id(); |
| 2934 | |
| 2935 | foreach ($order_items as $key => $item) { |
| 2936 | $order_number = $key + 1; |
| 2937 | switch ($item['list_key']) { |
| 2938 | case 'add-to-cart': |
| 2939 | $styles .= $parent_class . ' .shopengine-archive-products a.add_to_cart_button {order: ' . $order_number . ';}'; |
| 2940 | $styles .= $parent_class . ' .shopengine-archive-products a.product_type_variable {order: ' . $order_number . ';}'; |
| 2941 | $styles .= $parent_class . ' .shopengine-archive-products a.product_type_grouped {order: ' . $order_number . ';}'; |
| 2942 | $styles .= $parent_class . ' .shopengine-archive-products a.product_type_external {order: ' . $order_number . ';}'; |
| 2943 | break; |
| 2944 | case 'wishlist': |
| 2945 | $styles .= $parent_class . ' .shopengine-archive-products .shopengine-wishlist {order: ' . $order_number . ';}'; |
| 2946 | break; |
| 2947 | case 'comparison': |
| 2948 | $styles .= $parent_class . ' .shopengine-archive-products .shopengine-comparison {order: ' . $order_number . ';}'; |
| 2949 | break; |
| 2950 | case 'quick-view': |
| 2951 | $styles .= $parent_class . ' .shopengine-archive-products .shopengine-quickview-trigger {order: ' . $order_number . ';}'; |
| 2952 | break; |
| 2953 | case 'direct-checkout': |
| 2954 | $styles .= $parent_class . ' .shopengine-archive-products a.shopengine_direct_checkout {order: ' . $order_number . ';}'; |
| 2955 | break; |
| 2956 | } |
| 2957 | } |
| 2958 | echo '<style>'; |
| 2959 | shopengine_content_render($styles); |
| 2960 | echo '</style>'; |
| 2961 | } |
| 2962 | |
| 2963 | protected function screen() |
| 2964 | { |
| 2965 | |
| 2966 | $settings = $this->get_settings_for_display(); |
| 2967 | extract($settings); |
| 2968 | |
| 2969 | if (!empty($shopengine_custom_ordering_list)) { |
| 2970 | $this->generate_order_item_css($shopengine_custom_ordering_list); |
| 2971 | } |
| 2972 | |
| 2973 | if (($shopengine_enable_product_info_ordering ?? '') === 'yes' && !empty($shopengine_product_info_ordering_list)) { |
| 2974 | $this->generate_product_info_order_css($shopengine_product_info_ordering_list); |
| 2975 | } |
| 2976 | |
| 2977 | $post_type = get_post_type(); |
| 2978 | |
| 2979 | if (WC()->session && function_exists('wc_print_notices')) { |
| 2980 | wc_print_notices(); |
| 2981 | } |
| 2982 | |
| 2983 | remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); |
| 2984 | |
| 2985 | |
| 2986 | /** |
| 2987 | * Show Action Buttons |
| 2988 | */ |
| 2989 | if ($shopengine_group_btns === 'yes') { |
| 2990 | |
| 2991 | add_action('woocommerce_before_shop_loop_item', [$this, 'open_product_thumb_wrap'], 9); |
| 2992 | |
| 2993 | add_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_action_btns']); |
| 2994 | } |
| 2995 | |
| 2996 | |
| 2997 | /** |
| 2998 | * Show Categories |
| 2999 | */ |
| 3000 | if ($shopengine_is_cats === 'yes') { |
| 3001 | add_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_cats']); |
| 3002 | } |
| 3003 | |
| 3004 | /** |
| 3005 | * Show Empty Rating |
| 3006 | */ |
| 3007 | add_filter('woocommerce_product_get_rating_html', [$this, 'show_empty_product_rating'], 99, 3); |
| 3008 | |
| 3009 | $tpl = Products::instance()->get_widget_template($this->get_name()); |
| 3010 | |
| 3011 | $settings_to_pass = compact('shopengine_group_btns', 'shopengine_is_cats', 'shopengine_pagination_style', 'shopengine_is_details', 'shopengine_is_hover_details', 'shopengine_archive_product_title_header_size', 'shopengine_title_excerpt_enable', 'shopengine_title_excerpt_length', 'shopengine_independent_add_to_cart', 'shopengine_independent_add_to_cart_position'); |
| 3012 | |
| 3013 | include $tpl; |
| 3014 | |
| 3015 | |
| 3016 | /** |
| 3017 | * Reset Filters to Default. |
| 3018 | */ |
| 3019 | if ($shopengine_group_btns === 'yes') { |
| 3020 | remove_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_action_btns']); |
| 3021 | remove_action('woocommerce_before_shop_loop_item', [$this, 'open_product_thumb_wrap'], 9); |
| 3022 | } |
| 3023 | |
| 3024 | add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); |
| 3025 | |
| 3026 | if ($shopengine_is_cats === 'yes') { |
| 3027 | remove_filter('woocommerce_before_shop_loop_item_title', [$this, 'show_product_cats']); |
| 3028 | } |
| 3029 | |
| 3030 | remove_filter('woocommerce_product_get_rating_html', [$this, 'show_empty_product_rating'], 99); |
| 3031 | } |
| 3032 | } |
| 3033 |