| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace RadiusTheme\SB\Elementor\Widgets\Controls; |
| 9 | 9 | |
| 10 | -use Elementor\Controls_Manager; | |
| 10 | +use RadiusTheme\SB\Helpers\Fns; | |
| 11 | 11 | use RadiusTheme\SB\Elementor\Helper\ControlHelper; |
| 12 | 12 | |
| 13 | 13 | // Do not allow directly accessing this file. |
| 14 | 14 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -90,9 +90,10 @@ | ||
| 90 | 90 | 'size' => 16, |
| 91 | 91 | 'unit' => 'px', |
| 92 | 92 | ], |
| 93 | 93 | 'selectors' => [ |
| 94 | - $widget->selectors['icon_size'] => 'font-size: {{SIZE}}{{UNIT}}', | |
| 94 | + $widget->selectors['icon_size']['icon'] => 'font-size: {{SIZE}}{{UNIT}}', | |
| 95 | + $widget->selectors['icon_size']['svg'] => 'width: {{SIZE}}{{UNIT}}', | |
| 95 | 96 | ], |
| 96 | 97 | ], |
| 97 | 98 | 'icon_gap' => [ |
| 98 | 99 | 'label' => esc_html__( 'Icon Gap (px)', 'shopbuilder' ), |
| @@ -212,17 +213,46 @@ | ||
| 212 | 213 | /* translators: text*/ |
| 213 | 214 | esc_html__( 'Settings will work for %s product', 'shopbuilder' ), |
| 214 | 215 | '<b>' . esc_html__( 'Backorder stock', 'shopbuilder' ) . '</b>' |
| 215 | 216 | ), |
| 216 | - 'default' => [ | |
| 217 | + 'default' => [ | |
| 217 | 218 | 'value' => 'rtsb-icon rtsb-icon-cart', |
| 218 | 219 | 'library' => 'rtsb-fonts', |
| 219 | 220 | ], |
| 220 | 221 | 'separator' => 'default', |
| 221 | 222 | ], |
| 222 | - 'backorder_icon_end' => [ | |
| 223 | + ]; | |
| 224 | + | |
| 225 | + $fields['backorder_icon_end'] = [ | |
| 226 | + 'mode' => 'section_end', | |
| 227 | + ]; | |
| 228 | + | |
| 229 | + if ( Fns::is_module_active( 'pre_order' ) ) { | |
| 230 | + $fields['pre_order_icon_section'] = [ | |
| 231 | + 'mode' => 'section_start', | |
| 232 | + 'label' => esc_html__( 'Pre-Order Stock Icon', 'shopbuilder' ), | |
| 233 | + 'tab' => 'content', | |
| 234 | + ]; | |
| 235 | + | |
| 236 | + $fields['stock_pre_order_icon'] = [ | |
| 237 | + 'label' => esc_html__( 'Icon', 'shopbuilder' ), | |
| 238 | + 'type' => 'icons', | |
| 239 | + 'description' => sprintf( | |
| 240 | + /* translators: text*/ | |
| 241 | + esc_html__( 'Settings will work for %s product', 'shopbuilder' ), | |
| 242 | + '<b>' . esc_html__( 'Pre-Order stock', 'shopbuilder' ) . '</b>' | |
| 243 | + ), | |
| 244 | + 'default' => [ | |
| 245 | + 'value' => 'rtsb-icon rtsb-icon-cart', | |
| 246 | + 'library' => 'rtsb-fonts', | |
| 247 | + ], | |
| 248 | + 'separator' => 'default', | |
| 249 | + ]; | |
| 250 | + | |
| 251 | + $fields['pre_order_icon_end'] = [ | |
| 223 | 252 | 'mode' => 'section_end', |
| 224 | - ], | |
| 225 | - ]; | |
| 253 | + ]; | |
| 254 | + } | |
| 255 | + | |
| 226 | 256 | return $fields; |
| 227 | 257 | } |
| 228 | 258 | } |