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