← All changes
|
app/Elementor/Widgets/Controls/PriceSettings.php
+126
-124
2.1.11
→
1.1.4
View file →
| @@ -1,124 +1,126 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Main ProductDescription class. | |
| 4 | - * | |
| 5 | - * @package RadiusTheme\SB | |
| 6 | - */ | |
| 7 | - | |
| 8 | -namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | - | |
| 10 | -use Elementor\Controls_Manager; | |
| 11 | -use RadiusTheme\SB\Elementor\Helper\ControlHelper; | |
| 12 | - | |
| 13 | -// Do not allow directly accessing this file. | |
| 14 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 15 | - exit( 'This script cannot be accessed directly.' ); | |
| 16 | -} | |
| 17 | - | |
| 18 | - | |
| 19 | -/** | |
| 20 | - * Product Description class | |
| 21 | - */ | |
| 22 | -class PriceSettings { | |
| 23 | - /** | |
| 24 | - * Widget Field | |
| 25 | - * | |
| 26 | - * @return array | |
| 27 | - */ | |
| 28 | - public static function widget_fields( $widget ) { | |
| 29 | - $alignment = ControlHelper::alignment(); | |
| 30 | - unset( $alignment['justify'] ); | |
| 31 | - $fields = [ | |
| 32 | - 'sec_general' => [ | |
| 33 | - 'mode' => 'section_start', | |
| 34 | - 'label' => esc_html__( 'General', 'shopbuilder' ), | |
| 35 | - ], | |
| 36 | - 'price_align' => [ | |
| 37 | - 'mode' => 'responsive', | |
| 38 | - 'label' => esc_html__( 'Alignment', 'shopbuilder' ), | |
| 39 | - 'type' => 'choose', | |
| 40 | - 'options' => $alignment, | |
| 41 | - 'separator' => 'default', | |
| 42 | - 'selectors' => [ | |
| 43 | - $widget->selectors['price_align'] => 'text-align: {{VALUE}};', | |
| 44 | - ], | |
| 45 | - ], | |
| 46 | - 'space_between' => [ | |
| 47 | - 'label' => esc_html__( 'Space for sale price (px)', 'shopbuilder' ), | |
| 48 | - 'type' => 'slider', | |
| 49 | - 'size_units' => [ 'px' ], | |
| 50 | - 'default' => [ | |
| 51 | - 'size' => 8, | |
| 52 | - 'unit' => 'px', | |
| 53 | - ], | |
| 54 | - 'range' => [ | |
| 55 | - 'px' => [ | |
| 56 | - 'min' => 0, | |
| 57 | - 'max' => 100, | |
| 58 | - ], | |
| 59 | - ], | |
| 60 | - 'selectors' => [ | |
| 61 | - $widget->selectors['space_between']['del_price'] => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 62 | - $widget->selectors['space_between']['del_price_rtl'] => 'margin-left: {{SIZE}}{{UNIT}}; margin-right:0px;', | |
| 63 | - ], | |
| 64 | - | |
| 65 | - ], | |
| 66 | - 'sec_general_end' => [ | |
| 67 | - 'mode' => 'section_end', | |
| 68 | - ], | |
| 69 | - 'general_style' => [ | |
| 70 | - 'mode' => 'section_start', | |
| 71 | - 'tab' => 'style', | |
| 72 | - 'label' => esc_html__( 'Style', 'shopbuilder' ), | |
| 73 | - ], | |
| 74 | - 'price_heading' => [ | |
| 75 | - 'type' => 'html', | |
| 76 | - 'raw' => sprintf( | |
| 77 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 78 | - esc_html__( 'Price', 'shopbuilder' ) | |
| 79 | - ), | |
| 80 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 81 | - 'separator' => 'default', | |
| 82 | - ], | |
| 83 | - 'price_typo' => [ | |
| 84 | - 'mode' => 'group', | |
| 85 | - 'type' => 'typography', | |
| 86 | - 'selector' => $widget->selectors['price_typo'], | |
| 87 | - ], | |
| 88 | - 'price_color' => [ | |
| 89 | - 'label' => esc_html__( 'Color', 'shopbuilder' ), | |
| 90 | - 'type' => 'color', | |
| 91 | - 'selectors' => [ | |
| 92 | - $widget->selectors['price_color'] => 'color: {{VALUE}} !important;', | |
| 93 | - ], | |
| 94 | - ], | |
| 95 | - 'sale_price_heading' => [ | |
| 96 | - 'type' => 'html', | |
| 97 | - 'raw' => sprintf( | |
| 98 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 99 | - esc_html__( 'Sale Price', 'shopbuilder' ) | |
| 100 | - ), | |
| 101 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 102 | - 'separator' => 'before', | |
| 103 | - ], | |
| 104 | - 'sale_price_typo' => [ | |
| 105 | - 'mode' => 'group', | |
| 106 | - 'type' => 'typography', | |
| 107 | - 'selector' => $widget->selectors['sale_price_typo'], | |
| 108 | - ], | |
| 109 | - 'sale_price_color' => [ | |
| 110 | - 'label' => esc_html__( 'Sale Price Color', 'shopbuilder' ), | |
| 111 | - 'type' => 'color', | |
| 112 | - 'selectors' => [ | |
| 113 | - $widget->selectors['sale_price_color'] => ' background: transparent; color: {{VALUE}} !important;', | |
| 114 | - ], | |
| 115 | - ], | |
| 116 | - 'general_style_end' => [ | |
| 117 | - 'mode' => 'section_end', | |
| 118 | - ], | |
| 119 | - ]; | |
| 120 | - return $fields; | |
| 121 | - } | |
| 122 | - | |
| 123 | - | |
| 124 | -} | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Main ProductDescription class. | |
| 4 | + * | |
| 5 | + * @package RadiusTheme\SB | |
| 6 | + */ | |
| 7 | + | |
| 8 | +namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | + | |
| 10 | +use Elementor\Controls_Manager; | |
| 11 | +use RadiusTheme\SB\Elementor\Helper\ControlHelper; | |
| 12 | + | |
| 13 | +// Do not allow directly accessing this file. | |
| 14 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 15 | + exit( 'This script cannot be accessed directly.' ); | |
| 16 | +} | |
| 17 | + | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * Product Description class | |
| 21 | + */ | |
| 22 | +class PriceSettings { | |
| 23 | + /** | |
| 24 | + * Widget Field | |
| 25 | + * | |
| 26 | + * @return array | |
| 27 | + */ | |
| 28 | + public static function widget_fields( $widget ) { | |
| 29 | + $alignment = ControlHelper::alignment(); | |
| 30 | + unset( $alignment['justify'] ); | |
| 31 | + $fields = [ | |
| 32 | + 'sec_general' => [ | |
| 33 | + 'mode' => 'section_start', | |
| 34 | + 'label' => esc_html__( 'General', 'shopbuilder' ), | |
| 35 | + ], | |
| 36 | + 'price_align' => [ | |
| 37 | + 'mode' => 'responsive', | |
| 38 | + 'label' => esc_html__( 'Alignment', 'shopbuilder' ), | |
| 39 | + 'type' => 'choose', | |
| 40 | + 'options' => $alignment, | |
| 41 | + 'separator' => 'default', | |
| 42 | + 'selectors' => [ | |
| 43 | + $widget->selectors['price_align'] => 'text-align: {{VALUE}};', | |
| 44 | + ], | |
| 45 | + ], | |
| 46 | + 'space_between' => [ | |
| 47 | + 'label' => esc_html__( 'Space for sale price (px)', 'shopbuilder' ), | |
| 48 | + 'type' => 'slider', | |
| 49 | + 'size_units' => [ 'px' ], | |
| 50 | + 'default' => [ | |
| 51 | + 'size' => 8, | |
| 52 | + 'unit' => 'px', | |
| 53 | + ], | |
| 54 | + 'range' => [ | |
| 55 | + 'px' => [ | |
| 56 | + 'min' => 0, | |
| 57 | + 'max' => 100, | |
| 58 | + ], | |
| 59 | + ], | |
| 60 | + 'selectors' => [ | |
| 61 | + $widget->selectors['space_between']['del_price'] => 'margin-right: {{SIZE}}{{UNIT}};', | |
| 62 | + $widget->selectors['space_between']['del_price_rtl'] => 'margin-left: {{SIZE}}{{UNIT}}; margin-right:0px;', | |
| 63 | + ], | |
| 64 | + | |
| 65 | + ], | |
| 66 | + 'sec_general_end' => [ | |
| 67 | + 'mode' => 'section_end', | |
| 68 | + ], | |
| 69 | + 'general_style' => [ | |
| 70 | + 'mode' => 'section_start', | |
| 71 | + 'tab' => 'style', | |
| 72 | + 'label' => esc_html__( 'Style', 'shopbuilder' ), | |
| 73 | + ], | |
| 74 | + 'price_heading' => [ | |
| 75 | + 'type' => 'html', | |
| 76 | + 'raw' => sprintf( | |
| 77 | + '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 78 | + esc_html__( 'Price', 'shopbuilder' ) | |
| 79 | + ), | |
| 80 | + 'content_classes' => 'elementor-panel-heading-title', | |
| 81 | + 'separator' => 'default', | |
| 82 | + ], | |
| 83 | + 'price_typo' => [ | |
| 84 | + 'mode' => 'group', | |
| 85 | + 'type' => 'typography', | |
| 86 | + 'selector' => $widget->selectors['price_typo'], | |
| 87 | + 'exclude' => [ 'text_transform', 'text_decoration', 'font_style', 'letter_spacing' ], | |
| 88 | + ], | |
| 89 | + 'price_color' => [ | |
| 90 | + 'label' => esc_html__( 'Color', 'shopbuilder' ), | |
| 91 | + 'type' => 'color', | |
| 92 | + 'selectors' => [ | |
| 93 | + $widget->selectors['price_color'] => 'color: {{VALUE}} !important;', | |
| 94 | + ], | |
| 95 | + ], | |
| 96 | + 'sale_price_heading' => [ | |
| 97 | + 'type' => 'html', | |
| 98 | + 'raw' => sprintf( | |
| 99 | + '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 100 | + esc_html__( 'Sale Price', 'shopbuilder' ) | |
| 101 | + ), | |
| 102 | + 'content_classes' => 'elementor-panel-heading-title', | |
| 103 | + 'separator' => 'before', | |
| 104 | + ], | |
| 105 | + 'sale_price_typo' => [ | |
| 106 | + 'mode' => 'group', | |
| 107 | + 'type' => 'typography', | |
| 108 | + 'selector' => $widget->selectors['sale_price_typo'], | |
| 109 | + 'exclude' => [ 'text_transform', 'text_decoration', 'font_style', 'letter_spacing' ], | |
| 110 | + ], | |
| 111 | + 'sale_price_color' => [ | |
| 112 | + 'label' => esc_html__( 'Sale Price Color', 'shopbuilder' ), | |
| 113 | + 'type' => 'color', | |
| 114 | + 'selectors' => [ | |
| 115 | + $widget->selectors['sale_price_color'] => ' background: transparent; color: {{VALUE}} !important;', | |
| 116 | + ], | |
| 117 | + ], | |
| 118 | + 'general_style_end' => [ | |
| 119 | + 'mode' => 'section_end', | |
| 120 | + ], | |
| 121 | + ]; | |
| 122 | + return $fields; | |
| 123 | + } | |
| 124 | + | |
| 125 | + | |
| 126 | +} | |