PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.1.4
ShopBuilder – WooCommerce Builder For Elementor v1.1.4
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Controls / ShippingMethodSettings.php

ShippingMethodSettings.php in ShopBuilder – WooCommerce Builder For Elementor 1.1.4, at app/Elementor/Widgets/Controls/ShippingMethodSettings.php

190 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main ProductDescription class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Controls;
9
10 use RadiusTheme\SB\Elementor\Helper\ControlHelper;
11 use RadiusTheme\SB\Helpers\Fns;
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 * Product Description class
20 */
21 class ShippingMethodSettings
22 {
23 /**
24 * Widget Control Selectors
25 *
26 * @var object
27 */
28 private static $widget = [];
29 /**
30 * Widget Control Selectors
31 *
32 * @var array
33 */
34 private static $selectors = [];
35
36 /**
37 * Widget Field
38 *
39 * @return array
40 */
41 public static function widget_fields($widget)
42 {
43 self::$widget = $widget;
44 self::$selectors = $widget->selectors;
45 return self::title_settings() +
46 self::general_style_settings( self::$widget ) +
47 TitleSettings::title_settings(self::$widget) +
48 self::label_settings($widget);
49 }
50
51 /**
52 * Widget Field
53 *
54 * @return array
55 */
56 public static function title_settings()
57 {
58 $title_settings = TitleSettings::general_settings() ;
59
60 $title_settings['general_style']['label'] = esc_html__( 'General', 'shopbuilder' );
61
62 $new_fields = [
63 'title_html_tag' => [
64 'label' => esc_html__('Title HTML Tag', 'shopbuilder'),
65 'type' => 'select',
66 'options' => ControlHelper::heading_tags(),
67 'default' => 'h2',
68 'condition' => [
69 'show_title!' => '',
70 ],
71 ],
72 'title_text' => [
73 'label' => esc_html__('Title Text', 'shopbuilder'),
74 'type' => 'text',
75 'default' => esc_html__('Shipping', 'shopbuilder' ),
76 'condition' => [
77 'show_title!' => '',
78 ],
79 ],
80 ];
81
82 $fields = Fns::insert_controls('show_title', $title_settings, $new_fields, true);
83
84 return $fields;
85 }
86
87 public static function general_style_settings($widget)
88 {
89 return [
90 'general_table_style_start' => [
91 'mode' => 'section_start',
92 'tab' => 'style',
93 'label' => esc_html__('General', 'shopbuilder'),
94 ],
95 'general_cart_table_border' => [
96 'mode' => 'group',
97 'type' => 'border',
98 'separator' => 'default',
99 'label' => esc_html__( 'Border', 'shopbuilder' ),
100 'selector' => $widget->selectors['general_cart_table_border'],
101 'size_units' => [ 'px' ],
102 ],
103 'general_cart_table_bg' => [
104 'label' => esc_html__( 'Background', 'shopbuilder' ),
105 'type' => 'color',
106 'selectors' => [
107 self::$selectors['general_cart_table_bg'] => 'background-color: {{VALUE}} !important;',
108 ],
109 ],
110 'general_table_padding' => [
111 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ),
112 'type' => 'dimensions',
113 'size_units' => [ 'px' ],
114 'selectors' => [
115 $widget->selectors['general_table_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
116 ],
117 ],
118 'general_table_style_end' => [
119 'mode' => 'section_end',
120 ],
121 ];
122 }
123 public static function label_settings($widget)
124 {
125 return [
126 'label_title_style_start' => [
127 'mode' => 'section_start',
128 'tab' => 'style',
129 'label' => esc_html__('Label', 'shopbuilder'),
130 'condition' => [
131 'show_title!' => '',
132 ],
133 ],
134 'label_title_typo' => [
135 'mode' => 'group',
136 'type' => 'typography',
137 'label' => esc_html__('Typography', 'shopbuilder'),
138 'selector' => $widget->selectors['label_title_typo'],
139 ],
140 'label_title_color' => [
141 'label' => esc_html__('Label Color', 'shopbuilder'),
142 'type' => 'color',
143 'selectors' => [
144 $widget->selectors['label_title_color'] => 'color: {{VALUE}} !important;',
145 ],
146 ],
147 'label_space_between' => [
148 'label' => esc_html__('Space Between (px)', 'shopbuilder'),
149 'type' => 'slider',
150 'size_units' => ['px'],
151 'default' => [
152 'size' => 4,
153 'unit' => 'px',
154 ],
155 'range' => [
156 'px' => [
157 'min' => 0,
158 'max' => 100,
159 ],
160 ],
161 'selectors' => [
162 $widget->selectors['label_space_between'] => 'gap: {{SIZE}}{{UNIT}};',
163 ],
164 ],
165 'label_item_space' => [
166 'label' => esc_html__('Label Gap (px)', 'shopbuilder'),
167 'type' => 'slider',
168 'size_units' => ['px'],
169 'default' => [
170 'size' => 5,
171 'unit' => 'px',
172 ],
173 'range' => [
174 'px' => [
175 'min' => 0,
176 'max' => 100,
177 ],
178 ],
179 'selectors' => [
180 $widget->selectors['label_item_space'] => 'gap: {{SIZE}}{{UNIT}};',
181 ],
182 ],
183 'label_title_style_end' => [
184 'mode' => 'section_end',
185 ],
186 ];
187 }
188
189 }
190