PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 1.0.0
ShopBuilder – WooCommerce Builder For Elementor v1.0.0
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 / StockSettings.php

StockSettings.php in ShopBuilder – WooCommerce Builder For Elementor 1.0.0, at app/Elementor/Widgets/Controls/StockSettings.php

191 lines 5.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main StockSettings 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 * Product Stock Settings class
20 */
21 class StockSettings {
22 /**
23 * Widget Field
24 *
25 * @return array
26 */
27 public static function widget_fields( $widget ) {
28 $alignment = ControlHelper::alignment();
29 unset( $alignment['justify'] );
30 $fields = [
31 'stock_content' => [
32 'mode' => 'section_start',
33 'label' => esc_html__( 'Settings', 'shopbuilder' ),
34 'tab' => 'content',
35 ],
36 'stock_text_typography' => [
37 'mode' => 'group',
38 'type' => 'typography',
39 'label' => esc_html__( 'Typography', 'shopbuilder' ),
40 'selector' => $widget->selectors['stock_text_typography'],
41 ],
42 'in_stock_color' => [
43 'label' => esc_html__( 'In Stock Text Color', 'shopbuilder' ),
44 'type' => 'color',
45 'description' => sprintf(
46 /* translators: text*/
47 esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
48 '<b>' . esc_html__( 'In stork', 'shopbuilder' ) . '</b>'
49 ),
50 'selectors' => [
51 $widget->selectors['in_stock_color'] => 'color: {{VALUE}} !important',
52 ],
53 ],
54 'outof_stock_color' => [
55 'label' => esc_html__( 'Out Of Stock Text Color', 'shopbuilder' ),
56 'type' => 'color',
57 'description' => sprintf(
58 /* translators: text*/
59 esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
60 '<b>' . esc_html__( 'Out of stock', 'shopbuilder' ) . '</b>'
61 ),
62 'selectors' => [
63 $widget->selectors['outof_stock_color'] => 'color: {{VALUE}} !important',
64 ],
65 ],
66 'backorder_stock_color' => [
67 'label' => esc_html__( 'Backorder Stock Text Color', 'shopbuilder' ),
68 'type' => 'color',
69 'description' => sprintf(
70 /* translators: text*/
71 esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
72 '<b>' . esc_html__( 'Backorder stock', 'shopbuilder' ) . '</b>'
73 ),
74 'selectors' => [
75 $widget->selectors['backorder_stock_color'] => 'color: {{VALUE}} !important',
76 ],
77 ],
78 'icon_size' => [
79 'label' => esc_html__( 'Icon Size (px)', 'shopbuilder' ),
80 'type' => 'slider',
81 'size_units' => [ 'px' ],
82 'range' => [
83 'px' => [
84 'min' => 0,
85 'max' => 100,
86 'step' => 1,
87 ],
88 ],
89 'default' => [
90 'size' => 16,
91 'unit' => 'px',
92 ],
93 'selectors' => [
94 $widget->selectors['icon_size'] => 'font-size: {{SIZE}}{{UNIT}}',
95 ],
96 ],
97 'icon_gap' => [
98 'label' => esc_html__( 'Icon Gap (px)', 'shopbuilder' ),
99 'type' => 'slider',
100 'size_units' => [ 'px' ],
101 'range' => [
102 'px' => [
103 'min' => 0,
104 'max' => 100,
105 'step' => 1,
106 ],
107 ],
108 'default' => [
109 'size' => 5,
110 'unit' => 'px',
111 ],
112 'selectors' => [
113 $widget->selectors['icon_gap'] => 'margin-right: {{SIZE}}{{UNIT}}',
114 ],
115 ],
116 'meta_content_end' => [
117 'mode' => 'section_end',
118 ],
119 'in_stock_icon_section' => [
120 'mode' => 'section_start',
121 'label' => esc_html__( 'In Stock Icon', 'shopbuilder' ),
122 'tab' => 'content',
123 ],
124 'in_stock_icon' => [
125 'label' => esc_html__( 'Icon', 'shopbuilder' ),
126 'type' => 'icons',
127 'description' => sprintf(
128 /* translators: text*/
129 esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
130 '<b>' . esc_html__( 'In stork', 'shopbuilder' ) . '</b>'
131 ),
132 'default' => [
133 'value' => 'fas fa-check-circle',
134 'library' => 'fa-solid',
135 ],
136 'separator' => 'default',
137 ],
138 'in_stock_icon_end' => [
139 'mode' => 'section_end',
140 ],
141 'out_of_stock_icon_section' => [
142 'mode' => 'section_start',
143 'label' => esc_html__( 'Out Of Stock Icon', 'shopbuilder' ),
144 'tab' => 'content',
145 ],
146 'out_of_stock_icon' => [
147 'label' => esc_html__( 'Icon', 'shopbuilder' ),
148 'type' => 'icons',
149 'description' => sprintf(
150 /* translators: text*/
151 esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
152 '<b>' . esc_html__( 'Out of stork', 'shopbuilder' ) . '</b>'
153 ),
154 'default' => [
155 'value' => 'fas fa-times-circle',
156 'library' => 'fa-solid',
157 ],
158 'separator' => 'default',
159 ],
160 'out_of_stock_icon_end' => [
161 'mode' => 'section_end',
162 ],
163 'backorder_icon_section' => [
164 'mode' => 'section_start',
165 'label' => esc_html__( 'Backorder Stock Icon', 'shopbuilder' ),
166 'tab' => 'content',
167 ],
168 'stock_backorder_icon' => [
169 'label' => esc_html__( 'Icon', 'shopbuilder' ),
170 'type' => 'icons',
171 'description' => sprintf(
172 /* translators: text*/
173 esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
174 '<b>' . esc_html__( 'Backorder stock', 'shopbuilder' ) . '</b>'
175 ),
176 'default' => [
177 'value' => 'fas fa-shopping-cart',
178 'library' => 'fa-solid',
179 ],
180 'separator' => 'default',
181 ],
182 'backorder_icon_end' => [
183 'mode' => 'section_end',
184 ],
185 ];
186 return $fields;
187 }
188
189
190 }
191