# shopbuilder/1.1.4/app/Elementor/Widgets/Controls/StockSettings.php

ShopBuilder – WooCommerce Builder For Elementor, version 1.1.4. 191 lines.

- Page: https://pluginprobe.com/plugins/shopbuilder/1.1.4/code/app/Elementor/Widgets/Controls/StockSettings.php
- Raw: https://pluginprobe.com/plugins/shopbuilder/1.1.4/raw/app/Elementor/Widgets/Controls/StockSettings.php
- Modified: 2023-07-11T10:48:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shopbuilder/1.1.4/code/app/Elementor/Widgets/Controls/StockSettings.php#L10-L20`.

```php
<?php
/**
 * Main StockSettings class.
 *
 * @package RadiusTheme\SB
 */

namespace RadiusTheme\SB\Elementor\Widgets\Controls;

use Elementor\Controls_Manager;
use RadiusTheme\SB\Elementor\Helper\ControlHelper;

// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
	exit( 'This script cannot be accessed directly.' );
}

/**
 * Product Stock Settings class
 */
class StockSettings {
	/**
	 * Widget Field
	 *
	 * @return array
	 */
	public static function widget_fields( $widget ) {
		$alignment = ControlHelper::alignment();
		unset( $alignment['justify'] );
		$fields = [
			'stock_content'             => [
				'mode'  => 'section_start',
				'label' => esc_html__( 'Settings', 'shopbuilder' ),
				'tab'   => 'content',
			],
			'stock_text_typography'     => [
				'mode'     => 'group',
				'type'     => 'typography',
				'label'    => esc_html__( 'Typography', 'shopbuilder' ),
				'selector' => $widget->selectors['stock_text_typography'],
			],
			'in_stock_color'            => [
				'label'       => esc_html__( 'In Stock Text Color', 'shopbuilder' ),
				'type'        => 'color',
				'description' => sprintf(
					/* translators: text*/
					esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
					'<b>' . esc_html__( 'In stork', 'shopbuilder' ) . '</b>'
				),
				'selectors'   => [
					$widget->selectors['in_stock_color'] => 'color: {{VALUE}} !important',
				],
			],
			'outof_stock_color'         => [
				'label'       => esc_html__( 'Out Of Stock Text Color', 'shopbuilder' ),
				'type'        => 'color',
				'description' => sprintf(
					/* translators: text*/
					esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
					'<b>' . esc_html__( 'Out of stock', 'shopbuilder' ) . '</b>'
				),
				'selectors'   => [
					$widget->selectors['outof_stock_color'] => 'color: {{VALUE}} !important',
				],
			],
			'backorder_stock_color'     => [
				'label'       => esc_html__( 'Backorder Stock Text Color', 'shopbuilder' ),
				'type'        => 'color',
				'description' => sprintf(
					/* translators: text*/
					esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
					'<b>' . esc_html__( 'Backorder stock', 'shopbuilder' ) . '</b>'
				),
				'selectors'   => [
					$widget->selectors['backorder_stock_color'] => 'color: {{VALUE}} !important',
				],
			],
			'icon_size'                 => [
				'label'      => esc_html__( 'Icon Size (px)', 'shopbuilder' ),
				'type'       => 'slider',
				'size_units' => [ 'px' ],
				'range'      => [
					'px' => [
						'min'  => 0,
						'max'  => 100,
						'step' => 1,
					],
				],
				'default'    => [
					'size' => 16,
					'unit' => 'px',
				],
				'selectors'  => [
					$widget->selectors['icon_size'] => 'font-size: {{SIZE}}{{UNIT}}',
				],
			],
			'icon_gap'                  => [
				'label'      => esc_html__( 'Icon Gap (px)', 'shopbuilder' ),
				'type'       => 'slider',
				'size_units' => [ 'px' ],
				'range'      => [
					'px' => [
						'min'  => 0,
						'max'  => 100,
						'step' => 1,
					],
				],
				'default'    => [
					'size' => 5,
					'unit' => 'px',
				],
				'selectors'  => [
					$widget->selectors['icon_gap'] => 'margin-right: {{SIZE}}{{UNIT}}',
				],
			],
			'meta_content_end'          => [
				'mode' => 'section_end',
			],
			'in_stock_icon_section'     => [
				'mode'  => 'section_start',
				'label' => esc_html__( 'In Stock Icon', 'shopbuilder' ),
				'tab'   => 'content',
			],
			'in_stock_icon'             => [
				'label'       => esc_html__( 'Icon', 'shopbuilder' ),
				'type'        => 'icons',
				'description' => sprintf(
					/* translators: text*/
					esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
					'<b>' . esc_html__( 'In stork', 'shopbuilder' ) . '</b>'
				),
				'default'     => [
					'value'   => 'fas fa-check-circle',
					'library' => 'fa-solid',
				],
				'separator'   => 'default',
			],
			'in_stock_icon_end'         => [
				'mode' => 'section_end',
			],
			'out_of_stock_icon_section' => [
				'mode'  => 'section_start',
				'label' => esc_html__( 'Out Of Stock Icon', 'shopbuilder' ),
				'tab'   => 'content',
			],
			'out_of_stock_icon'         => [
				'label'       => esc_html__( 'Icon', 'shopbuilder' ),
				'type'        => 'icons',
				'description' => sprintf(
					/* translators: text*/
					esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
					'<b>' . esc_html__( 'Out of stork', 'shopbuilder' ) . '</b>'
				),
				'default'     => [
					'value'   => 'fas fa-times-circle',
					'library' => 'fa-solid',
				],
				'separator'   => 'default',
			],
			'out_of_stock_icon_end'     => [
				'mode' => 'section_end',
			],
			'backorder_icon_section'    => [
				'mode'  => 'section_start',
				'label' => esc_html__( 'Backorder Stock Icon', 'shopbuilder' ),
				'tab'   => 'content',
			],
			'stock_backorder_icon'      => [
				'label'       => esc_html__( 'Icon', 'shopbuilder' ),
				'type'        => 'icons',
				'description' => sprintf(
					/* translators: text*/
					esc_html__( 'Settings will work for %s product', 'shopbuilder' ),
					'<b>' . esc_html__( 'Backorder stock', 'shopbuilder' ) . '</b>'
				),
				'default'     => [
					'value'   => 'fas fa-shopping-cart',
					'library' => 'fa-solid',
				],
				'separator'   => 'default',
			],
			'backorder_icon_end'        => [
				'mode' => 'section_end',
			],
		];
		return $fields;
	}


}

```
