← All changes
|
app/Elementor/Widgets/Controls/AddToCartSettings.php
+50
-15
2.1.3
→
3.2.6
View file →
| @@ -34,8 +34,9 @@ | ||
| 34 | 34 | private static $selectors = []; |
| 35 | 35 | /** |
| 36 | 36 | * Widget Field |
| 37 | 37 | * |
| 38 | + * @param object $widget object. | |
| 38 | 39 | * @return array |
| 39 | 40 | */ |
| 40 | 41 | public static function widget_fields( $widget ) { |
| 41 | 42 | self::$widget = $widget; |
| @@ -83,15 +84,16 @@ | ||
| 83 | 84 | 'condition' => [ |
| 84 | 85 | 'quantity_style!' => 'default', |
| 85 | 86 | ], |
| 86 | 87 | 'selectors' => [ |
| 87 | - self::$selectors['cart_icon_align'] => 'order: {{VALUE}};', | |
| 88 | + self::$selectors['cart_icon_align']['icon'] => 'order: {{VALUE}};', | |
| 89 | + self::$selectors['cart_icon_align']['svg'] => 'order: {{VALUE}};', | |
| 88 | 90 | ], |
| 89 | 91 | ], |
| 90 | 92 | 'cart_icon_gap' => [ |
| 91 | 93 | 'label' => esc_html__( 'Gap', 'shopbuilder' ), |
| 92 | 94 | 'type' => 'slider', |
| 93 | - 'mode' => 'responsive', | |
| 95 | + 'mode' => 'responsive', | |
| 94 | 96 | 'range' => [ |
| 95 | 97 | 'px' => [ |
| 96 | 98 | 'min' => 0, |
| 97 | 99 | 'max' => 100, |
| @@ -125,9 +127,10 @@ | ||
| 125 | 127 | 'max' => 50, |
| 126 | 128 | ], |
| 127 | 129 | ], |
| 128 | 130 | 'selectors' => [ |
| 129 | - self::$selectors['cart_icon_size'] => 'font-size: {{SIZE}}{{UNIT}};', | |
| 131 | + self::$selectors['cart_icon_size']['icon'] => 'font-size: {{SIZE}}{{UNIT}};', | |
| 132 | + self::$selectors['cart_icon_size']['svg'] => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', | |
| 130 | 133 | ], |
| 131 | 134 | ], |
| 132 | 135 | ]; |
| 133 | 136 | $fields = Fns::insert_controls( 'button_padding', $fields, $insert_array ); |
| @@ -331,15 +334,37 @@ | ||
| 331 | 334 | 'label' => esc_html__( 'Label Typography', 'shopbuilder' ), |
| 332 | 335 | 'description' => esc_html__( 'Only for Variation Label.', 'shopbuilder' ), |
| 333 | 336 | 'selector' => self::$selectors['variation_label_typography'], |
| 334 | 337 | ], |
| 338 | + 'variation_stock_typography' => [ | |
| 339 | + 'type' => 'typography', | |
| 340 | + 'separator' => 'before', | |
| 341 | + 'mode' => 'group', | |
| 342 | + 'label' => esc_html__( 'Stock Typography', 'shopbuilder' ), | |
| 343 | + 'description' => esc_html__( 'Only for variation stock.', 'shopbuilder' ), | |
| 344 | + 'selector' => self::$selectors['variation_stock_typography'], | |
| 345 | + ], | |
| 335 | 346 | 'variation_label_color' => [ |
| 336 | - 'label' => esc_html__( 'Color', 'shopbuilder' ), | |
| 347 | + 'label' => esc_html__( 'Label Color', 'shopbuilder' ), | |
| 337 | 348 | 'type' => 'color', |
| 338 | 349 | 'selectors' => [ |
| 339 | 350 | self::$selectors['variation_label_color'] => 'color: {{VALUE}}', |
| 340 | 351 | ], |
| 341 | 352 | ], |
| 353 | + 'variation_stock_color' => [ | |
| 354 | + 'label' => esc_html__( 'Stock Color', 'shopbuilder' ), | |
| 355 | + 'type' => 'color', | |
| 356 | + 'selectors' => [ | |
| 357 | + self::$selectors['variation_stock_color'] => 'color: {{VALUE}}', | |
| 358 | + ], | |
| 359 | + ], | |
| 360 | + 'variation_outofstock_color' => [ | |
| 361 | + 'label' => esc_html__( 'Out of Stock Color', 'shopbuilder' ), | |
| 362 | + 'type' => 'color', | |
| 363 | + 'selectors' => [ | |
| 364 | + self::$selectors['variation_outofstock_color'] => 'color: {{VALUE}}', | |
| 365 | + ], | |
| 366 | + ], | |
| 342 | 367 | 'variation_height' => [ |
| 343 | 368 | 'label' => esc_html__( 'Height', 'shopbuilder' ), |
| 344 | 369 | 'type' => 'slider', |
| 345 | 370 | 'range' => [ |
| @@ -347,14 +372,19 @@ | ||
| 347 | 372 | 'min' => 10, |
| 348 | 373 | 'max' => 200, |
| 349 | 374 | ], |
| 350 | 375 | ], |
| 376 | + 'default' => [ | |
| 377 | + 'unit' => 'px', | |
| 378 | + 'size' => '30', | |
| 379 | + ], | |
| 351 | 380 | 'selectors' => [ |
| 352 | 381 | self::$selectors['variation_height'] => 'height: {{SIZE}}{{UNIT}};', |
| 382 | + ':root' => '--details-page-attr-height:{{SIZE}}{{UNIT}};', | |
| 353 | 383 | ], |
| 354 | 384 | ], |
| 355 | 385 | 'variation_width' => [ |
| 356 | - 'label' => esc_html__( 'Width', 'shopbuilder' ), | |
| 386 | + 'label' => esc_html__( 'Min Width', 'shopbuilder' ), | |
| 357 | 387 | 'size_units' => [ 'px', '%' ], |
| 358 | 388 | 'type' => 'slider', |
| 359 | 389 | 'range' => [ |
| 360 | 390 | 'px' => [ |
| @@ -365,10 +395,15 @@ | ||
| 365 | 395 | 'min' => 0, |
| 366 | 396 | 'max' => 100, |
| 367 | 397 | ], |
| 368 | 398 | ], |
| 399 | + 'default' => [ | |
| 400 | + 'unit' => 'px', | |
| 401 | + 'size' => '30', | |
| 402 | + ], | |
| 369 | 403 | 'selectors' => [ |
| 370 | - self::$selectors['variation_width'] => 'width: {{SIZE}}{{UNIT}};', | |
| 404 | + self::$selectors['variation_width'] => 'min-width: {{SIZE}}{{UNIT}};', | |
| 405 | + ':root' => '--details-page-attr-width:{{SIZE}}{{UNIT}};', | |
| 371 | 406 | ], |
| 372 | 407 | ], |
| 373 | 408 | 'variation_border' => [ |
| 374 | 409 | 'mode' => 'group', |
| @@ -381,15 +416,17 @@ | ||
| 381 | 416 | 'size_units' => [ 'px', '%' ], |
| 382 | 417 | 'type' => 'slider', |
| 383 | 418 | 'selectors' => [ |
| 384 | 419 | self::$selectors['variation_border_radius'] => 'border-radius: {{SIZE}}{{UNIT}};', |
| 420 | + ':root' => '--variation-attr-border-radius:{{SIZE}}{{UNIT}};', | |
| 385 | 421 | ], |
| 386 | 422 | ], |
| 387 | 423 | 'variation_padding' => [ |
| 388 | - 'label' => esc_html__( 'Padding', 'shopbuilder' ), | |
| 389 | - 'type' => 'dimensions', | |
| 390 | - 'size_units' => [ 'px' ], | |
| 391 | - 'default' => [ | |
| 424 | + 'label' => esc_html__( 'Padding ', 'shopbuilder' ), | |
| 425 | + 'description' => esc_html__( 'Note: Only for Select And Button Field.', 'shopbuilder' ), | |
| 426 | + 'type' => 'dimensions', | |
| 427 | + 'size_units' => [ 'px' ], | |
| 428 | + 'default' => [ | |
| 392 | 429 | 'top' => '10', |
| 393 | 430 | 'right' => '10', |
| 394 | 431 | 'bottom' => '10', |
| 395 | 432 | 'left' => '10', |
| @@ -395,11 +432,12 @@ | ||
| 395 | 432 | 'left' => '10', |
| 396 | 433 | 'unit' => 'px', |
| 397 | 434 | 'isLinked' => true, |
| 398 | 435 | ], |
| 399 | - 'separator' => 'default', | |
| 400 | - 'selectors' => [ | |
| 436 | + 'separator' => 'default', | |
| 437 | + 'selectors' => [ | |
| 401 | 438 | self::$selectors['variation_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 439 | + ':root' => '--variation-padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 402 | 440 | ], |
| 403 | 441 | ], |
| 404 | 442 | 'variation_label_margin' => [ |
| 405 | 443 | 'label' => esc_html__( 'Label Margin', 'shopbuilder' ), |
| @@ -415,11 +453,8 @@ | ||
| 415 | 453 | 'size_units' => [ 'px', '%', 'em' ], |
| 416 | 454 | 'selectors' => [ |
| 417 | 455 | self::$selectors['variation_item_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', |
| 418 | 456 | ], |
| 419 | - ], | |
| 420 | - 'variation_section_end' => [ | |
| 421 | - 'mode' => 'section_end', | |
| 422 | 457 | ], |
| 423 | 458 | 'variation_section_end' => [ |
| 424 | 459 | 'mode' => 'section_end', |
| 425 | 460 | ], |