cart-table.php
1274 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Elementor; |
| 4 | |
| 5 | defined('ABSPATH') || exit; |
| 6 | |
| 7 | use ShopEngine\Widgets\Products; |
| 8 | |
| 9 | class ShopEngine_Cart_Table extends \ShopEngine\Base\Widget { |
| 10 | |
| 11 | public function config() { |
| 12 | return new ShopEngine_Cart_Table_Config(); |
| 13 | } |
| 14 | |
| 15 | |
| 16 | protected function register_controls() { |
| 17 | |
| 18 | /* |
| 19 | * Setting Tab - Content |
| 20 | */ |
| 21 | $this->start_controls_section( |
| 22 | 'shopengine_section_cart_table_general', |
| 23 | [ |
| 24 | 'label' => esc_html__('General', 'shopengine'), |
| 25 | 'type' => Controls_Manager::TAB_SETTINGS, |
| 26 | ] |
| 27 | ); |
| 28 | |
| 29 | $this->add_control( |
| 30 | 'shopengine_cart_table_footer__buttons', |
| 31 | [ |
| 32 | 'label' => esc_html__('Buttons', 'shopengine'), |
| 33 | 'type' => Controls_Manager::HEADING, |
| 34 | 'separator' => 'before', |
| 35 | ] |
| 36 | ); |
| 37 | |
| 38 | $this->add_control( |
| 39 | 'show_continue_shopping', |
| 40 | [ |
| 41 | 'label' => esc_html__('Hide Continue Shopping Button?', 'shopengine'), |
| 42 | 'type' => Controls_Manager::SWITCHER, |
| 43 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 44 | 'label_off' => esc_html__('No', 'shopengine'), |
| 45 | 'return_value' => 'none', |
| 46 | 'default' => 'inline-block', |
| 47 | 'selectors' => [ |
| 48 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .return-to-shop' => 'display: {{VALUE}};' |
| 49 | ], |
| 50 | ] |
| 51 | ); |
| 52 | |
| 53 | $this->add_control( |
| 54 | 'show_clear_all', |
| 55 | [ |
| 56 | 'label' => esc_html__('Hide Clear All Button?', 'shopengine'), |
| 57 | 'type' => Controls_Manager::SWITCHER, |
| 58 | 'label_on' => esc_html__('Yes', 'shopengine'), |
| 59 | 'label_off' => esc_html__('No', 'shopengine'), |
| 60 | 'return_value' => 'none', |
| 61 | 'default' => 'inline-block', |
| 62 | 'selectors' => [ |
| 63 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer button[name=empty_cart]' => 'display: {{VALUE}};' |
| 64 | ], |
| 65 | ] |
| 66 | ); |
| 67 | |
| 68 | $this->end_controls_section(); |
| 69 | |
| 70 | $this->start_controls_section( |
| 71 | 'shopengine_section_cart_table_content', |
| 72 | [ |
| 73 | 'label' => esc_html__('Content', 'shopengine'), |
| 74 | 'type' => Controls_Manager::TAB_SETTINGS, |
| 75 | ] |
| 76 | ); |
| 77 | |
| 78 | $this->add_control( |
| 79 | 'shopengine_cart_table_title', |
| 80 | [ |
| 81 | 'label' => esc_html__('Title', 'shopengine'), |
| 82 | 'type' => Controls_Manager::TEXT, |
| 83 | 'default' => esc_html__('Product Name', 'shopengine') |
| 84 | ] |
| 85 | ); |
| 86 | |
| 87 | $this->add_control( |
| 88 | 'shopengine_cart_table_price', |
| 89 | [ |
| 90 | 'label' => esc_html__('Price', 'shopengine'), |
| 91 | 'type' => Controls_Manager::TEXT, |
| 92 | 'default' => esc_html__('Price', 'shopengine') |
| 93 | ] |
| 94 | ); |
| 95 | |
| 96 | $this->add_control( |
| 97 | 'shopengine_cart_table_quantity', |
| 98 | [ |
| 99 | 'label' => esc_html__('Quantity', 'shopengine'), |
| 100 | 'type' => Controls_Manager::TEXT, |
| 101 | 'default' => esc_html__('Quantity', 'shopengine') |
| 102 | ] |
| 103 | ); |
| 104 | |
| 105 | $this->add_control( |
| 106 | 'shopengine_cart_table_subtotal', |
| 107 | [ |
| 108 | 'label' => esc_html__('Subtotal', 'shopengine'), |
| 109 | 'type' => Controls_Manager::TEXT, |
| 110 | 'default' => esc_html__('Subtotal', 'shopengine') |
| 111 | ] |
| 112 | ); |
| 113 | |
| 114 | $this->add_control( |
| 115 | 'shopengine_cart_continue_shopping_btn', |
| 116 | [ |
| 117 | 'label' => esc_html__('Continue Shopping', 'shopengine'), |
| 118 | 'type' => Controls_Manager::TEXT, |
| 119 | 'default' => esc_html__('Continue Shopping', 'shopengine') |
| 120 | ] |
| 121 | ); |
| 122 | |
| 123 | $this->add_control( |
| 124 | 'shopengine_cart_table_update', |
| 125 | [ |
| 126 | 'label' => esc_html__('Update Cart', 'shopengine'), |
| 127 | 'type' => Controls_Manager::TEXT, |
| 128 | 'default' => esc_html__('Update Cart', 'shopengine') |
| 129 | ] |
| 130 | ); |
| 131 | |
| 132 | $this->add_control( |
| 133 | 'shopengine_cart_table_clear_all', |
| 134 | [ |
| 135 | 'label' => esc_html__('Clear All', 'shopengine'), |
| 136 | 'type' => Controls_Manager::TEXT, |
| 137 | 'default' => esc_html__('Clear All', 'shopengine') |
| 138 | ] |
| 139 | ); |
| 140 | |
| 141 | $this->end_controls_section(); |
| 142 | |
| 143 | /* |
| 144 | ============================== |
| 145 | Style Tab - Cart Table Header |
| 146 | ============================= |
| 147 | */ |
| 148 | $this->start_controls_section( |
| 149 | 'shopengine_section__cart_table_head', |
| 150 | [ |
| 151 | 'label' => esc_html__('Table Header', 'shopengine'), |
| 152 | 'tab' => Controls_Manager::TAB_STYLE, |
| 153 | ] |
| 154 | ); |
| 155 | |
| 156 | $this->add_control( |
| 157 | 'shopengine_cart_table_head__bg_color', |
| 158 | [ |
| 159 | 'label' => esc_html__( 'Background Color', 'shopengine' ), |
| 160 | 'type' => Controls_Manager::COLOR, |
| 161 | 'alpha' => false, |
| 162 | 'default' => '#F2F2F2', |
| 163 | 'alpha' => false, |
| 164 | 'selectors' => [ |
| 165 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__head' => 'background-color: {{VALUE}};', |
| 166 | ], |
| 167 | ] |
| 168 | ); |
| 169 | |
| 170 | $this->add_control( |
| 171 | 'shopengine_cart_table_head__color', |
| 172 | [ |
| 173 | 'label' => esc_html__( 'Text Color', 'shopengine' ), |
| 174 | 'type' => Controls_Manager::COLOR, |
| 175 | 'alpha' => false, |
| 176 | 'default' => '#3a3a3a', |
| 177 | 'alpha' => false, |
| 178 | 'selectors' => [ |
| 179 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__head div' => 'color: {{VALUE}};', |
| 180 | ], |
| 181 | ] |
| 182 | ); |
| 183 | |
| 184 | $this->add_group_control( |
| 185 | Group_Control_Typography::get_type(), |
| 186 | array( |
| 187 | 'name' => 'shopengine_cart_table_head_typography', |
| 188 | 'label' => esc_html__('Typography', 'shopengine'), |
| 189 | 'name' => 'shopengine_cart_table_head_typography', |
| 190 | 'label' => esc_html__('Typography', 'shopengine'), |
| 191 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__head div', |
| 192 | 'exclude' => ['font_style', 'text_decoration', 'font_family'], |
| 193 | 'fields_options' => [ |
| 194 | 'typography' => [ |
| 195 | 'default' => 'custom', |
| 196 | ], |
| 197 | 'font_weight' => [ |
| 198 | 'default' => '600', |
| 199 | ], |
| 200 | 'font_size' => [ |
| 201 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 202 | 'default' => [ |
| 203 | 'size' => '16', |
| 204 | 'unit' => 'px' |
| 205 | ], |
| 206 | 'size_units' => ['px'] |
| 207 | ], |
| 208 | 'text_transform' => [ |
| 209 | 'default' => 'capitalize', |
| 210 | ], |
| 211 | 'line_height' => [ |
| 212 | 'label' => esc_html__('Line-Height (px)', 'shopengine'), |
| 213 | 'default' => [ |
| 214 | 'size' => '19', |
| 215 | 'unit' => 'px' |
| 216 | ], |
| 217 | 'size_units' => ['px'] |
| 218 | ], |
| 219 | 'letter_spacing' => [ |
| 220 | 'default' => [ |
| 221 | 'size' => '0', |
| 222 | ] |
| 223 | ], |
| 224 | ], |
| 225 | ) |
| 226 | ); |
| 227 | |
| 228 | $this->add_responsive_control( |
| 229 | 'shopengine_cart_table_head__padding', |
| 230 | [ |
| 231 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 232 | 'type' => Controls_Manager::DIMENSIONS, |
| 233 | 'size_units' => ['px'], |
| 234 | 'default' => [ |
| 235 | 'top' => '12', |
| 236 | 'right' => '40', |
| 237 | 'bottom' => '12', |
| 238 | 'left' => '40', |
| 239 | 'unit' => 'px', |
| 240 | 'isLinked' => false, |
| 241 | ], |
| 242 | 'selectors' => [ |
| 243 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__head' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 244 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__head' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 245 | ], |
| 246 | 'separator' => 'before', |
| 247 | ] |
| 248 | ); |
| 249 | |
| 250 | $this->add_group_control( |
| 251 | Group_Control_Border::get_type(), |
| 252 | [ |
| 253 | 'name' => 'shopengine_cart_table_head__border', |
| 254 | 'label' => esc_html__('Border', 'shopengine'), |
| 255 | 'fields_options' => [ |
| 256 | 'border' => [ |
| 257 | 'default' => 'solid', |
| 258 | ], |
| 259 | 'width' => [ |
| 260 | 'default' => [ |
| 261 | 'top' => '1', |
| 262 | 'right' => '1', |
| 263 | 'bottom' => '1', |
| 264 | 'left' => '1', |
| 265 | 'isLinked' => true, |
| 266 | ], |
| 267 | 'selectors' => [ |
| 268 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__head' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 269 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__head' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}', |
| 270 | ] |
| 271 | ], |
| 272 | 'color' => [ |
| 273 | 'default' => '#f2f2f2' |
| 274 | ] |
| 275 | ], |
| 276 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__head', |
| 277 | 'separator' => 'before' |
| 278 | ] |
| 279 | ); |
| 280 | |
| 281 | $this->end_controls_section(); // end ./ Style Tab - Cart Table Header |
| 282 | |
| 283 | /* |
| 284 | =============================== |
| 285 | Style Tab - Cart Table Body |
| 286 | =============================== |
| 287 | */ |
| 288 | |
| 289 | $this->start_controls_section( |
| 290 | 'shopengine_section__cart_table_content', |
| 291 | [ |
| 292 | 'label' => esc_html__('Table Body', 'shopengine'), |
| 293 | 'tab' => Controls_Manager::TAB_STYLE, |
| 294 | ] |
| 295 | ); |
| 296 | |
| 297 | $this->add_control( |
| 298 | 'shopengine_cart_table_single_cart_item_bg', |
| 299 | [ |
| 300 | 'label' => esc_html__('Background', 'shopengine'), |
| 301 | 'type' => Controls_Manager::COLOR, |
| 302 | 'alpha' => false, |
| 303 | 'default' => '#ffffff', |
| 304 | 'alpha' => false, |
| 305 | 'selectors' => [ |
| 306 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body' => 'background: {{VALUE}};', |
| 307 | ], |
| 308 | ] |
| 309 | ); |
| 310 | |
| 311 | |
| 312 | $this->add_control( |
| 313 | 'shopengine_cart_table_content__text_color', |
| 314 | [ |
| 315 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 316 | 'type' => Controls_Manager::COLOR, |
| 317 | 'default' => '#979797', |
| 318 | 'alpha' => false, |
| 319 | 'selectors' => [ |
| 320 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body :is(.shopengine-table__body-item--td, div, a, span)' => 'color: {{VALUE}};' |
| 321 | ], |
| 322 | ] |
| 323 | ); |
| 324 | |
| 325 | $this->add_control( |
| 326 | 'shopengine_cart_table_border_color', |
| 327 | [ |
| 328 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 329 | 'type' => Controls_Manager::COLOR, |
| 330 | 'default' => '#F2F2F2', |
| 331 | 'alpha' => false, |
| 332 | 'selectors' => [ |
| 333 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body' => 'border-style: solid; border-width: 0 1px 1px 1px; border-color: {{VALUE}};' |
| 334 | ], |
| 335 | ] |
| 336 | ); |
| 337 | |
| 338 | $this->add_control( |
| 339 | 'shopengine_cart_table_content__text_hover_color', |
| 340 | [ |
| 341 | 'label' => esc_html__('Link Hover Color', 'shopengine'), |
| 342 | 'type' => Controls_Manager::COLOR, |
| 343 | 'alpha' => false, |
| 344 | 'default' => '#979797', |
| 345 | 'alpha' => false, |
| 346 | 'selectors' => [ |
| 347 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .shopengine-table__body-item--td a:hover' => 'color: {{VALUE}};', |
| 348 | ], |
| 349 | ] |
| 350 | ); |
| 351 | |
| 352 | $this->add_control( |
| 353 | 'shopengine_cart_table_content__price_color', |
| 354 | [ |
| 355 | 'label' => esc_html__('Price Color', 'shopengine'), |
| 356 | 'type' => Controls_Manager::COLOR, |
| 357 | 'alpha' => false, |
| 358 | 'default' => '#222222', |
| 359 | 'alpha' => false, |
| 360 | 'selectors' => [ |
| 361 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .shopengine-table__body-item--td .amount :is(span, bdi)' => 'color: {{VALUE}};', |
| 362 | '{{WRAPPER}} .shopengine-cart-table table tbody .product-subtotal' => 'color: {{VALUE}};', |
| 363 | ], |
| 364 | ] |
| 365 | ); |
| 366 | |
| 367 | $this->add_group_control( |
| 368 | Group_Control_Typography::get_type(), |
| 369 | array( |
| 370 | 'name' => 'shopengine_cart_table_content_typography', |
| 371 | 'label' => esc_html__('Typography', 'shopengine'), |
| 372 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .shopengine-table__body-item--td :is(a, .amount, bdi)', |
| 373 | 'exclude' => ['font_family', 'text_decoration', 'font_style', 'letter_spacing'], |
| 374 | 'fields_options' => [ |
| 375 | 'typography' => [ |
| 376 | 'default' => 'custom', |
| 377 | ], |
| 378 | 'font_weight' => [ |
| 379 | 'default' => '500', |
| 380 | ], |
| 381 | 'font_size' => [ |
| 382 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 383 | 'default' => [ |
| 384 | 'size' => '14', |
| 385 | 'unit' => 'px' |
| 386 | ], |
| 387 | 'size_units' => ['px'] |
| 388 | ], |
| 389 | 'text_transform' => [ |
| 390 | 'default' => 'uppercase', |
| 391 | ], |
| 392 | 'line_height' => [ |
| 393 | 'label' => esc_html__('Line Height (px)', 'shopengine'), |
| 394 | 'default' => [ |
| 395 | 'size' => '18', |
| 396 | 'unit' => 'px' |
| 397 | ], |
| 398 | 'size_units' => ['px'] |
| 399 | ], |
| 400 | 'letter_spacing' => [ |
| 401 | 'default' => [ |
| 402 | 'size' => '0', |
| 403 | ] |
| 404 | ], |
| 405 | ], |
| 406 | ) |
| 407 | ); |
| 408 | |
| 409 | $this->add_responsive_control( |
| 410 | 'shopengine_cart_table_content_padding', |
| 411 | [ |
| 412 | 'label' => esc_html__('Content Padding (px)', 'shopengine'), |
| 413 | 'type' => Controls_Manager::DIMENSIONS, |
| 414 | 'size_units' => ['px'], |
| 415 | 'desktop_default' => [ |
| 416 | 'top' => '30', |
| 417 | 'right' => '0', |
| 418 | 'bottom' => '30', |
| 419 | 'left' => '40', |
| 420 | 'unit' => 'px', |
| 421 | 'isLinked' => false, |
| 422 | ], |
| 423 | 'tablet_default' => [ |
| 424 | 'top' => '20', |
| 425 | 'right' => '30', |
| 426 | 'bottom' => '20', |
| 427 | 'left' => '10', |
| 428 | 'unit' => 'px', |
| 429 | 'isLinked' => false, |
| 430 | ], |
| 431 | 'selectors' => [ |
| 432 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 433 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__body' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 434 | ], |
| 435 | |
| 436 | ] |
| 437 | ); |
| 438 | |
| 439 | |
| 440 | $this->add_control( |
| 441 | 'shopengine_cart_table_cell_gap', |
| 442 | [ |
| 443 | 'label' => esc_html__('Row Gap', 'shopengine'), |
| 444 | 'type' => Controls_Manager::SLIDER, |
| 445 | 'size_units' => ['px'], |
| 446 | |
| 447 | 'range' => [ |
| 448 | 'px' => [ |
| 449 | 'min' => 0, |
| 450 | 'max' => 100, |
| 451 | 'step' => 1, |
| 452 | ], |
| 453 | ], |
| 454 | 'default' => [ |
| 455 | 'unit' => 'px', |
| 456 | 'size' => 30, |
| 457 | ], |
| 458 | 'selectors' => [ |
| 459 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body' => 'grid-row-gap: {{SIZE}}{{UNIT}};', |
| 460 | ], |
| 461 | ] |
| 462 | ); |
| 463 | |
| 464 | |
| 465 | $this->end_controls_section(); // end ./ Style Tab - Cart Table Body |
| 466 | |
| 467 | /* |
| 468 | =============================== |
| 469 | Style Tab - produt image |
| 470 | =============================== |
| 471 | */ |
| 472 | |
| 473 | $this->start_controls_section( |
| 474 | 'shopengine_ct_product_image', |
| 475 | [ |
| 476 | 'label' => esc_html__('Product Image', 'shopengine'), |
| 477 | 'tab' => Controls_Manager::TAB_STYLE, |
| 478 | ] |
| 479 | ); |
| 480 | |
| 481 | $this->add_group_control( |
| 482 | Group_Control_Border::get_type(), |
| 483 | [ |
| 484 | 'name' => 'shopengine_ct_product_image_border', |
| 485 | 'label' => esc_html__('Border', 'shopengine'), |
| 486 | 'exclude' => ['color'], |
| 487 | 'fields_options' => [ |
| 488 | 'border' => [ |
| 489 | 'default' => 'solid', |
| 490 | ], |
| 491 | 'width' => [ |
| 492 | 'default' => [ |
| 493 | 'top' => '1', |
| 494 | 'right' => '1', |
| 495 | 'bottom' => '1', |
| 496 | 'left' => '1', |
| 497 | 'isLinked' => true, |
| 498 | ], |
| 499 | 'selectors' => [ |
| 500 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 501 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}', |
| 502 | ] |
| 503 | ], |
| 504 | ], |
| 505 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img', |
| 506 | 'separator' => 'before' |
| 507 | ] |
| 508 | ); |
| 509 | |
| 510 | $this->add_control( |
| 511 | 'shopengine_ct_product_image_border_clr', |
| 512 | [ |
| 513 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 514 | 'type' => Controls_Manager::COLOR, |
| 515 | 'default' => '#F2F2F2', |
| 516 | 'alpha' => false, |
| 517 | 'selectors' => [ |
| 518 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'border-color: {{VALUE}};', |
| 519 | ], |
| 520 | ] |
| 521 | ); |
| 522 | |
| 523 | $this->add_control( |
| 524 | 'shopengine_ct_product_image_border_radius', |
| 525 | [ |
| 526 | 'label' => esc_html__('Border Radius (px)', 'shopengine'), |
| 527 | 'type' => Controls_Manager::DIMENSIONS, |
| 528 | 'size_units' => ['px'], |
| 529 | 'default' => [ |
| 530 | 'top' => '4', |
| 531 | 'right' => '4', |
| 532 | 'bottom' => '4', |
| 533 | 'left' => '4', |
| 534 | 'unit' => 'px', |
| 535 | 'isLinked' => true, |
| 536 | ], |
| 537 | 'selectors' => [ |
| 538 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 539 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 540 | ], |
| 541 | 'separator' => 'before' |
| 542 | ] |
| 543 | ); |
| 544 | |
| 545 | $this->add_control( |
| 546 | 'shopengine_ct_product_image_width', |
| 547 | [ |
| 548 | 'label' => esc_html__('Width', 'shopengine'), |
| 549 | 'type' => Controls_Manager::SLIDER, |
| 550 | 'size_units' => ['px'], |
| 551 | |
| 552 | 'range' => [ |
| 553 | 'px' => [ |
| 554 | 'min' => 0, |
| 555 | 'max' => 200, |
| 556 | 'step' => 1, |
| 557 | ], |
| 558 | ], |
| 559 | 'default' => [ |
| 560 | 'unit' => 'px', |
| 561 | 'size' => 80, |
| 562 | ], |
| 563 | 'selectors' => [ |
| 564 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'width: {{SIZE}}{{UNIT}}; min-width: {{SIZE}}{{UNIT}};', |
| 565 | ], |
| 566 | ] |
| 567 | ); |
| 568 | |
| 569 | $this->add_responsive_control( |
| 570 | 'shopengine_ct_product_image_padding', |
| 571 | [ |
| 572 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 573 | 'type' => Controls_Manager::DIMENSIONS, |
| 574 | 'size_units' => ['px'], |
| 575 | 'selectors' => [ |
| 576 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 577 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__body .product-thumbnail img' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 578 | ], |
| 579 | ] |
| 580 | ); |
| 581 | |
| 582 | $this->end_controls_section(); // end ./ Style Tab - produt image |
| 583 | |
| 584 | |
| 585 | /* |
| 586 | =============================== |
| 587 | Style Tab - produt item |
| 588 | =============================== |
| 589 | */ |
| 590 | |
| 591 | $this->start_controls_section( |
| 592 | 'shopengine_ct_product_item', |
| 593 | [ |
| 594 | 'label' => esc_html__('Product Item', 'shopengine'), |
| 595 | 'tab' => Controls_Manager::TAB_STYLE, |
| 596 | ] |
| 597 | ); |
| 598 | |
| 599 | $this->add_control( |
| 600 | 'shopengine_ct_product_item_background', |
| 601 | [ |
| 602 | 'label' => esc_html__( 'Show Item Background?', 'shopengine' ), |
| 603 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 604 | 'label_on' => esc_html__( 'Show', 'shopengine' ), |
| 605 | 'label_off' => esc_html__( 'Hide', 'shopengine' ), |
| 606 | 'return_value' => 'yes', |
| 607 | 'default' => '', |
| 608 | ] |
| 609 | ); |
| 610 | |
| 611 | $this->add_control( |
| 612 | 'shopengine_ct_product_item_background_notice', |
| 613 | [ |
| 614 | 'label' => esc_html__( 'Notice', 'shopengine' ), |
| 615 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 616 | 'show_label' => false, |
| 617 | 'raw' => esc_html__( 'If you allow Item background please control padding from Product item section', 'shopengine' ), |
| 618 | 'content_classes'=> 'elementor-panel-alert elementor-panel-alert-info', |
| 619 | 'condition' => [ |
| 620 | 'shopengine_ct_product_item_background' => 'yes', |
| 621 | ], |
| 622 | ] |
| 623 | ); |
| 624 | |
| 625 | $this->add_control( |
| 626 | 'shopengine_ct_product_item_even_background', |
| 627 | [ |
| 628 | 'label' => esc_html__( 'Even Background Color', 'shopengine' ), |
| 629 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 630 | 'default' => '#F9FAFB', |
| 631 | 'selectors' => [ |
| 632 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item:nth-child(even)' => 'background-color: {{VALUE}}', |
| 633 | ], |
| 634 | 'condition' => [ |
| 635 | 'shopengine_ct_product_item_background' => 'yes', |
| 636 | ], |
| 637 | ] |
| 638 | ); |
| 639 | |
| 640 | $this->add_control( |
| 641 | 'shopengine_ct_product_item_odd_background', |
| 642 | [ |
| 643 | 'label' => esc_html__( 'Odd Background Color', 'shopengine' ), |
| 644 | 'type' => \Elementor\Controls_Manager::COLOR, |
| 645 | 'default' => '#FFFFFF', |
| 646 | 'selectors' => [ |
| 647 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item:nth-child(odd)' => 'background-color: {{VALUE}}', |
| 648 | ], |
| 649 | 'condition' => [ |
| 650 | 'shopengine_ct_product_item_background' => 'yes', |
| 651 | ], |
| 652 | ] |
| 653 | ); |
| 654 | |
| 655 | $this->add_group_control( |
| 656 | \Elementor\Group_Control_Border::get_type(), |
| 657 | [ |
| 658 | 'name' => 'shopengine_ct_product_item_border', |
| 659 | 'label' => esc_html__('Border', 'shopengine'), |
| 660 | 'separator' => 'before', |
| 661 | 'fields_options' => [ |
| 662 | 'width' => [ |
| 663 | 'label' => esc_html__('Border Width', 'shopengine'), |
| 664 | 'default' => [ |
| 665 | 'top' => 1, |
| 666 | 'right' => 1, |
| 667 | 'bottom' => 1, |
| 668 | 'left' => 1, |
| 669 | 'isLinked' => true, |
| 670 | ], |
| 671 | 'responsive' => false, |
| 672 | ], |
| 673 | 'color' => [ |
| 674 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 675 | 'default' => '#dee3ea', |
| 676 | 'alpha' => false, |
| 677 | ], |
| 678 | ], |
| 679 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item', |
| 680 | ] |
| 681 | ); |
| 682 | |
| 683 | $this->add_responsive_control( |
| 684 | 'shopengine_ct_product_item_padding', |
| 685 | [ |
| 686 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 687 | 'type' => Controls_Manager::DIMENSIONS, |
| 688 | 'size_units' => ['px'], |
| 689 | 'separator' => 'before', |
| 690 | 'selectors' => [ |
| 691 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 692 | ], |
| 693 | ] |
| 694 | ); |
| 695 | |
| 696 | $this->end_controls_section(); // end ./ Style Tab - Product Item |
| 697 | |
| 698 | /* |
| 699 | =============================== |
| 700 | Style Tab - Quantity |
| 701 | =============================== |
| 702 | */ |
| 703 | |
| 704 | $this->start_controls_section( |
| 705 | 'shopengine_ct_quantity_section', |
| 706 | [ |
| 707 | 'label' => esc_html__('Quantity', 'shopengine'), |
| 708 | 'tab' => Controls_Manager::TAB_STYLE, |
| 709 | ] |
| 710 | ); |
| 711 | |
| 712 | $this->add_control( |
| 713 | 'shopengine_cart_table_qty_btn_text_clr', |
| 714 | [ |
| 715 | 'label' => esc_html__('Text Color', 'shopengine'), |
| 716 | 'type' => Controls_Manager::COLOR, |
| 717 | 'default' => '#101010', |
| 718 | 'alpha' => false, |
| 719 | 'selectors' => [ |
| 720 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .shopengine-cart-quantity :is(.minus-button, .plus-button, .quantity, input)' => 'color: {{VALUE}};' |
| 721 | ], |
| 722 | ] |
| 723 | ); |
| 724 | |
| 725 | $this->add_control( |
| 726 | 'shopengine_cart_table_qty_btn_hover_text_clr', |
| 727 | [ |
| 728 | 'label' => esc_html__('Hover Text Color', 'shopengine'), |
| 729 | 'type' => Controls_Manager::COLOR, |
| 730 | 'default' => '#ACA3A3', |
| 731 | 'alpha' => false, |
| 732 | 'selectors' => [ |
| 733 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .shopengine-cart-quantity :is(.minus-button, .plus-button):hover' => 'color: {{VALUE}};' |
| 734 | ], |
| 735 | ] |
| 736 | ); |
| 737 | |
| 738 | $this->add_control( |
| 739 | 'shopengine_cart_table_qty_btn_background_color', |
| 740 | [ |
| 741 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 742 | 'type' => Controls_Manager::COLOR, |
| 743 | 'default' => '', |
| 744 | 'selectors' => [ |
| 745 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td .shopengine-cart-quantity' => 'background-color: {{VALUE}};' |
| 746 | ], |
| 747 | ] |
| 748 | ); |
| 749 | |
| 750 | $this->add_control( |
| 751 | 'shopengine_cart_table_qty_btn_border_clr', |
| 752 | [ |
| 753 | 'label' => esc_html__('Border Color', 'shopengine'), |
| 754 | 'type' => Controls_Manager::COLOR, |
| 755 | 'default' => '#F2F2F2', |
| 756 | 'alpha' => false, |
| 757 | 'selectors' => [ |
| 758 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body .shopengine-cart-quantity :is(.minus-button, .plus-button, .quantity)' => 'border-color: {{VALUE}};' |
| 759 | ], |
| 760 | ] |
| 761 | ); |
| 762 | |
| 763 | $this->add_control( |
| 764 | 'shopengine_cart_table_qty_btn_border_radius', |
| 765 | [ |
| 766 | 'label' => esc_html__('Border Radius (px)', 'shopengine'), |
| 767 | 'type' => Controls_Manager::DIMENSIONS, |
| 768 | 'size_units' => ['px'], |
| 769 | 'selectors' => [ |
| 770 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td .shopengine-cart-quantity .minus-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; border-top-right-radius: 0px; border-bottom-right-radius: 0px;', |
| 771 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td .shopengine-cart-quantity .plus-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; border-top-left-radius: 0px; border-bottom-left-radius: 0px;', |
| 772 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td .shopengine-cart-quantity' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 773 | ], |
| 774 | 'separator' => 'before' |
| 775 | ] |
| 776 | ); |
| 777 | |
| 778 | $this->end_controls_section(); // end ./ Style Tab - Quantity |
| 779 | |
| 780 | /* |
| 781 | * Style Tab - Cart Table Footer |
| 782 | */ |
| 783 | |
| 784 | $this->start_controls_section( |
| 785 | 'shopengine_cart_table_footer_section', |
| 786 | [ |
| 787 | 'label' => esc_html__('Table Footer', 'shopengine'), |
| 788 | 'tab' => Controls_Manager::TAB_STYLE, |
| 789 | ] |
| 790 | ); |
| 791 | |
| 792 | $this->add_control( |
| 793 | 'shopengine_cart_table_footer_bg', |
| 794 | [ |
| 795 | 'label' => esc_html__('Background', 'shopengine'), |
| 796 | 'type' => Controls_Manager::COLOR, |
| 797 | 'default' => '#ffffff', |
| 798 | 'alpha' => false, |
| 799 | 'selectors' => [ |
| 800 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer' => 'background: {{VALUE}};', |
| 801 | ], |
| 802 | ] |
| 803 | ); |
| 804 | |
| 805 | $this->add_responsive_control( |
| 806 | 'shopengine_cart_table_footer_padding', |
| 807 | [ |
| 808 | 'label' => esc_html__('Padding (px)', 'shopengine'), |
| 809 | 'type' => Controls_Manager::DIMENSIONS, |
| 810 | 'size_units' => ['px'], |
| 811 | 'desktop_default' => [ |
| 812 | 'top' => '30', |
| 813 | 'right' => '0', |
| 814 | 'bottom' => '0', |
| 815 | 'left' => '0', |
| 816 | 'unit' => 'px', |
| 817 | 'isLinked' => false, |
| 818 | ], |
| 819 | 'selectors' => [ |
| 820 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 821 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__footer' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 822 | ], |
| 823 | ] |
| 824 | ); |
| 825 | |
| 826 | $this->add_responsive_control( |
| 827 | 'shopengine_cart_table_footer_alignment', |
| 828 | [ |
| 829 | 'label' =>esc_html__('Alignment', 'shopengine'), |
| 830 | 'type' => Controls_Manager::CHOOSE, |
| 831 | 'options' => [ |
| 832 | 'left' => [ |
| 833 | 'title' =>esc_html__('Left', 'shopengine'), |
| 834 | 'icon' => 'eicon-text-align-left', |
| 835 | ], |
| 836 | 'center' => [ |
| 837 | 'title' =>esc_html__('Center', 'shopengine'), |
| 838 | 'icon' => 'eicon-text-align-center', |
| 839 | ], |
| 840 | 'right' => [ |
| 841 | 'title' =>esc_html__('Right', 'shopengine'), |
| 842 | 'icon' => 'eicon-text-align-right', |
| 843 | ], |
| 844 | ], |
| 845 | 'prefix_class' => 'elementor-align-', |
| 846 | 'selectors' => [ |
| 847 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer' => 'justify-content: {{VALUE}};', |
| 848 | '.rtl {{WRAPPER}}.elementor-align-left .shopengine-cart-table .shopengine-table__footer' => 'justify-content: end;', |
| 849 | '.rtl {{WRAPPER}}.elementor-align-right .shopengine-cart-table .shopengine-table__footer' => 'justify-content: start;', |
| 850 | ], |
| 851 | ] |
| 852 | ); |
| 853 | |
| 854 | $this->add_control( |
| 855 | 'shopengine_cart_table_footer_btn_styles', |
| 856 | [ |
| 857 | 'label' => esc_html__('Button Styles', 'shopengine'), |
| 858 | 'type' => Controls_Manager::HEADING, |
| 859 | 'separator' => 'before', |
| 860 | ] |
| 861 | ); |
| 862 | |
| 863 | $this->add_group_control( |
| 864 | Group_Control_Typography::get_type(), |
| 865 | array( |
| 866 | 'name' => 'shopengine_cart_table_footer_btn_typography', |
| 867 | 'label' => esc_html__('Typography', 'shopengine'), |
| 868 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button', |
| 869 | 'exclude' => ['font_family', 'letter_spacing', 'line_height', 'text_decoration', 'font_style'], |
| 870 | 'fields_options' => [ |
| 871 | 'typography' => [ |
| 872 | 'default' => 'custom', |
| 873 | ], |
| 874 | 'font_weight' => [ |
| 875 | 'default' => '600', |
| 876 | ], |
| 877 | 'font_size' => [ |
| 878 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 879 | 'default' => [ |
| 880 | 'size' => '16', |
| 881 | 'unit' => 'px' |
| 882 | ], |
| 883 | 'size_units' => ['px'] |
| 884 | ], |
| 885 | 'text_transform' => [ |
| 886 | 'default' => 'capitalize', |
| 887 | ], |
| 888 | |
| 889 | ], |
| 890 | ) |
| 891 | ); |
| 892 | |
| 893 | |
| 894 | |
| 895 | $this->start_controls_tabs('shopengine_cart_table_footer_button_style__tabs'); |
| 896 | |
| 897 | $this->start_controls_tab('shopengine_cart_table_footer_button_tab__normal', |
| 898 | [ |
| 899 | 'label' => esc_html__('Normal', 'shopengine'), |
| 900 | ] |
| 901 | ); |
| 902 | |
| 903 | $this->add_control( |
| 904 | 'shopengine_cart_table_footer_btn_normal_color', |
| 905 | [ |
| 906 | 'label' => esc_html__('Color', 'shopengine'), |
| 907 | 'type' => Controls_Manager::COLOR, |
| 908 | 'default' => '#979797', |
| 909 | 'alpha' => false, |
| 910 | 'selectors' => [ |
| 911 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer :is(.shopengine-footer-button, a, i)' => 'color: {{VALUE}} !important;' |
| 912 | ], |
| 913 | ] |
| 914 | ); |
| 915 | |
| 916 | $this->add_control( |
| 917 | 'shopengine_cart_table_footer_btn_normal_bg_color', |
| 918 | [ |
| 919 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 920 | 'type' => Controls_Manager::COLOR, |
| 921 | 'default' => '#f1f1f1', |
| 922 | 'alpha' => false, |
| 923 | 'selectors' => [ |
| 924 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button' => 'background-color: {{VALUE}} !important;', |
| 925 | ], |
| 926 | ] |
| 927 | ); |
| 928 | |
| 929 | $this->end_controls_tab(); |
| 930 | |
| 931 | $this->start_controls_tab('shopengine_cart_table_footer_button_tab__hover', |
| 932 | [ |
| 933 | 'label' => esc_html__('Hover', 'shopengine'), |
| 934 | ] |
| 935 | ); |
| 936 | |
| 937 | $this->add_control( |
| 938 | 'shopengine_cart_table_footer_btn_hover_color', |
| 939 | [ |
| 940 | 'label' => esc_html__('Color', 'shopengine'), |
| 941 | 'type' => Controls_Manager::COLOR, |
| 942 | 'alpha' => false, |
| 943 | 'default' => '#FFFFFF', |
| 944 | 'alpha' => false, |
| 945 | 'selectors' => [ |
| 946 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer :is(.shopengine-footer-button, a):hover' => 'color: {{VALUE}} !important;', |
| 947 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button:hover :is(a, i, span)' => 'color: {{VALUE}} !important;' |
| 948 | ] |
| 949 | ] |
| 950 | ); |
| 951 | |
| 952 | $this->add_control( |
| 953 | 'shopengine_cart_table_footer_btn_hover_bg_color', |
| 954 | [ |
| 955 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 956 | 'type' => Controls_Manager::COLOR, |
| 957 | 'default' => '#3A3A3A', |
| 958 | 'alpha' => false, |
| 959 | 'selectors' => [ |
| 960 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button:hover' => 'background-color: {{VALUE}} !important;', |
| 961 | ], |
| 962 | ] |
| 963 | ); |
| 964 | |
| 965 | |
| 966 | $this->end_controls_tab(); |
| 967 | $this->end_controls_tabs(); |
| 968 | |
| 969 | $this->add_control( |
| 970 | 'shopengine_cart_table_footer_btn_padding', |
| 971 | [ |
| 972 | 'label' => esc_html__('Button Padding', 'shopengine'), |
| 973 | 'type' => Controls_Manager::DIMENSIONS, |
| 974 | 'size_units' => ['px'], |
| 975 | 'default' => [ |
| 976 | 'top' => '13', |
| 977 | 'right' => '22', |
| 978 | 'bottom' => '15', |
| 979 | 'left' => '22', |
| 980 | 'unit' => 'px', |
| 981 | 'isLinked' => true, |
| 982 | ], |
| 983 | 'selectors' => [ |
| 984 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 985 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button' => 'padding: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 986 | ], |
| 987 | ] |
| 988 | ); |
| 989 | |
| 990 | $this->add_control( |
| 991 | 'shopengine_cart_table_footer_btn_border_radius', |
| 992 | [ |
| 993 | 'label' => esc_html__('Border Radius (px)', 'shopengine'), |
| 994 | 'type' => Controls_Manager::DIMENSIONS, |
| 995 | 'size_units' => ['px'], |
| 996 | 'default' => [ |
| 997 | 'top' => '4', |
| 998 | 'right' => '4', |
| 999 | 'bottom' => '4', |
| 1000 | 'left' => '4', |
| 1001 | 'unit' => 'px', |
| 1002 | 'isLinked' => true, |
| 1003 | ], |
| 1004 | 'selectors' => [ |
| 1005 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1006 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__footer .shopengine-footer-button' => 'border-radius: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}};', |
| 1007 | ], |
| 1008 | 'separator' => 'before' |
| 1009 | ] |
| 1010 | ); |
| 1011 | |
| 1012 | $this->end_controls_section(); |
| 1013 | |
| 1014 | /* Cart Table Remove Button Style start */ |
| 1015 | $this->start_controls_section( |
| 1016 | 'shopengine_cart_table_remove_button_style_section', |
| 1017 | [ |
| 1018 | 'label' => esc_html__('Remove Button', 'shopengine'), |
| 1019 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1020 | ] |
| 1021 | ); |
| 1022 | |
| 1023 | $this->add_control( |
| 1024 | 'shopengine_table_remove_button_icon_change', |
| 1025 | [ |
| 1026 | 'label' =>esc_html__('Remove Icon', 'shopengine'), |
| 1027 | 'type' => Controls_Manager::ICONS, |
| 1028 | 'label_block' => true, |
| 1029 | 'default' => [ |
| 1030 | 'value' => 'fas fa-times', |
| 1031 | 'library' => 'fa-solid', |
| 1032 | ], |
| 1033 | ] |
| 1034 | ); |
| 1035 | |
| 1036 | $this->add_responsive_control( |
| 1037 | 'shopengine_cart_table_remove_button_font_size', |
| 1038 | [ |
| 1039 | 'label' => esc_html__('Font Size (px)', 'shopengine'), |
| 1040 | 'type' => Controls_Manager::SLIDER, |
| 1041 | 'size_units' => ['px'], |
| 1042 | 'range' => [ |
| 1043 | 'px' => [ |
| 1044 | 'min' => 0, |
| 1045 | 'max' => 40, |
| 1046 | ], |
| 1047 | ], |
| 1048 | 'default' => [ |
| 1049 | 'size' => 12, |
| 1050 | ], |
| 1051 | 'selectors' => [ |
| 1052 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a' => 'font-size: {{SIZE}}{{UNIT}} !important;', |
| 1053 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a svg' => 'width: {{SIZE}}{{UNIT}} !important;', |
| 1054 | ], |
| 1055 | ] |
| 1056 | ); |
| 1057 | |
| 1058 | $this->start_controls_tabs( |
| 1059 | 'shopengine_cart_table_remove_button_style_tabs' |
| 1060 | ); |
| 1061 | |
| 1062 | $this->start_controls_tab( |
| 1063 | 'shopengine_cart_table_normal_remove_button_style_tab', |
| 1064 | [ |
| 1065 | 'label' => esc_html__( 'Normal', 'shopengine' ), |
| 1066 | ] |
| 1067 | ); |
| 1068 | |
| 1069 | $this->add_control( |
| 1070 | 'shopengine_cart_table_remove_btn_color', |
| 1071 | [ |
| 1072 | 'label' => esc_html__('Color', 'shopengine'), |
| 1073 | 'type' => Controls_Manager::COLOR, |
| 1074 | 'default' => '', |
| 1075 | 'alpha' => false, |
| 1076 | 'selectors' => [ |
| 1077 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove :is(a,span)' => 'color: {{VALUE}} !important;', |
| 1078 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove svg' => 'fill: {{VALUE}} !important;' |
| 1079 | ] |
| 1080 | ] |
| 1081 | ); |
| 1082 | |
| 1083 | $this->add_control( |
| 1084 | 'shopengine_cart_table_remove_btn_bg_color', |
| 1085 | [ |
| 1086 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 1087 | 'type' => Controls_Manager::COLOR, |
| 1088 | 'default' => '', |
| 1089 | 'alpha' => false, |
| 1090 | 'selectors' => [ |
| 1091 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove :is(a)' => 'background-color: {{VALUE}};', |
| 1092 | ], |
| 1093 | ] |
| 1094 | ); |
| 1095 | |
| 1096 | //opacity control with slider |
| 1097 | $this->add_control( |
| 1098 | 'shopengine_cart_table_remove_btn_opacity', |
| 1099 | [ |
| 1100 | 'label' => esc_html__('Opacity', 'shopengine'), |
| 1101 | 'type' => Controls_Manager::SLIDER, |
| 1102 | 'range' => [ |
| 1103 | 'px' => [ |
| 1104 | 'max' => 1, |
| 1105 | 'min' => 0, |
| 1106 | 'step' => 0.1, |
| 1107 | ], |
| 1108 | ], |
| 1109 | 'selectors' => [ |
| 1110 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a' => 'opacity: {{SIZE}} !important;', |
| 1111 | ], |
| 1112 | ] |
| 1113 | ); |
| 1114 | |
| 1115 | $this->add_group_control( |
| 1116 | Group_Control_Border::get_type(), |
| 1117 | [ |
| 1118 | 'name' => 'shopengine_cart_table_remove_btn_border', |
| 1119 | 'label' => esc_html__('Border', 'shopengine'), |
| 1120 | 'fields_options' => [ |
| 1121 | 'border' => [ |
| 1122 | 'default' => 'solid', |
| 1123 | ], |
| 1124 | 'width' => [ |
| 1125 | 'default' => [ |
| 1126 | 'top' => '1', |
| 1127 | 'right' => '1', |
| 1128 | 'bottom' => '1', |
| 1129 | 'left' => '1', |
| 1130 | 'isLinked' => true, |
| 1131 | ], |
| 1132 | 'selectors' => [ |
| 1133 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1134 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}', |
| 1135 | ] |
| 1136 | ], |
| 1137 | 'color' => [ |
| 1138 | 'default' => '#f2f2f2' |
| 1139 | ] |
| 1140 | ], |
| 1141 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a', |
| 1142 | 'separator' => 'before' |
| 1143 | ] |
| 1144 | ); |
| 1145 | |
| 1146 | $this->end_controls_tab(); |
| 1147 | $this->start_controls_tab( |
| 1148 | 'shopengine_cart_table_hover_remove_button_style_tab', |
| 1149 | [ |
| 1150 | 'label' => esc_html__( 'Hover', 'shopengine' ), |
| 1151 | ] |
| 1152 | ); |
| 1153 | |
| 1154 | $this->add_control( |
| 1155 | 'shopengine_cart_table_remove_btn_color_hover', |
| 1156 | [ |
| 1157 | 'label' => esc_html__('Color', 'shopengine'), |
| 1158 | 'type' => Controls_Manager::COLOR, |
| 1159 | 'default' => '', |
| 1160 | 'alpha' => false, |
| 1161 | 'selectors' => [ |
| 1162 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove :is(a,span):hover' => 'color: {{VALUE}} !important;' |
| 1163 | ] |
| 1164 | ] |
| 1165 | ); |
| 1166 | |
| 1167 | $this->add_control( |
| 1168 | 'shopengine_cart_table_remove_btn_bg_color_hover', |
| 1169 | [ |
| 1170 | 'label' => esc_html__('Background Color', 'shopengine'), |
| 1171 | 'type' => Controls_Manager::COLOR, |
| 1172 | 'default' => '', |
| 1173 | 'alpha' => false, |
| 1174 | 'selectors' => [ |
| 1175 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove :is(a):hover' => 'background-color: {{VALUE}};', |
| 1176 | ], |
| 1177 | ] |
| 1178 | ); |
| 1179 | |
| 1180 | //opacity control with slider |
| 1181 | $this->add_control( |
| 1182 | 'shopengine_cart_table_remove_btn_opacity_hover', |
| 1183 | [ |
| 1184 | 'label' => esc_html__('Opacity', 'shopengine'), |
| 1185 | 'type' => Controls_Manager::SLIDER, |
| 1186 | 'range' => [ |
| 1187 | 'px' => [ |
| 1188 | 'max' => 1, |
| 1189 | 'min' => 0, |
| 1190 | 'step' => 0.1, |
| 1191 | ], |
| 1192 | ], |
| 1193 | 'selectors' => [ |
| 1194 | '{{WRAPPER}} .shopengine-widget .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a:hover' => 'opacity: {{SIZE}} !important;', |
| 1195 | ], |
| 1196 | ] |
| 1197 | ); |
| 1198 | |
| 1199 | $this->add_group_control( |
| 1200 | Group_Control_Border::get_type(), |
| 1201 | [ |
| 1202 | 'name' => 'shopengine_cart_table_remove_btn_border_hover', |
| 1203 | 'label' => esc_html__('Border', 'shopengine'), |
| 1204 | 'fields_options' => [ |
| 1205 | 'border' => [ |
| 1206 | 'default' => 'solid', |
| 1207 | ], |
| 1208 | 'width' => [ |
| 1209 | 'default' => [ |
| 1210 | 'top' => '1', |
| 1211 | 'right' => '1', |
| 1212 | 'bottom' => '1', |
| 1213 | 'left' => '1', |
| 1214 | 'isLinked' => true, |
| 1215 | ], |
| 1216 | 'selectors' => [ |
| 1217 | '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a:hover' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1218 | '.rtl {{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a:hover' => 'border-width: {{TOP}}{{UNIT}} {{LEFT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{RIGHT}}{{UNIT}}', |
| 1219 | ] |
| 1220 | ], |
| 1221 | 'color' => [ |
| 1222 | 'default' => '#f2f2f2' |
| 1223 | ] |
| 1224 | ], |
| 1225 | 'selector' => '{{WRAPPER}} .shopengine-cart-table .shopengine-table__body-item--td:first-child .product-thumbnail .product-remove a:hover', |
| 1226 | 'separator' => 'before' |
| 1227 | ] |
| 1228 | ); |
| 1229 | |
| 1230 | $this->end_controls_tab(); |
| 1231 | $this->end_controls_tabs(); |
| 1232 | $this->end_controls_section(); |
| 1233 | /* Cart Table Remove Button Style end */ |
| 1234 | |
| 1235 | /*--------------------------- |
| 1236 | global font family |
| 1237 | -----------------------------*/ |
| 1238 | $this->start_controls_section( |
| 1239 | 'shopengine_cart_table_typography', |
| 1240 | array( |
| 1241 | 'label' => esc_html__('Global Font', 'shopengine'), |
| 1242 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1243 | ) |
| 1244 | ); |
| 1245 | |
| 1246 | $this->add_control( |
| 1247 | 'shopengine_cart_table_font_family', |
| 1248 | [ |
| 1249 | 'label' => esc_html__('Font Family', 'shopengine'), |
| 1250 | 'description' => esc_html__('This font family is set for this specific widget.', 'shopengine'), |
| 1251 | 'type' => Controls_Manager::FONT, |
| 1252 | 'default' => '', |
| 1253 | 'selectors' => [ |
| 1254 | '{{WRAPPER}} .shopengine-cart-table :is(.shopengine-table__body, .shopengine-table__head, .shopengine-table__footer) :is(div, span, a, button, bdi)' => 'font-family: {{VALUE}}', |
| 1255 | ], |
| 1256 | ] |
| 1257 | ); |
| 1258 | |
| 1259 | $this->end_controls_section(); |
| 1260 | } |
| 1261 | |
| 1262 | |
| 1263 | protected function screen() { |
| 1264 | |
| 1265 | $settings = $this->get_settings_for_display(); |
| 1266 | |
| 1267 | $post_type = get_post_type(); |
| 1268 | |
| 1269 | $tpl = Products::instance()->get_widget_template($this->get_name()); |
| 1270 | |
| 1271 | include $tpl; |
| 1272 | } |
| 1273 | } |
| 1274 |