<?php
/**
 * @author      Elicus <hello@elicus.com>
 * @link        https://www.elicus.com/
 * @copyright   2024 Elicus Technologies Private Limited
 * @version     1.6.1
 */
class AIOC_ProductsCarousel extends ET_Builder_Module {
	public $slug       = 'aioc_products_carousel';
	public $vb_support = 'on';

	protected $module_credits = array(
		'module_uri' => 'https://diviextended.com/product/all-in-one-carousel-for-divi/',
		'author'     => 'Elicus',
		'author_uri' => 'https://elicus.com/',
	);

	/**
	 * Track if the module is currently rendering to prevent unnecessary rendering and recursion.
	 *
	 * @var bool
	 */
	protected static $rendering = false;

	public function init() {
		$this->name             = esc_html__( 'DE Products Carousel', 'all-in-one-carousel-for-divi' );
		$this->main_css_element = '%%order_class%%';
	}

	public function get_settings_modal_toggles() {
		return array(
			'general'  => array(
				'toggles' => array(
					'main_content'    => array(
						'title'    => esc_html__( 'Content', 'all-in-one-carousel-for-divi' ),
					),
					'display_setting' => array(
						'title'    => esc_html__( 'Display', 'all-in-one-carousel-for-divi' ),
					),
					'slider_settings' => array(
						'title' => esc_html__( 'Slider', 'all-in-one-carousel-for-divi' ),
						'sub_toggles'   => array(
							'general' => array(
								'name' => 'General',
							),
							'navigation' => array(
								'name' => 'Navigation',
							)
						),
						'tabbed_subtoggles' => true,
					),
				),
			),
			'advanced' => array(
				'toggles' => array(
					'product_settings'  => array(
						'title' => esc_html__( 'Product', 'all-in-one-carousel-for-divi' ),
					),
					'title_text'  => array(
						'title' => esc_html__( 'Title', 'all-in-one-carousel-for-divi' ),
					),
					'price_text' => array(
						'title' => esc_html__( 'Price', 'all-in-one-carousel-for-divi' ),
						 'sub_toggles' => array(
							'regular_price_text' => array(
								'name' => esc_html__( 'Regular Price', 'all-in-one-carousel-for-divi' ),
							),
							'sale_price_text' => array(
								'name' => esc_html__( 'Sale Price', 'all-in-one-carousel-for-divi' ),
							),
						),
						'tabbed_subtoggles' => true,
					),
					'sale_badge' => array(
						'title' => esc_html__( 'Sale Badge', 'all-in-one-carousel-for-divi' ),
					),
					'add_to_cart_button' => array (
						'title' => esc_html__( 'Add to Cart', 'all-in-one-carousel-for-divi' ),
					),
					'out_of_stock' => array (
						'title' => esc_html__( 'Out of Stock', 'all-in-one-carousel-for-divi' ),
					),
					'star_rating' => array (
						'title' => esc_html__( 'Star Rating', 'all-in-one-carousel-for-divi' ),
					),
					'slider_styles' => array(
						'title' => esc_html__( 'Slider', 'all-in-one-carousel-for-divi' ),
					),
					'quickview_link' => array(
						'title' => esc_html__( 'Quickview Button', 'all-in-one-carousel-for-divi' ),
					),
					'quickview_popup' => array(
						'title' => esc_html__( 'Quickview Lightbox', 'all-in-one-carousel-for-divi' ),
					),
					'quickview_title_text' => array(
						'title' => esc_html__( 'Quickview Product Title', 'all-in-one-carousel-for-divi' ),
					),
					'quickview_price_text' => array(
						'title' => esc_html__( 'Quickview Product Price', 'all-in-one-carousel-for-divi' ),
						'sub_toggles' => array(
							'regular_price_text' => array(
								'name' => esc_html__( 'Regular Price', 'all-in-one-carousel-for-divi' ),
							),
							'sale_price_text' => array(
								'name' => esc_html__( 'Sale Price', 'all-in-one-carousel-for-divi' ),
							),
						),
						'tabbed_subtoggles' => true,
					),
					'quickview_sale_badge' => array(
						'title' => esc_html__( 'Quickview Sale Badge', 'all-in-one-carousel-for-divi' ),
					),
					'quickview_desc_text' => array(
						'title' => esc_html__( 'Quickview Product Description', 'all-in-one-carousel-for-divi' ),
					),
					'quickview_addtocart' => array(
						'title' => esc_html__( 'Quickview Add to Cart', 'all-in-one-carousel-for-divi' ),
					),
				),
			),
		);
	}

	public function get_advanced_fields_config() {
		return array(
			'fonts' => array(
				'title' => array(
					'label'          => esc_html__( 'Title', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '18px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align'     => array(
						'default' => '',
						'default_on_front' => '',
					),
					'css'            => array(
						'main'       => "{$this->main_css_element} .aioc_swiper_wrapper .woocommerce-loop-product__title",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'title_text',
				),
				'price' => array(
					'label'          => esc_html__( 'Regular Price', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align'     => array(
						'default' => 'left',
						'default_on_front' => 'left',
					),
					'css' => array(
						'text_align' => "{$this->main_css_element} .aioc_swiper_wrapper ul.products li.product .price",
						'main'  => "{$this->main_css_element} .aioc_swiper_wrapper ul.products li.product .price, {$this->main_css_element} .aioc_swiper_wrapper ul.products li.product .price span, {$this->main_css_element} .aioc_swiper_wrapper ul.products li.product .price del, {$this->main_css_element} .aioc_swiper_wrapper ul.products li.product .price del span",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'price_text',
					'sub_toggle' => 'regular_price_text',
				),
				'sale_price' => array(
					'label'          => esc_html__( 'Sale Price', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'hide_text_align' => true,
					'css' => array(
						'main'  => "{$this->main_css_element} .aioc_swiper_wrapper ul.products li.product .price ins span",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'price_text',
					'sub_toggle' => 'sale_price_text',
				),
				'sale_badge' => array(
					'label'          => esc_html__( 'Sale Badge', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.2em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'hide_text_align' => true,
					'css' => array(
						'main'  => "{$this->main_css_element} .aioc_swiper_wrapper .aioc-onsale",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'sale_badge',
				),
				'add_to_cart' => array(
					'label' => esc_html__( 'Add to Cart Button', 'all-in-one-carousel-for-divi' ),
					'font_size' => array(
						'default'        => '20px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height' => array(
						'default'        => '1.2em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align' => array(
						'default' => '',
						'default_on_front' => '',
					),
					'css' => array(
						'main' => "{$this->main_css_element} .aioc_swiper_wrapper .add_to_cart_button, {$this->main_css_element} .aioc_swiper_wrapper .product a.button, {$this->main_css_element} .aioc_swiper_wrapper .product a.added_to_cart",
						'important' => 'all',
					),
					'tab_slug'       => 'advanced',
					'toggle_slug'    => 'add_to_cart_button',
				),
				'out_of_stock_label' => array(
					'label'          => esc_html__( 'Out of Stock', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '14px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.2em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_color' => array(
						'default' => '#f00',
					),
					'hide_text_align' => true,
					'css' => array(
						'main'  => "{$this->main_css_element} .aioc-products-soldout-wrap .out-of-stock",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'out_of_stock',
				),
				'star_rating_text' => array(
					'label'          => esc_html__( 'Star Rating', 'all-in-one-carousel-for-divi' ),
					'text_color' => array(
						'default' => ''
					),
					'font_size' => array(
						'default'        => '14px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align' => array(
						'default' => '',
						'options' => et_builder_get_text_orientation_options( array( 'justified' ), array() ),
					),
					'hide_line_height' => true,
					// 'hide_text_align' => true,
					// 'hide_text_color' => true,
					'hide_font'	=> true,
					'hide_text_shadow' => true,
					'css' => array(
						'text_align' => "{$this->main_css_element} .aioc_products_carousel_container .aioc-star-rating-wrap",
						'color'      => "{$this->main_css_element} .aioc_products_carousel_container .star-rating span:before",
						'main'       => "{$this->main_css_element} .aioc_products_carousel_container .star-rating",
						'important'  => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'star_rating',
				),
				'quickview_button' => array(
					'label'          => esc_html__( 'Quickview Link', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '14px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.7em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align' => array(
						'default' => 'center',
					),
					'css' => array(
						'main'  => "{$this->main_css_element} .aioc_swiper_wrapper .aioc_products_carousel_container li.product button.aioc-quick-view-button",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'quickview_link',
				),
				'quickview_title' => array(
					'label'          => esc_html__( 'Title', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '18px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align'     => array(
						'default' => 'left',
					),
					'css'            => array(
						'main'       => "{$this->main_css_element}_lightbox .woocommerce div.product .product_title",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'quickview_title_text',
				),
				'quickview_price' => array(
					'label'          => esc_html__( 'Regular Price', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align' => array(
						'default' => '',
					),
					'css' => array(
						'text_align' => "{$this->main_css_element}_lightbox .woocommerce div.product .price",
						'main'  => "{$this->main_css_element}_lightbox .woocommerce div.product .price, {$this->main_css_element}_lightbox .woocommerce div.product .price span, {$this->main_css_element}_lightbox .woocommerce div.product .price del, {$this->main_css_element}_lightbox .woocommerce div.product .price del span",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'quickview_price_text',
					'sub_toggle' => 'regular_price_text',
				),
				'quickview_sale_price' => array(
					'label'          => esc_html__( 'Sale Price', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'hide_text_align' => true,
					'css' => array(
						'main'  => "{$this->main_css_element}_lightbox .woocommerce div.product .price ins span",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
                    'toggle_slug' => 'quickview_price_text',
                    'sub_toggle' => 'sale_price_text',
				),
				'quickview_sale_badge' => array(
					'label'          => esc_html__( 'Sale Badge', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.2em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'hide_text_align' => true,
					'css' => array(
						'main'  => "{$this->main_css_element}_lightbox .woocommerce div.product .aioc-onsale",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'quickview_sale_badge',
				),
				'quickview_desc' => array(
					'label'          => esc_html__( 'Short Description', 'all-in-one-carousel-for-divi' ),
					'font_size'      => array(
						'default'        => '16px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height'    => array(
						'default'        => '1.5em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'text_align'     => array(
						'default' => 'left',
					),
					'css'            => array(
						'main'       => "{$this->main_css_element}_lightbox .woocommerce div.product .woocommerce-product-details__short-description",
						'important' => 'all',
					),
					'tab_slug'	=> 'advanced',
					'toggle_slug' => 'quickview_desc_text',
				),
				'quickview_addtocart' => array(
					'label' => esc_html__( 'Add to Cart Button', 'all-in-one-carousel-for-divi' ),
					'font_size' => array(
						'default'        => '20px',
						'range_settings' => array(
							'min'  => '1',
							'max'  => '100',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'line_height' => array(
						'default'        => '1.2em',
						'range_settings' => array(
							'min'  => '0.1',
							'max'  => '10',
							'step' => '0.1',
						),
					),
					'letter_spacing' => array(
						'default'        => '0px',
						'range_settings' => array(
							'min'  => '0',
							'max'  => '10',
							'step' => '1',
						),
						'validate_unit'  => true,
					),
					'hide_text_align' => true,
					'css' => array(
						'main' => "{$this->main_css_element}_lightbox .woocommerce div.product .single_add_to_cart_button",
						'important' => 'all',
					),
					'tab_slug'       => 'advanced',
					'toggle_slug'    => 'quickview_addtocart',
				),
			),
			'borders' => array(
				'product' => array(
					'label_prefix'    => esc_html__( 'Product', 'all-in-one-carousel-for-divi' ),
					'css' => array(
						'main' => array(
							'border_radii'  => '%%order_class%% .aioc_swiper_wrapper.woocommerce li.product, %%order_class%% .aioc_swiper_wrapper.woocommerce li.product:hover',
							'border_styles' => '%%order_class%% .aioc_swiper_wrapper.woocommerce li.product, %%order_class%% .aioc_swiper_wrapper.woocommerce li.product:hover',
							'important' => 'all',
						),
					),
					'tab_slug' => 'advanced',
					'toggle_slug' => 'product_settings',
				),
				'sale_badge' => array(
					'label_prefix'    => esc_html__( 'Sale Badge', 'all-in-one-carousel-for-divi' ),
					'css' => array(
						'main' => array(
							'border_radii'  => '%%order_class%% .aioc_products_carousel_container li.product .aioc-onsale, %%order_class%% .aioc_products_carousel_container li.product .aioc-onsale:hover',
							'border_styles' => '%%order_class%% .aioc_products_carousel_container li.product .aioc-onsale, %%order_class%% .aioc_products_carousel_container li.product .aioc-onsale:hover',
							'important' => 'all',
						),
					),
					'show_if'          => array(
						'show_sale_badge' => 'on',
					),
					'tab_slug' => 'advanced',
					'toggle_slug' => 'sale_badge',
				),
				'quickview_sale_badge' => array(
					'label_prefix'    => esc_html__( 'Sale Badge', 'all-in-one-carousel-for-divi' ),
					'css' => array(
						'main' => array(
							'border_radii'  => '%%order_class%%_lightbox .woocommerce div.product .aioc-onsale, %%order_class%%_lightbox .woocommerce div.product .aioc-onsale:hover',
							'border_styles' => '%%order_class%%_lightbox .woocommerce div.product .aioc-onsale, %%order_class%%_lightbox .woocommerce div.product .aioc-onsale:hover',
							'important' => 'all',
						),
					),
					'tab_slug' => 'advanced',
					'toggle_slug' => 'quickview_sale_badge',
				),
				'quickview_button' => array(
					'label_prefix'    => esc_html__( 'Quickview Button', 'all-in-one-carousel-for-divi' ),
					'css' => array(
						'main' => array(
							'border_radii'  => '%%order_class%% .aioc_swiper_wrapper .aioc_products_carousel_container li.product button.aioc-quick-view-button',
							'border_styles' => '%%order_class%% .aioc_swiper_wrapper .aioc_products_carousel_container li.product button.aioc-quick-view-button',
							'important' => 'all',
						),
					),
					'show_if'          => array(
						'enable_quickview' => 'on',
					),
					'tab_slug' => 'advanced',
					'toggle_slug' => 'quickview_link',
				),
				'add_to_cart_button' => array(
					'label_prefix'    => esc_html__( 'Add to Cart Button', 'all-in-one-carousel-for-divi' ),
					'css' => array(
						'main' => array(
							'border_radii'  => '%%order_class%% .aioc_swiper_wrapper .add_to_cart_button, %%order_class%% .aioc_swiper_wrapper .product a.button, %%order_class%% .aioc_swiper_wrapper .add_to_cart_button:hover, %%order_class%% .aioc_swiper_wrapper .product a.button:hover, %%order_class%% .aioc_swiper_wrapper .product a.added_to_cart, %%order_class%% .aioc_swiper_wrapper .product a.added_to_cart:hover',
							'border_styles' => '%%order_class%% .aioc_swiper_wrapper .add_to_cart_button, %%order_class%% .aioc_swiper_wrapper .product a.button, %%order_class%% .aioc_swiper_wrapper .add_to_cart_button:hover, %%order_class%% .aioc_swiper_wrapper .product a.button:hover, %%order_class%% .aioc_swiper_wrapper .product a.added_to_cart, %%order_class%% .aioc_swiper_wrapper .product a.added_to_cart:hover',
							'important' => 'all',
						),
					),
					'show_if'          => array(
						'show_add_to_cart' => 'on',
					),
					'tab_slug' => 'advanced',
					'toggle_slug' => 'add_to_cart_button',
				),
				'quickview_addtocart' => array(
					'label_prefix'    => esc_html__( 'Add to Cart Button', 'all-in-one-carousel-for-divi' ),
					'css' => array(
						'main' => array(
							'border_radii'  => '%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:hover',
							'border_styles' => '%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:hover',
							'important' => 'all',
						),
					),
					'show_if'          => array(
						'enable_quickview' => 'on',
					),
					'tab_slug' => 'advanced',
					'toggle_slug' => 'quickview_addtocart',
				),
				'default' => array(
					'css' => array(
						'main' => array(
							'border_radii'  => $this->main_css_element,
							'border_styles' => $this->main_css_element,
						),
					),
				),
			),
			'box_shadow' => array(
				'product' => array(
					'label'       => esc_html__( 'Product Box Shadow', 'all-in-one-carousel-for-divi' ),
					'css'         => array(
						'main' => "%%order_class%% .aioc_swiper_wrapper.woocommerce li.product",
						'important' => 'all',
					),
					'tab_slug'    => 'advanced',
					'toggle_slug' => 'product_settings',
				),
				'default' => array(
					'css' => array(
						'main' => $this->main_css_element,
						'important' => 'all',
					),
				),
			),
			'background' => array(
				'css' => array(
					'main' => $this->main_css_element,
				),
			),
			'slider_margin_padding' => array(
				'slider_container' => array(
					'margin_padding' => array(
						'css' => array(
							'use_margin' => false,
							'padding'   => "{$this->main_css_element} .aioc_products_carousel_container > .swiper-container",
							'important' => 'all',
						),
					),
				),
				'item' => array(
					'margin_padding' => array(
						'css' => array(
							'use_margin' => false,
							'padding'    => "{$this->main_css_element} .aioc_products_carousel_container li.product",
							'important'  => 'all',
						),
					),
				),
				'arrows' => array(
					'margin_padding' => array(
						'css' => array(
							'use_margin' => false,
							'padding'    => "{$this->main_css_element} .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-next, {$this->main_css_element} .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-prev",
							'important'  => 'all',
						),
					),
				),
			),
			'margin_padding' => array(
				'css' => array(
					'main'      => $this->main_css_element,
					'important' => 'all',
				),
			),
			'text' 			=> false,
			'filters'       => false,
			'link_options'  => false,
		);
	}

	public function get_fields() {
		return array_merge(
			array(
				'view_type' => array(
					'label'            => esc_html__( 'Product View Type', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select',
					'option_category'  => 'basic_option',
					'options'          => array(
						'default'          => esc_html__( 'Default', 'all-in-one-carousel-for-divi' ),
						'featured'         => esc_html__( 'Featured Products', 'all-in-one-carousel-for-divi' ),
						'sale'             => esc_html__( 'Sale Products', 'all-in-one-carousel-for-divi' ),
						'best_selling'     => esc_html__( 'Best Selling Products', 'all-in-one-carousel-for-divi' ),
						'top_rated'        => esc_html__( 'Top Rated Products', 'all-in-one-carousel-for-divi' ),
					),
					'default_on_front' => 'default',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Choose which type of product view you would like to display.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'use_current_loop' => array(
					'label'            => esc_html__( 'Use Current Loop', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'show_if'          => array(
						'function.isTBLayout' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Only include products for the current page. Useful on archive and index pages. For example let\'s say you used this module on a Theme Builder layout that is enabled for product categories. Selecting the "Sale Products" view type above and enabling this option would show only products that are on sale when viewing product categories.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'product_layout' => array(
					'label' 			=> esc_html__( 'Layout', 'all-in-one-carousel-for-divi' ),
					'type'              => 'select',
					'option_category'   => 'configuration',
					'options'           => array(
						'default'	=> esc_html__( 'Default', 'all-in-one-carousel-for-divi' ),
						'layout1'	=> esc_html__( 'Layout 1', 'all-in-one-carousel-for-divi' ),
						'layout2'   => esc_html__( 'Layout 2', 'all-in-one-carousel-for-divi' ),
					),
					'default'			=> 'default',
					'default_on_front'	=> 'default',
					'tab_slug'          => 'general',
					'toggle_slug'       => 'main_content',
					'description'       => esc_html__( 'Here you can select the layout to display products.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'products_number' => array(
					'label'            => esc_html__( 'Number of Products', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'default'          => 10,
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Here you can specify the total number of products to display.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'offset_number' => array(
					'label'            => esc_html__( 'Offset Number', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'default'          => 0,
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Choose how many products you would like to skip. These products will not be shown.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'products_order_by' => array(
					'label'            => esc_html__( 'Order by', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select',
					'option_category'  => 'configuration',
					'options'          => array(
						'date'     		=> esc_html__( 'Date', 'all-in-one-carousel-for-divi' ),
						'modified'		=> esc_html__( 'Modified Date', 'all-in-one-carousel-for-divi' ),
						'menu_order'	=> esc_html__( 'Menu Order', 'all-in-one-carousel-for-divi' ),
						'title'    		=> esc_html__( 'Title', 'all-in-one-carousel-for-divi' ),
						'name'     		=> esc_html__( 'Slug', 'all-in-one-carousel-for-divi' ),
						'ID'       		=> esc_html__( 'ID', 'all-in-one-carousel-for-divi' ),
						'rand'     		=> esc_html__( 'Random', 'all-in-one-carousel-for-divi' ),
						'price'			=> esc_html__( 'Price', 'all-in-one-carousel-for-divi' ),
						'stock_status'	=> esc_html__( 'Stock Status', 'all-in-one-carousel-for-divi' ),
						'none'     		=> esc_html__( 'None', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'date',
					'show_if_not'      => array(
						'view_type' => array( 'best_selling', 'top_rated', 'featured' ),
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Here you can specify the order in which the products will be displayed.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'products_order' => array(
					'label'            => esc_html__( 'Order', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select',
					'option_category'  => 'configuration',
					'options'          => array(
						'DESC' => esc_html__( 'DESC', 'all-in-one-carousel-for-divi' ),
						'ASC'  => esc_html__( 'ASC', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'DESC',
					'show_if_not'      => array(
						'view_type' => array( 'best_selling', 'top_rated', 'featured' ),
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Here you can specify the sorting order for the products.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'hide_out_of_stock' => array(
					'label'            => esc_html__( 'Hide Out of Stock Products', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Hide out of stock products from the loop.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'enable_out_of_stock_label' => array(
					'label'            => esc_html__( 'Display Out of Stock Label', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'show_if'		  => array(
						'hide_out_of_stock' => 'off',
					),
					'default'          => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Display Out of Stock label on products.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'out_of_stock_label' => array(
					'label'            => esc_html__( 'Out of Stock Label Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		  => array(
						'hide_out_of_stock' => 'off',
						'enable_out_of_stock_label' => 'on',
					),
					'default'		   => esc_html__( 'Out of Stock', 'all-in-one-carousel-for-divi' ),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Here you can specify the text for out of stock label.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'include_categories' => array(
					'label'            => esc_html__( 'Include Categories', 'all-in-one-carousel-for-divi' ),
					'type'             => 'categories',
					'renderer_options' => array(
						'use_terms' => true,
						'term_name' => 'product_cat',
						'field_name' => 'et_pb_include_aioc_product_cat',
					),
					'show_if'      	   => array(
						'use_current_loop' => 'off',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Select Categories. If no category is selected, products from all categories will be displayed.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'include_tags' => array(
					'label'            => esc_html__( 'Include Tags', 'all-in-one-carousel-for-divi' ),
					'type'             => 'categories',
					'renderer_options' => array(
						'use_terms' => true,
						'term_name' => 'product_tag',
						'field_name' => 'et_pb_include_aioc_product_tags',
					),
					'show_if'      	   => array(
						'use_current_loop' => 'off',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Select Tags. If no tag is selected, products from all tags will be displayed.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'taxonomies_relation' => array(
					'label'            => esc_html__( 'Taxonomies Relation', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select',
					'option_category'  => 'configuration',
					'options'          => array(
						'OR'   	=> esc_html__( 'OR', 'all-in-one-carousel-for-divi' ),
						'AND'	=> esc_html__( 'AND', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'OR',
					'show_if'		   => array(
						'use_current_loop' => 'off',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'This will set the relationship between taxonomies.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'no_result_text' => array(
					'label'            => esc_html__( 'No Result Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'default'		   => esc_html__( 'The products you requested could not be found. Try changing your module settings or create some new products.', 'all-in-one-carousel-for-divi' ),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'main_content',
					'description'      => esc_html__( 'Here you can define custom no result text.', 'all-in-one-carousel-for-divi' ),
				),
				'enable_quickview' => array(
					'label'           => esc_html__( 'Display Quickview Link', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'off',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'display_setting',
					'description'     => esc_html__( 'Choose whether or not the product quickview link should be displayed or not.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'quickview_link_text' => array(
					'label'            => esc_html__( 'Quickview Link Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		  => array(
						'enable_quickview' => 'on',
					),
					'default'		   => esc_html__( 'Quickview', 'all-in-one-carousel-for-divi' ),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the text for quickview link.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'hide_quickview_link_icon' => array(
					'label'           => esc_html__( 'Hide Quickview Link Icon', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'show_if'         => array(
						'enable_quickview' => 'on',
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Choose whether hide or show the icon for add to cart button.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'quickview_link_icon' => array(
					'label'            => esc_html__( 'Quickview Link Icon', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select_icon',
					// 'option_category'  => 'basic_option',
					'show_if'		  => array(
						'enable_quickview'         => 'on',
						'hide_quickview_link_icon' => 'off'
					),
					'default'		   => '&#xf06e;||fa||900',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the icon for quickview link.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'quickview_icon_on_hover' => array(
					'label'            		=> esc_html__( 'Quickview Show Icon On Hover', 'all-in-one-carousel-for-divi' ),
					'type'             		=> 'yes_no_button',
					'option_category'  		=> 'configuration',
					'options'          		=> array(
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
					),
					'default'          		=> 'on',
					'show_if'      			=> array(
						'enable_quickview' 		   => 'on',
						'hide_quickview_link_icon' => 'off'
					),
					'tab_slug'         		=> 'general',
					'toggle_slug'      		=> 'display_setting',
					'description'      		=> esc_html__( 'By default, button icons are displayed on hover. If you would like button icons to always be displayed, then you can disable this option.', 'all-in-one-carousel-for-divi' ),
				),
				'show_thumbnail' => array(
					'label'           => esc_html__( 'Show Thumbnail', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'on',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'display_setting',
					'description'     => esc_html__( 'Choose whether or not the product thumbnail should be visible.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'thumbnail_size' => array(
					'label'            => esc_html__( 'Thumbnail Size', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select',
					'option_category'  => 'configuration',
					'options'          => array(
						'woocommerce_thumbnail'	=> esc_html__( 'Woocommerce Thumbnail', 'all-in-one-carousel-for-divi' ),
						'woocommerce_single'	=> esc_html__( 'Woocommerce Single', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'woocommerce_thumbnail',
					'default_on_front' => 'woocommerce_thumbnail',
					'show_if'      	   => array(
						'show_thumbnail' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the size of product image.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'disable_lazyload' => array(
					'label'        	   => esc_html__( 'Disable Lazy Load', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'show_if'          => array(
						'show_thumbnail' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Enable this to disable lazy loading.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'show_rating' => array(
					'label'           => esc_html__( 'Show Star Rating', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'off',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'display_setting',
					'description'     => esc_html__( 'Choose whether or not the star rating should be visible.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'show_price' => array(
					'label'           => esc_html__( 'Show Price', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'on',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'display_setting',
					'description'     => esc_html__( 'Choose whether or not the price should be visible.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'show_add_to_cart' => array(
					'label'           => esc_html__( 'Show Add to Cart', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'off',
					'default_on_front' => 'off',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'display_setting',
					'description'     => esc_html__( 'Choose whether or not the add to cart button should be visible.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'hide_add_to_cart_icon' => array(
					'label'           => esc_html__( 'Hide Add to Cart Icon', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'show_if'         => array(
						'show_add_to_cart' => 'on',
					),
					'default'         => 'off',
					'default_on_front' => 'off',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'display_setting',
					'description'     => esc_html__( 'Choose whether hide or show the icon for add to cart button.', 'all-in-one-carousel-for-divi' ),
				),
				'add_to_cart_icon' => array(
					'label'           => esc_html__( 'Add to Cart Button Icon', 'all-in-one-carousel-for-divi' ),
					'type'            => 'select_icon',
					'option_category' => 'basic_option',
					'default'         => '',
					'show_if'         => array(
						'show_add_to_cart' => 'on',
						'hide_add_to_cart_icon' => 'off'
					),
					'tab_slug'        => 'general',
					'toggle_slug'     => 'display_setting',
					'description'     => esc_html__( 'Choose an icon to display.', 'all-in-one-carousel-for-divi' ),
				),
				'simple_add_to_cart_text' => array(
					'label'            => esc_html__( 'Simple Product Add to Cart Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		  => array(
						'show_add_to_cart' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the text for Simple Product Add to Cart.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'variable_add_to_cart_text' => array(
					'label'            => esc_html__( 'Variable Product Add to Cart Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		   => array(
						'show_add_to_cart' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the text for Variable Product Add to Cart.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'grouped_add_to_cart_text' => array(
					'label'            => esc_html__( 'Grouped Product Add to Cart Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		   => array(
						'show_add_to_cart' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the text for Grouped Product Add to Cart.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'external_add_to_cart_text' => array(
					'label'            => esc_html__( 'External Product Add to Cart Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		   => array(
						'show_add_to_cart' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the text for External Product Add to Cart.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'out_of_stock_add_to_cart_text' => array(
					'label'            => esc_html__( 'Out of Stock/Unpurchaseable Add to Cart Text', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		   => array(
						'show_add_to_cart' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the text for Out of stock/unpurchaseable Product Add to Cart.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'show_sale_badge' => array(
					'label'           	=> esc_html__( 'Show Sale Badge', 'all-in-one-carousel-for-divi' ),
					'type'            	=> 'yes_no_button',
					'option_category' 	=> 'configuration',
					'options'         	=> array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'         	=> 'on',
					'show_if'			=> array(
						'show_thumbnail' => 'on',
					),
					'tab_slug'        	=> 'general',
					'toggle_slug'     	=> 'display_setting',
					'description'     	=> esc_html__( 'Choose whether or not the sale badge should be visible.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' 	=> array(
						'__products_data',
					),
				),
				'sale_badge_text' => array(
					'label'           	=> esc_html__( 'Badge Text', 'all-in-one-carousel-for-divi' ),
					'type'              => 'select',
					'option_category'   => 'configuration',
					'options'           => array(
						'label'         => esc_html__( 'Sale Label', 'all-in-one-carousel-for-divi' ),
						'percentage'    => esc_html__( 'Sale Percentage', 'all-in-one-carousel-for-divi' ),
					),
					'default'			=> 'label',
					'default_on_front'	=> 'label',
					'show_if'			=> array(
						'show_thumbnail' 	=> 'on',
						'show_sale_badge' 	=> 'on',
					),
					'tab_slug'        	=> 'general',
					'toggle_slug'     	=> 'display_setting',
					'description'     	=> esc_html__( 'Choose which sale badge should be visible.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' 	=> array(
						'__products_data',
					),
				),
				'sale_label_text' => array(
					'label'            => esc_html__( 'Sale Label', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'show_if'		   => array(
						'show_thumbnail' 	=> 'on',
						'show_sale_badge' 	=> 'on',
						'sale_badge_text'	=> 'label',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'display_setting',
					'description'      => esc_html__( 'Here you can specify the text for Sale label.', 'all-in-one-carousel-for-divi' ),
					'computed_affects' => array(
						'__products_data',
					),
				),
				'slide_effect' => array(
					'label'           => esc_html__( 'Slide Effect', 'all-in-one-carousel-for-divi' ),
					'type'            => 'select',
					'option_category' => 'layout',
					'options'         => array(
						'slide'     => esc_html__( 'Slide', 'all-in-one-carousel-for-divi' ),
						'cube'      => esc_html__( 'Cube', 'all-in-one-carousel-for-divi' ),
						'coverflow' => esc_html__( 'Coverflow', 'all-in-one-carousel-for-divi' ),
						'flip'      => esc_html__( 'Flip', 'all-in-one-carousel-for-divi' ),
						'fade'      => esc_html__( 'Fade', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'slide',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'general',
					'description'     => esc_html__( 'Here you can choose the slide animation effect.', 'all-in-one-carousel-for-divi' ),
				),
				'products_per_slide' => array(
					'label'           => esc_html__( 'Products Per View', 'all-in-one-carousel-for-divi' ),
					'type'            => 'select',
					'option_category' => 'layout',
					'options'         => array(
						'1' => esc_html__( '1', 'all-in-one-carousel-for-divi' ),
						'2' => esc_html__( '2', 'all-in-one-carousel-for-divi' ),
						'3' => esc_html__( '3', 'all-in-one-carousel-for-divi' ),
						'4' => esc_html__( '4', 'all-in-one-carousel-for-divi' ),
						'5' => esc_html__( '5', 'all-in-one-carousel-for-divi' ),
						'6' => esc_html__( '6', 'all-in-one-carousel-for-divi' ),
						'7'  => esc_html__( '7', 'all-in-one-carousel-for-divi' ),
						'8'  => esc_html__( '8', 'all-in-one-carousel-for-divi' ),
						'9'  => esc_html__( '9', 'all-in-one-carousel-for-divi' ),
						'10'  => esc_html__( '10', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => '4',
					'mobile_options'  => true,
					'show_if'         => array(
						'slide_effect' => array( 'slide', 'coverflow' ),
					),
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'general',
					'description'     => esc_html__( 'Here you can choose the number of products to display per slide.', 'all-in-one-carousel-for-divi' ),
				),
				'slides_per_group' => array(
					'label'           => esc_html__( 'Number of Slides Per Group', 'all-in-one-carousel-for-divi' ),
					'type'            => 'select',
					'option_category' => 'layout',
					'options'         => array(
						'1'  => esc_html__( '1', 'all-in-one-carousel-for-divi' ),
						'2'  => esc_html__( '2', 'all-in-one-carousel-for-divi' ),
						'3'  => esc_html__( '3', 'all-in-one-carousel-for-divi' ),
						'4' => esc_html__( '4', 'all-in-one-carousel-for-divi' ),
						'5' => esc_html__( '5', 'all-in-one-carousel-for-divi' ),
						'6' => esc_html__( '6', 'all-in-one-carousel-for-divi' ),
						'7' => esc_html__( '7', 'all-in-one-carousel-for-divi' ),
						'8' => esc_html__( '8', 'all-in-one-carousel-for-divi' ),
						'9' => esc_html__( '9', 'all-in-one-carousel-for-divi' ),
						'10' => esc_html__( '10', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => '1',
					'mobile_options'  => true,
					'show_if'         => array(
						'slide_effect' => array( 'slide' ),
					),
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'general',
					'description'     => esc_html__( 'Here you can choose the number of slides per group to slide by.', 'all-in-one-carousel-for-divi' ),
				),
				'space_between_slides' => array(
					'label'           => esc_html__( 'Space between Slides', 'all-in-one-carousel-for-divi' ),
					'type'            => 'range',
					'option_category' => 'layout',
					'range_settings'  => array(
						'min'  => '10',
						'max'  => '100',
						'step' => '1',
					),
					'show_if'         => array(
						'slide_effect' => array( 'slide', 'coverflow' ),
					),
					'fixed_unit'	  => 'px',
					'default'         => '20px',
					'mobile_options'  => true,
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'general',
					'description'     => esc_html__( 'Move the slider or input the value to increse or decrease the space between slides.', 'all-in-one-carousel-for-divi' ),
				),
				'enable_coverflow_shadow' => array(
					'label'            => esc_html__( 'Enable Slide Shadow', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'show_if'          => array(
						'slide_effect' => 'coverflow',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'Enable Slide Shadow For Coverflow Effect.', 'all-in-one-carousel-for-divi' ),
				),
				'coverflow_shadow_color' => array(
					'label'        	   => esc_html__( 'Shadow Color', 'all-in-one-carousel-for-divi' ),
					'type'         	   => 'color-alpha',
					'custom_color' 	   => true,
					'show_if'          => array(
						'slide_effect' => 'coverflow',
						'enable_coverflow_shadow' => 'on',
					),
					'default'      	   => '#ccc',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'Here you can select color for the Shadow.', 'all-in-one-carousel-for-divi' ),
				),
				'coverflow_rotate' => array(
					'label'            => esc_html__( 'Coverflow Rotate', 'all-in-one-carousel-for-divi' ),
					'type'             => 'range',
					'option_category'  => 'font_option',
					'range_settings'   => array(
						'min'  => '1',
						'max'  => '360',
						'step' => '1',
					),
					'unitless'         => true,
					'show_if'          => array(
						'slide_effect' => 'coverflow',
					),
					'default'          => '40',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'Coverflow Rotate Slide.', 'all-in-one-carousel-for-divi' ),
				),
				'coverflow_depth' => array(
					'label'            => esc_html__( 'Coverflow Depth', 'all-in-one-carousel-for-divi' ),
					'type'             => 'range',
					'option_category'  => 'font_option',
					'range_settings'   => array(
						'min'  => '1',
						'max'  => '1000',
						'step' => '1',
					),
					'unitless'         => true,
					'show_if'          => array(
						'slide_effect' => 'coverflow',
					),
					'default'          => '100',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'Coverflow Depth Slide.', 'all-in-one-carousel-for-divi' ),
				),
				'equalize_slides_height' => array(
					'label'            => esc_html__( 'Equalize Slides Height', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'Choose whether or not equalize slides height.', 'all-in-one-carousel-for-divi' ),
				),
				'auto_height_slider' => array(
					'label'           => esc_html__( 'Auto Height Slider', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'show_if'          => array(
						'equalize_slides_height' => 'off',
					),
					'options'         => array(
						'off' => esc_html__( 'Off', 'all-in-one-carousel-for-divi' ),
						'on'  => esc_html__( 'On', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'off',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'general',
					'description'     => esc_html__( 'Here you can choose whether or not slider height should adjust according to each slide.', 'all-in-one-carousel-for-divi' ),
				),
				'slider_loop' => array(
					'label'            => esc_html__( 'Enable Loop', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'Here you can enable loop for the slides.', 'all-in-one-carousel-for-divi' ),
				),
				'autoplay' => array(
					'label'            => esc_html__( 'Autoplay', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'on',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'This controls the auto play the slider.', 'all-in-one-carousel-for-divi' ),
				),
				'enable_linear_transition'	=> array(
					'label'           => esc_html__( 'Enable Linear Transition', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'off',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'general',
					'description'     => esc_html__( 'Here you can choose whether or not to enable linear transition between slides.', 'all-in-one-carousel-for-divi' ),
				),
				'autoplay_speed' => array(
					'label'            => esc_html__( 'Autoplay Delay', 'all-in-one-carousel-for-divi' ),
					'type'             => 'text',
					'option_category'  => 'configuration',
					'default'          => '3000',
					'show_if'          => array(
						'autoplay' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'This controls the time of the slide before the transition.', 'all-in-one-carousel-for-divi' ),
				),
				'pause_on_hover' => array(
					'label'            => esc_html__( 'Pause On Hover', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'on',
					'show_if'          => array(
						'autoplay' => 'on',
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'general',
					'description'      => esc_html__( 'Control for pausing slides on mouse hover.', 'all-in-one-carousel-for-divi' ),
				),
				'slide_transition_duration' => array(
					'label'           => esc_html__( 'Transition Duration', 'all-in-one-carousel-for-divi' ),
					'type'            => 'text',
					'option_category' => 'configuration',
					'default'         => '1000',
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'general',
					'description'     => esc_html__( 'Here you can specify the duration of transition for each slide in miliseconds.', 'all-in-one-carousel-for-divi' ),
				),
				'show_arrow' => array(
					'label'            => esc_html__( 'Show Arrows', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'navigation',
					'description'      => esc_html__( 'Choose whether or not the previous & next arrows should be visible.', 'all-in-one-carousel-for-divi' ),
				),
				'previous_slide_arrow' => array(
					'label'           => esc_html__( 'Previous Arrow', 'all-in-one-carousel-for-divi' ),
					'type'            => 'select_icon',
					'option_category' => 'basic_option',
					'class'           => array(
						'et-pb-font-icon',
					),
					'show_if'         => array(
						'show_arrow' => 'on',
					),
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'navigation',
					'description'     => esc_html__( 'Here you can select the icon to be used for the previous slide navigation.', 'all-in-one-carousel-for-divi' ),
				),
				'next_slide_arrow' => array(
					'label'           => esc_html__( 'Next Arrow', 'all-in-one-carousel-for-divi' ),
					'type'            => 'select_icon',
					'option_category' => 'basic_option',
					'class'           => array(
						'et-pb-font-icon',
					),
					'show_if'         => array(
						'show_arrow' => 'on',
					),
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'navigation',
					'description'     => esc_html__( 'Here you can select the icon to be used for the next slide navigation.', 'all-in-one-carousel-for-divi' ),
				),
				'show_arrow_on_hover' => array(
					'label'            => esc_html__( 'Show Arrows On Hover', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'show_if'          => array(
						'show_arrow' => 'on',
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'navigation',
					'description'      => esc_html__( 'Choose whether or not the previous and next arrows should be visible.', 'all-in-one-carousel-for-divi' ),
				),
				'arrows_position' => array(
					'label'           => esc_html__( 'Arrows Position', 'all-in-one-carousel-for-divi' ),
					'type'            => 'select',
					'option_category' => 'layout',
					'options'         => array(
						'inside' 		=> esc_html__( 'Inside', 'all-in-one-carousel-for-divi' ),
						'outside'		=> esc_html__( 'Outside', 'all-in-one-carousel-for-divi' ),
						'top_left'      => esc_html__( 'Top Left', 'all-in-one-carousel-for-divi' ),
						'top_right'     => esc_html__( 'Top Right', 'all-in-one-carousel-for-divi' ),
						'top_center'    => esc_html__( 'Top Center', 'all-in-one-carousel-for-divi' ),
						'bottom_left'   => esc_html__( 'Bottom Left', 'all-in-one-carousel-for-divi' ),
						'bottom_right'  => esc_html__( 'Bottom Right', 'all-in-one-carousel-for-divi' ),
						'bottom_center' => esc_html__( 'Bottom Center', 'all-in-one-carousel-for-divi' ),
					),
					'default'         => 'inside',
					'mobile_options'  => true,
					'show_if'         => array(
						'show_arrow' => 'on',
					),
					'tab_slug'        => 'general',
					'toggle_slug'     => 'slider_settings',
					'sub_toggle'	  => 'navigation',
					'description'     => esc_html__( 'Here you can choose the arrows position.', 'all-in-one-carousel-for-divi' ),
				),
				'show_control_dot' => array(
					'label'            => esc_html__( 'Show Dots Pagination', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'navigation',
					'description'      => esc_html__( 'This setting will turn on and off the pagination of the slider.', 'all-in-one-carousel-for-divi' ),
				),
				'control_dot_style' => array(
					'label'            => esc_html__( 'Dots Pagination Style', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select',
					'option_category'  => 'layout',
					'options'          => array(
						'solid_dot'       => esc_html__( 'Solid Dot', 'all-in-one-carousel-for-divi' ),
						'transparent_dot' => esc_html__( 'Transparent Dot', 'all-in-one-carousel-for-divi' ),
						'stretched_dot'   => esc_html__( 'Stretched Dot', 'all-in-one-carousel-for-divi' ),
						'line'            => esc_html__( 'Line', 'all-in-one-carousel-for-divi' ),
						'rounded_line'    => esc_html__( 'Rounded Line', 'all-in-one-carousel-for-divi' ),
						'square_dot'      => esc_html__( 'Squared Dot', 'all-in-one-carousel-for-divi' ),
						'number_dot'      => esc_html__( 'Number Dot', 'all-in-one-carousel-for-divi' ),
					),
					'show_if'          => array(
						'show_control_dot' => 'on',
					),
					'default'          => 'solid_dot',
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'navigation',
					'description'      => esc_html__( 'control dot style', 'all-in-one-carousel-for-divi' ),
				),
				'enable_dynamic_dots' => array(
					'label'            => esc_html__( 'Enable Dynamic Dots', 'all-in-one-carousel-for-divi' ),
					'type'             => 'yes_no_button',
					'option_category'  => 'configuration',
					'options'          => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'default'          => 'off',
					'show_if'          => array(
						'show_control_dot' => 'on',
						'control_dot_style' => array(
							'solid_dot',
							'transparent_dot',
							'square_dot',
							'number_dot'
						),
					),
					'tab_slug'         => 'general',
					'toggle_slug'      => 'slider_settings',
					'sub_toggle'	   => 'navigation',
					'description'      => esc_html__( 'This setting will turn on and off the dynamic pagination of the slider.', 'all-in-one-carousel-for-divi' ),
				),
				'arrows_custom_padding' => array(
					'label'                 => esc_html__( 'Arrows Padding', 'all-in-one-carousel-for-divi' ),
					'type'                  => 'custom_padding',
					'option_category'       => 'layout',
					'show_if'         		=> array(
						'show_arrow' => 'on',
					),
					'default'				=> '5px|10px|5px|10px|true|true',
					'default_on_front'		=> '5px|10px|5px|10px|true|true',
					'mobile_options'        => true,
					'hover'                 => false,
					'tab_slug'              => 'advanced',
					'toggle_slug'           => 'slider_styles',
					'description'           => esc_html__( 'Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'all-in-one-carousel-for-divi' ),
				),
				'arrow_font_size' => array(
					'label'           => esc_html__( 'Arrow Font Size', 'all-in-one-carousel-for-divi' ),
					'type'            => 'range',
					'option_category' => 'layout',
					'range_settings'  => array(
						'min'  => '10',
						'max'  => '100',
						'step' => '1',
					),
					'show_if'         => array(
						'show_arrow' => 'on',
					),
					'default'         => '24px',
					'tab_slug'        => 'advanced',
					'toggle_slug'     => 'slider_styles',
					'description'     => esc_html__( 'Here you can choose the arrow font size.', 'all-in-one-carousel-for-divi' ),
				),
				'arrow_color' => array(
					'label'        => esc_html__( 'Arrow Color', 'all-in-one-carousel-for-divi' ),
					'type'         => 'color-alpha',
					'custom_color' => true,
					'show_if'      => array(
						'show_arrow' => 'on',
					),
					'hover'        => 'tabs',
					'tab_slug'     => 'advanced',
					'toggle_slug'  => 'slider_styles',
					'description'  => esc_html__( 'Here you can define color for the arrow', 'all-in-one-carousel-for-divi' ),
				),
				'arrow_background_color' => array(
					'label'        => esc_html__( 'Arrow Background', 'all-in-one-carousel-for-divi' ),
					'type'         => 'color-alpha',
					'custom_color' => true,
					'show_if'      => array(
						'show_arrow' => 'on',
					),
					'hover'        => 'tabs',
					'tab_slug'     => 'advanced',
					'toggle_slug'  => 'slider_styles',
					'description'  => esc_html__( 'Here you can choose a custom color to be used for the shape background of arrows.', 'all-in-one-carousel-for-divi' ),
				),
				'arrow_background_border_size' => array(
					'label'           => esc_html__( 'Arrow Background Border', 'all-in-one-carousel-for-divi' ),
					'type'            => 'range',
					'option_category' => 'layout',
					'range_settings'  => array(
						'min'  => '1',
						'max'  => '10',
						'step' => '1',
					),
					'show_if' 		  => array(
						'show_arrow' => 'on',
					),
					'default'         => '0px',
					'tab_slug'        => 'advanced',
					'toggle_slug'     => 'slider_styles',
					'description'     => esc_html__( 'Move the slider or input the value to increase or decrease the border size of the arrow background.', 'all-in-one-carousel-for-divi' ),
				),
				'arrow_background_border_color' => array(
					'label'        => esc_html__( 'Arrow Background Border Color', 'all-in-one-carousel-for-divi' ),
					'type'         => 'color-alpha',
					'custom_color' => true,
					'show_if'      => array(
						'show_arrow' => 'on',
					),
					'hover'        => 'tabs',
					'tab_slug'     => 'advanced',
					'toggle_slug'  => 'slider_styles',
					'description'  => esc_html__( 'Here you can choose a custom color to be used for the arrow border', 'all-in-one-carousel-for-divi' ),
				),
				'control_dot_active_color' => array(
					'label'        	   => esc_html__( 'Active Dot Pagination Color', 'all-in-one-carousel-for-divi' ),
					'type'         	   => 'color-alpha',
					'custom_color'     => true,
					'show_if'          => array(
						'show_control_dot' => 'on',
					),
					'default'      	   => '#000000',
					'tab_slug'     	   => 'advanced',
					'toggle_slug'  	   => 'slider_styles',
					'description'  	   => esc_html__( 'Here you can define color for the active pagination item.', 'all-in-one-carousel-for-divi' ),
				),
				'control_dot_inactive_color' => array(
					'label'        	   => esc_html__( 'Inactive Dot Pagination Color', 'all-in-one-carousel-for-divi' ),
					'type'         	   => 'color-alpha',
					'custom_color'     => true,
					'show_if'	=> array(
						'show_control_dot' => 'on',
					),
					'default'      	   => '#cccccc',
					'tab_slug'     	   => 'advanced',
					'toggle_slug'  	   => 'slider_styles',
					'description'  	   => esc_html__( 'Here you can define color for the inactive pagination item.', 'all-in-one-carousel-for-divi' ),
				),
				'number_dot_text_color' => array(
					'label'        	   => esc_html__( 'Number Dot Color', 'all-in-one-carousel-for-divi' ),
					'type'         	   => 'color-alpha',
					'custom_color'     => true,
					'show_if'      	   => array(
						'show_control_dot'  => 'on',
						'control_dot_style' => 'number_dot',
					),
					'default'      	   => '#ffffff',
					'tab_slug'     	   => 'advanced',
					'toggle_slug'  	   => 'slider_styles',
					'description'  	   => esc_html__( 'Here you can define color for the number of pagination item.', 'all-in-one-carousel-for-divi' ),
				),
				'quickview_button_bg_color' => array(
					'label'				=> esc_html__( 'Quickview Link Background', 'all-in-one-carousel-for-divi' ),
					'type'         	    => 'background-field',
					'base_name'         => 'quickview_button_bg',
	                'context'           => 'quickview_button_bg_color',
	                'option_category'   => 'button',
	                'custom_color'      => true,
	                'background_fields'	=> $this->generate_background_options( 'quickview_button_bg', 'button', 'advanced', 'quickview_link', 'quickview_button_bg_color' ),
	                'hover'             => 'tabs',
					'show_if'	=> array(
						'enable_quickview' => 'on',
					),
					'default'				=> '#f5f5f5',
					'default_on_front'		=> '#f5f5f5',
					'tab_slug'				=> 'advanced',
					'toggle_slug'			=> 'quickview_link',
					'description'			=> esc_html__( 'Customize the background style of the quickview link by adjusting the background color.', 'all-in-one-carousel-for-divi' ),
				),
				'quickview_icon_size' => array(
					'label'             => esc_html__( 'Quickview Link Icon Size', 'divi-gallery-extended' ),
					'type'              => 'range',
					'option_category'  	=> 'layout',
					'range_settings'    => array(
						'min'   => '0',
						'max'   => '100',
						'step'  => '1',
					),
					'fixed_unit'		=> 'px',
					'fixed_range'       => true,
					'validate_unit'		=> true,
					'mobile_options'    => true,
					'default'           => '16px',
					'default_on_front'  => '16px',
					'show_if'         	=> array(
						'enable_quickview' => 'on',
					),
					'tab_slug'        	=> 'advanced',
					'toggle_slug'     	=> 'quickview_link',
					'description'       => esc_html__( 'Increase or decrease icon font size.', 'divi-gallery-extended' ),
				),
				'sale_badge_bg_color' => array(
					'label'        	   => esc_html__( 'Sale Badge Background Color', 'all-in-one-carousel-for-divi' ),
					'type'         	   => 'color-alpha',
					'custom_color' 	   => true,
					'show_if'          => array(
						'show_thumbnail'	=> 'on',
						'show_sale_badge' 	=> 'on',
					),
					'default'      	   => '',
					'default_on_front' => '',
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'sale_badge',
					'description'      => esc_html__( 'Here you can select the backround color for the sale badge.', 'all-in-one-carousel-for-divi' ),
				),
				'quickview_sale_badge_bg_color' => array(
					'label'        	   => esc_html__( 'Sale Badge Background Color', 'all-in-one-carousel-for-divi' ),
					'type'         	   => 'color-alpha',
					'custom_color' 	   => true,
					'default'      	   => '',
					'default_on_front' => '',
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'quickview_sale_badge',
					'description'      => esc_html__( 'Here you can select the backround color for the sale badge on lightbox.', 'all-in-one-carousel-for-divi' ),
				),
				'product_bg_color'  => array(
					'label'        	    => esc_html__( 'Product Background', 'all-in-one-carousel-for-divi' ),
					'type'         	    => 'background-field',
					'base_name'         => 'product_bg',
	                'context'           => 'product_bg_color',
	                'option_category'   => 'button',
	                'custom_color'      => true,
	                'background_fields'	=> $this->generate_background_options( 'product_bg', 'button', 'advanced', 'product_settings', 'product_bg_color' ),
	                'hover'             => 'tabs',
					'default'      	   => '',
					'default_on_front' => '',
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'product_settings',
					'description'      => esc_html__( 'Here you can select the backround color for the product.', 'all-in-one-carousel-for-divi' ),
				),
				'add_to_cart_bg_color'  => array(
					'label'        	    => esc_html__( 'Add to Cart Background', 'all-in-one-carousel-for-divi' ),
					'type'         	    => 'background-field',
					'base_name'         => 'add_to_cart_bg',
	                'context'           => 'add_to_cart_bg_color',
	                'option_category'   => 'button',
	                'custom_color'      => true,
	                'background_fields'	=> $this->generate_background_options( 'add_to_cart_bg', 'button', 'advanced', 'add_to_cart_button', 'add_to_cart_bg_color' ),
	                'hover'             => 'tabs',
					'show_if'           => array(
						'show_add_to_cart'	=> 'on',
					),
					'default'      	   => '',
					'default_on_front' => '',
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'add_to_cart_button',
					'description'      => esc_html__( 'Here you can select the backround color for the add to cart button.', 'all-in-one-carousel-for-divi' ),
				),
				'add_to_cart_icon_size' => array(
					'label'             => esc_html__( 'Add to Cart Icon Size', 'divi-gallery-extended' ),
					'type'              => 'range',
					'option_category'  	=> 'layout',
					'range_settings'    => array(
						'min'   => '0',
						'max'   => '100',
						'step'  => '1',
					),
					'fixed_unit'		=> 'px',
					'fixed_range'       => true,
					'validate_unit'		=> true,
					'mobile_options'    => true,
					'default'           => '28px',
					'default_on_front'  => '28px',
					'show_if'         	=> array(
						'show_add_to_cart' => 'on',
					),
					'tab_slug'        	=> 'advanced',
					'toggle_slug'     	=> 'add_to_cart_button',
					'description'       => esc_html__( 'Increase or decrease icon font size.', 'divi-gallery-extended' ),
				),
				'quickview_addtocart_button_bg_color' => array(
					'label'        	   => esc_html__( 'Add to Cart Background Color', 'all-in-one-carousel-for-divi' ),
					'type'         	    => 'background-field',
					'base_name'         => 'quickview_addtocart_button_bg',
	                'context'           => 'quickview_addtocart_button_bg_color',
	                'option_category'   => 'button',
	                'custom_color'      => true,
	                'background_fields'	=> $this->generate_background_options( 'quickview_addtocart_button_bg', 'button', 'advanced', 'quickview_addtocart', 'quickview_addtocart_button_bg_color' ),
	                'hover'             => 'tabs',
					'show_if'          => array(
						'enable_quickview'	=> 'on',
					),
					'default'      	   => '',
					'default_on_front' => '',
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'quickview_addtocart',
					'description'      => esc_html__( 'Here you can select the backround color for the add to cart button.', 'all-in-one-carousel-for-divi' ),
				),
				'quickview_hide_addtocart_icon' => array(
					'label'           => esc_html__( 'Hide Add to Cart Icon', 'all-in-one-carousel-for-divi' ),
					'type'            => 'yes_no_button',
					'option_category' => 'configuration',
					'options'         => array(
						'on'  => esc_html__( 'Yes', 'all-in-one-carousel-for-divi' ),
						'off' => esc_html__( 'No', 'all-in-one-carousel-for-divi' ),
					),
					'show_if'         => array(
						'enable_quickview' => 'on',
					),
					'default'          => 'off',
					'default_on_front' => 'off',
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'quickview_addtocart',
					'description'      => esc_html__( 'Choose whether hide or show the icon for add to cart button.', 'all-in-one-carousel-for-divi' ),
				),
				'quickview_addtocart_icon' => array(
					'label'            => esc_html__( 'Add to Cart Icon', 'all-in-one-carousel-for-divi' ),
					'type'             => 'select_icon',
					'option_category'  => 'basic_option',
					'show_if'		  => array(
						'enable_quickview'              => 'on',
						'quickview_hide_addtocart_icon' => 'off'
					),
					'default'		   => '',
					'default_on_front' => '',
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'quickview_addtocart',
					'description'      => esc_html__( 'Here you can specify the icon for Add to Cart button on lightbox.', 'all-in-one-carousel-for-divi' ),
				),
				'quickview_addtocart_icon_size' => array(
	         		'label'             => esc_html__( 'Add to Cart Icon Size', 'divi-gallery-extended' ),
					'type'              => 'range',
					'option_category'  	=> 'layout',
					'range_settings'    => array(
						'min'   => '0',
						'max'   => '100',
						'step'  => '1',
					),
					'fixed_unit'		=> 'px',
					'fixed_range'       => true,
					'validate_unit'		=> true,
					'mobile_options'    => true,
					'default'           => '32px',
					'default_on_front'  => '32px',
					'show_if'         	=> array(
	           'enable_quickview'              => 'on',
						'quickview_hide_addtocart_icon' => 'off'
	                ),
					'tab_slug'        	=> 'advanced',
					'toggle_slug'     	=> 'quickview_addtocart',
					'description'       => esc_html__( 'Increase or decrease icon font size.', 'divi-gallery-extended' ),
	            ),
				'lightbox_content_width' => array(
					'label'           => esc_html__( 'Lightbox Content Width', 'all-in-one-carousel-for-divi' ),
					'type'            => 'range',
					'option_category' => 'layout',
					'range_settings'  => array(
						'min'  => '1',
						'max'  => '100',
						'step' => '1',
					),
					'mobile_options' => true,
					'show_if' 		  => array(
						'enable_quickview' => 'on',
					),
					'default'         => '70%',
					'default_on_front'=> '70%',
					'tab_slug'        => 'advanced',
					'toggle_slug'     => 'quickview_popup',
					'description'     => esc_html__( 'Move the slider or input the value to increase or decrease the width of lightbox content.', 'all-in-one-carousel-for-divi' ),
				),
				'lightbox_bg_color' => array(
					'label'        => esc_html__( 'Lightbox Background Color', 'all-in-one-carousel-for-divi' ),
					'type'         => 'color-alpha',
					'custom_color' => true,
					'default'	   => 'rgba(11, 11, 11, 0.8)',
					'show_if'      => array(
						'enable_quickview' => 'on',
					),
					'tab_slug'     => 'advanced',
					'toggle_slug'  => 'quickview_popup',
					'description'  => esc_html__( 'Here you can define a custom background color for the lightbox.', 'all-in-one-carousel-for-divi' ),
				),
				'lightbox_close_icon_color' => array(
					'label'            => esc_html__( 'Close Icon Color', 'all-in-one-carousel-for-divi' ),
					'type'             => 'color-alpha',
					'default'          => '#000',
					'show_if'          => array(
						'enable_quickview' => 'on',
					),
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'quickview_popup',
					'description'      => esc_html__( 'Here you can define a custom color to be used for the close icon.', 'all-in-one-carousel-for-divi' ),
				),
				'slider_container_custom_padding' => array(
					'label'            => esc_html__( 'Slider Container Padding', 'all-in-one-carousel-for-divi' ),
					'type'             => 'custom_padding',
					'option_category'  => 'layout',
					'default'		   => '',
					'default_on_front' => '',
					'mobile_options'   => true,
					'hover'            => false,
					'tab_slug'         => 'advanced',
					'toggle_slug'      => 'margin_padding',
					'description'      => esc_html__( 'Padding adds extra space to the inside of the element, increasing the distance between the edge of the element and its inner contents.', 'all-in-one-carousel-for-divi' ),
				),
				'item_custom_padding' => array(
					'label'                 => esc_html__( 'Product Padding', 'all-in-one-carousel-for-divi' ),
					'type'                  => 'custom_padding',
					'option_category'       => 'layout',
					'default'				=> '',
					'default_on_front'		=> '',
					'mobile_options'        => true,
					'hover'                 => false,
					'tab_slug'              => 'advanced',
					'toggle_slug'           => 'product_settings',
					'description'           => esc_html__( 'Padding adds extra space to the inside of the product item, increasing the distance between the edge of the element and its inner contents.', 'all-in-one-carousel-for-divi' ),
				),
				'__products_data' => array(
					'type'                => 'computed',
					'computed_callback'   => array( 'AIOC_ProductsCarousel', 'get_computed_products_data' ),
					'computed_depends_on' => array(
						'view_type',
						'use_current_loop',
						'product_layout',
						'products_number',
						'offset_number',
						'products_order_by',
						'hide_out_of_stock',
						'out_of_stock_label',
						'enable_out_of_stock_label',
						'products_order',
						'include_categories',
						'include_tags',
						'taxonomies_relation',
						'enable_quickview',
						'quickview_link_icon',
						'hide_quickview_link_icon',
						'quickview_link_text',
						'show_thumbnail',
						'thumbnail_size',
						'disable_lazyload',
						'show_rating',
						'show_price',
						'show_add_to_cart',
						'simple_add_to_cart_text',
						'variable_add_to_cart_text',
						'grouped_add_to_cart_text',
						'external_add_to_cart_text',
						'out_of_stock_add_to_cart_text',
						'show_sale_badge',
						'sale_badge_text',
						'sale_label_text',
					),
				),
			),
			$this->generate_background_options( 'product_bg', 'skip', 'advanced', 'product_settings', 'product_bg_color' ),
			$this->generate_background_options( 'add_to_cart_bg', 'skip', 'advanced', 'add_to_cart_button', 'add_to_cart_bg_color' ),
			$this->generate_background_options( 'quickview_button_bg', 'skip', 'advanced', 'quickview_link', 'quickview_button_bg_color' ),
			$this->generate_background_options( 'quickview_addtocart_button_bg', 'skip', 'advanced', 'quickview_addtocart', 'quickview_addtocart_button_bg_color' )
		);
	}

	/**
	 * This function return values to react for front end builder.
	 *
	 * @param array arguments to get products data
	 * @return array
	 * */
	public static function get_computed_products_data( $args = array(), $conditional_tags = array(), $current_page = array() ) {
		if ( self::$rendering ) {
			// We are trying to render a Blog module while a Blog module is already being rendered
			// which means we have most probably hit an infinite recursion. While not necessarily
			// the case, rendering a post which renders a Blog module which renders a post
			// which renders a Blog module is not a sensible use-case.
			return '';
		}

		$defaults = array(
			'view_type'		                => 'default',
			'use_current_loop'              => 'off',
			'product_layout'                => 'default',
			'products_number'               => 10,
			'offset_number'                 => 0,
			'products_order_by'             => 'date',
			'products_order'                => 'DESC',
			'hide_out_of_stock'	            => 'off',
			'enable_out_of_stock_label'     => 'off',
			'out_of_stock_label'            => '',
			'include_categories'            => '',
			'include_tags'                  => '',
			'taxonomies_relation'           => 'OR',
			'enable_quickview'	            => 'off',
			'quickview_link_text'           => '',
			'quickview_link_icon'           => '',
			'hide_quickview_link_icon'      => '',
			'show_thumbnail'	            => 'on',
			'thumbnail_size'	            => 'woocommerce_thumbnail',
			'disable_lazyload'              => 'off',
			'show_rating'		            => 'off',
			'show_price'		            => 'on',
			'show_add_to_cart'	            => 'off',
			'simple_add_to_cart_text'       => '',
			'variable_add_to_cart_text'     => '',
			'grouped_add_to_cart_text'      => '',
			'external_add_to_cart_text'     => '',
			'out_of_stock_add_to_cart_text' => '',
			'show_sale_badge' 	            => 'on',
			'sale_badge_text'	            => 'label',
			'sale_label_text'               => '',
			'compute_mode'		            => true
		);
		$args = wp_parse_args( $args, $defaults );

		global $aioc_product_carousel_args;
		$aioc_product_carousel_args = $args;

		$qu_args	= aioc_products_carousel_prepare_query_args( $args );
		$pro_query	= new WP_Query( $qu_args );

		self::$rendering = true;
		$output_array = array();
		if ( $pro_query->have_posts() ) {

			aioc_products_carousel_before_hooks( $args );
			do_action( 'aioc_products_carousel_before_wraper', $args );
			
			// Loop the products
			while ( $pro_query->have_posts() ) { $pro_query->the_post();
				$output_array[] = wc_get_template_html( 'content-product.php' );
			}

			aioc_products_carousel_after_hooks( $args );
			do_action( 'waioc_products_carousel_after_wraper', $args );

			wp_reset_postdata();
		}

		self::$rendering = false;

		return et_core_intentionally_unescaped( $output_array, 'html' );
	}

	public function render( $attrs, $content, $render_slug ) {
		if ( self::$rendering ) {
			// We are trying to render a DIPL Woo Product module while a DIPL Woo Product module is already being rendered
			// which means we have most probably hit an infinite recursion. While not necessarily
			// the case, rendering a post which renders a Blog module which renders a post
			// which renders a Blog module is not a sensible use-case.
			return '';
		}

		global $aioc_product_carousel_args;
		$aioc_product_carousel_args = $this->props;

		// Create a query args
		$qu_args	= aioc_products_carousel_prepare_query_args( $this->props );
		$pro_query	= new WP_Query( $qu_args );

		$output = '';

		self::$rendering = true;
		if ( $pro_query->have_posts() ) {

			// Load frontend styles and scripts
			if ( class_exists( 'WC_Frontend_Scripts' ) ) {
				$frontend_scripts = new \WC_Frontend_Scripts();
				$frontend_scripts::load_scripts();
			}

			// Load plugin styles and scripts
			wp_enqueue_script( 'elicus-swiper-script' );
			wp_enqueue_style( 'elicus-swiper-style' );
			wp_enqueue_style( 'aioc-swiper-style' );

			if ( isset($this->props['enable_quickview']) && 'on' === $this->props['enable_quickview'] ) {
				
				// Load for quick view popup
				wp_enqueue_script( 'wc-single-product' );
				wp_enqueue_script( 'wc-add-to-cart-variation' );
				wp_enqueue_script( 'zoom' );
				wp_enqueue_script( 'flexslider' );
				wp_enqueue_script( 'photoswipe-ui-default' );

				wp_enqueue_script( 'magnific-popup' );
				wp_enqueue_style( 'magnific-popup' );
			}

			wp_enqueue_script( 'aioc-products-carousel', ALL_IN_ONE_CAROUSEL_FOR_DIVI_PATH . "includes/modules/ProductsCarousel/aioc-products-carousel.min.js", array('jquery'), '1.0.0', true );
			wp_localize_script( 'aioc-products-carousel', 'AiocProductsCarouselData', array(
	            'ajaxurl'   => admin_url( 'admin-ajax.php' ),
	            'nonce' 	=> wp_create_nonce( 'elicus-aioc-products-carousel-nonce' ),
	            'siteurl'   => site_url(),
				'loading'	=> esc_html__( 'Loading...', 'all-in-one-carousel-for-divi' ),
	        ) );

			$file = et_is_builder_plugin_active() ? 'style-dbp' : 'style';
        	wp_enqueue_style( 'aioc-products-carousel-style', ALL_IN_ONE_CAROUSEL_FOR_DIVI_PATH . 'includes/modules/ProductsCarousel/' . $file . '.min.css', array(), '1.0.0' );

			aioc_products_carousel_before_hooks( $this->props );
			do_action( 'aioc_products_carousel_before_wraper', $this->props );

			$equalize_slides_height = $this->props['equalize_slides_height'];

			// Add containers
			$output .= sprintf( 
				'<div class="aioc_swiper_wrapper woocommerce">
					<div class="aioc_products_carousel_container aioc_swiper_inner_wrap %1$s %2$s">
						<div class="swiper-container">
							<ul class="products swiper-wrapper">',
				!empty( $this->props['product_layout'] ) ? esc_attr( $this->props['product_layout'] ) : 'default',
				( 'on' === $equalize_slides_height ) ? 'equal-slide-height' : ''
			);

			// Loop the products
			while ( $pro_query->have_posts() ) { $pro_query->the_post();
				$output .= wc_get_template_html( 'content-product.php' );
			}

			$output .= sprintf( 
				'</ul"></div><!-- /.swiper-container -->'
			);

			// Navigation controls
			$show_arrow = $this->props['show_arrow'];
			if ( 'on' === $show_arrow ) {
				$next = sprintf(
					'<div class="swiper-button-next"%1$s></div>',
					'' !== $this->props['next_slide_arrow'] 
						? sprintf( ' data-next_slide_arrow="%1$s"', esc_attr( et_pb_process_font_icon( $this->props['next_slide_arrow'] ) ) ) 
					: ''
				);
				$prev = sprintf(
					'<div class="swiper-button-prev"%1$s></div>',
					'' !== $this->props['previous_slide_arrow']
						? sprintf( ' data-previous_slide_arrow="%1$s"', esc_attr( et_pb_process_font_icon( $this->props['previous_slide_arrow'] ) ) ) 
					: ''
				);

				$arrows_position = et_pb_responsive_options()->get_property_values( $this->props, 'arrows_position' );
				$arrows_position = array_filter( $arrows_position );

				if ( ! empty( $arrows_position ) ) {
					$arrows_position_data = '';
					foreach( $arrows_position as $device => $value ) {
						$arrows_position_data .= ' data-arrows_' . $device . '="' . $value . '"';
					}
				}

				$output .= sprintf(
					'<div class="aioc_swiper_navigation" %3$s>%1$s %2$s</div>',
					$next, $prev,
					! empty( $arrows_position_data ) ? $arrows_position_data : ''
				);

				// Font size for arrows
				$arrow_font_size = et_pb_responsive_options()->get_property_values( $this->props, 'arrow_font_size' );
				if ( ! empty( array_filter( $arrow_font_size ) ) ) {
					et_pb_responsive_options()->generate_responsive_css( $arrow_font_size, '%%order_class%% .aioc_swiper_navigation .swiper-button-prev, %%order_class%% .aioc_swiper_navigation .swiper-button-next', 'font-size', $render_slug, '!important;', 'range' );
				}

				$show_arrow_on_hover = $this->props['show_arrow_on_hover'];
				if ( 'on' === $show_arrow_on_hover ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev',
						'declaration' => 'visibility: hidden; opacity: 0; transition: all 300ms ease;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-next',
						'declaration' => 'visibility: hidden; opacity: 0; transition: all 300ms ease;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%:hover .aioc_swiper_navigation .swiper-button-prev, %%order_class%%:hover .aioc_swiper_navigation .swiper-button-next',
						'declaration' => 'visibility: visible; opacity: 1;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%:hover .aioc_swiper_navigation .swiper-button-prev.swiper-button-disabled, %%order_class%%:hover .aioc_swiper_navigation .swiper-button-next.swiper-button-disabled',
						'declaration' => 'opacity: 0.35;',
					) );
					
					// Outside Slider.
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_arrows_outside .swiper-button-prev',
						'declaration' => 'left: 50px;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_arrows_outside .swiper-button-next',
						'declaration' => 'right: 50px;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%:hover .aioc_arrows_outside .swiper-button-prev',
						'declaration' => 'left: 0;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%:hover .aioc_arrows_outside .swiper-button-next',
						'declaration' => 'right: 0;',
					) );

					// Inside Slider.
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_arrows_inside .swiper-button-prev',
						'declaration' => 'left: -50px;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_arrows_inside .swiper-button-next',
						'declaration' => 'right: -50px;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%:hover .aioc_arrows_inside .swiper-button-prev',
						'declaration' => 'left: 0;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%:hover .aioc_arrows_inside .swiper-button-next',
						'declaration' => 'right: 0;',
					) );
				}

				$arrow_color = $this->props['arrow_color'];
				if ( $arrow_color ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev, %%order_class%% .aioc_swiper_navigation .swiper-button-next',
						'declaration' => sprintf( 'color: %1$s !important;', esc_attr( $arrow_color ) ),
					) );
				}
				$arrow_color_hover = $this->get_hover_value( 'arrow_color' );
				if ( $arrow_color_hover ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev:hover, %%order_class%% .aioc_swiper_navigation .swiper-button-next:hover',
						'declaration' => sprintf( 'color: %1$s !important;', esc_attr( $arrow_color_hover ) ),
					) );
				}

				$arrow_background_color = $this->props['arrow_background_color'];
				if ( '' !== $arrow_background_color ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev, %%order_class%% .aioc_swiper_navigation .swiper-button-next',
						'declaration' => sprintf( 'background: %1$s !important;', esc_attr( $arrow_background_color ) ),
					) );
				}
				$arrow_background_color_hover = $this->get_hover_value( 'arrow_background_color' );
				if ( '' !== $arrow_background_color_hover ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev:hover, %%order_class%% .aioc_swiper_navigation .swiper-button-next:hover',
						'declaration' => sprintf( 'background: %1$s !important;', esc_attr( $arrow_background_color_hover ) ),
					) );
				}

				$arrow_background_border_size = $this->props['arrow_background_border_size'];
				if ( '' !== $arrow_background_border_size ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev, %%order_class%% .aioc_swiper_navigation .swiper-button-next',
						'declaration' => sprintf( 'border-width: %1$s;', esc_attr( $arrow_background_border_size ) ),
					) );
				}
				$arrow_background_border_color = $this->props['arrow_background_border_color'];
				if ( '' !== $arrow_background_border_color ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev, %%order_class%% .aioc_swiper_navigation .swiper-button-next',
						'declaration' => sprintf( 'border-color: %1$s;', esc_attr( $arrow_background_border_color ) ),
					) );
				}
				$arrow_background_border_color_hover = $this->get_hover_value( 'arrow_background_border_color' );
				if ( '' !== $arrow_background_border_color_hover ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_navigation .swiper-button-prev:hover, %%order_class%% .aioc_swiper_navigation .swiper-button-next:hover',
						'declaration' => sprintf( 'border-color: %1$s;', esc_attr( $arrow_background_border_color_hover ) ),
					) );
				}
			}

			$output .= '</div> <!-- dipl_woo_products_carousel_layout -->';

			// Dot controls
			$show_control_dot  = $this->props['show_control_dot'];
			$control_dot_style = $this->props['control_dot_style'];
			if ( 'on' === $show_control_dot ) {
				$output .= sprintf(
					'<div class="aioc_swiper_pagination"><div class="swiper-pagination %1$s"></div></div>',
					esc_attr( $control_dot_style )
				);
			}

			$enable_linear_transition = $this->props['enable_linear_transition'];
			if ( 'on' === $enable_linear_transition ) {
				self::set_style( $render_slug, array(
					'selector'    => '%%order_class%% .swiper-wrapper',
					'declaration' => 'transition-timing-function : linear !important;',
				) );
			}

			$output .= '</div><!-- /.aioc_swiper_wrapper -->';

			// Add custom slider script
			$output .= $this->aioc_render_products_carousel_script();

			aioc_products_carousel_after_hooks( $this->props );
			do_action( 'waioc_products_carousel_after_wraper', $this->props );

			wp_reset_postdata();

			if ( '' !== $this->props['next_slide_arrow'] ) {
				self::set_style( $render_slug, array(
					'selector'    => '%%order_class%% .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-next::after',
					'declaration' => 'display: flex; align-items: center; height: 100%; content: attr(data-next_slide_arrow);',
				) );
				if ( class_exists( 'ET_Builder_Module_Helper_Style_Processor' ) && method_exists( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ) ) {
					$this->generate_styles( array(
						'utility_arg'    => 'icon_font_family',
						'render_slug'    => $render_slug,
						'base_attr_name' => 'next_slide_arrow',
						'important'      => true,
						'selector'       => '%%order_class%% .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-next::after',
						'processor'      => array( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ),
					) );
				} else {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-next::after',
						'declaration' => 'font-family: "ETmodules";',
					) );
				}
			}
			if ( '' !== $this->props['previous_slide_arrow'] ) {
				self::set_style( $render_slug, array(
					'selector'    => '%%order_class%% .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-prev::after',
					'declaration' => 'display: flex; align-items: center; height: 100%; content: attr(data-previous_slide_arrow);',
				) );
				if ( class_exists( 'ET_Builder_Module_Helper_Style_Processor' ) && method_exists( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ) ) {
					$this->generate_styles( array(
						'utility_arg'    => 'icon_font_family',
						'render_slug'    => $render_slug,
						'base_attr_name' => 'previous_slide_arrow',
						'important'      => true,
						'selector'       => '%%order_class%% .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-prev::after',
						'processor'      => array( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ),
					) );
				} else {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-prev::after',
						'declaration' => 'font-family: "ETmodules";',
					) );
				}
			}

			// Quick view button.
			if ( isset($this->props['enable_quickview']) && 'on' === $this->props['enable_quickview'] ) {

				// hide quickview link icon.
				$hide_quickview_link_icon = ! empty( $this->props['hide_quickview_link_icon'] ) ? $this->props['hide_quickview_link_icon'] : 'off';
				
				// Quick view icon button.
				if ( ! empty( $this->props['quickview_link_icon'] ) && 'off' === $hide_quickview_link_icon ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_wrapper li.product .aioc-quick-view-button:after',
						'declaration' => 'content: attr(data-icon);',
					) );
					
					if ( class_exists( 'ET_Builder_Module_Helper_Style_Processor' ) && method_exists( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ) ) {
						$this->generate_styles( array(
							'utility_arg'    => 'icon_font_family',
							'render_slug'    => $render_slug,
							'base_attr_name' => 'quickview_link_icon',
							'important'      => true,
							'selector'       => '%%order_class%% .aioc_swiper_wrapper li.product .aioc-quick-view-button:after',
							'processor'      => array( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ),
						) );
					}

					if ( 'off' === $this->props['quickview_icon_on_hover'] ) {
						self::set_style( $render_slug, array(
							'selector'    => '%%order_class%% .aioc_swiper_wrapper .products li.product button.aioc-quick-view-button, %%order_class%% .aioc_swiper_wrapper .products li.product button.aioc-quick-view-button:hover',
							'declaration' => 'padding: 10px !important;',
						) );
						self::set_style( $render_slug, array(
							'selector'    => '%%order_class%% .aioc_swiper_wrapper .products li.product button.aioc-quick-view-button::after',
							'declaration' => 'position: relative; opacity: 1; margin-left: .15em; left: auto; padding-left: 0;',
						) );
					}

					$quickview_icon_size 	= et_pb_responsive_options()->get_property_values( $this->props, 'quickview_icon_size' );
					et_pb_responsive_options()->generate_responsive_css( $quickview_icon_size, '%%order_class%% .aioc_swiper_wrapper li.product .aioc-quick-view-button::after', 'font-size', $render_slug, '', 'range' );
				} else {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_wrapper li.product .aioc-quick-view-button::after',
						'declaration' => 'display: none !important;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_wrapper .products li.product button.aioc-quick-view-button, %%order_class%% .aioc_swiper_wrapper .products li.product button.aioc-quick-view-button:hover',
						'declaration' => 'padding: 0.3em 1em !important;',
					) );
				}
			}

			// If add to cart icon is there.
			if ( 'on' === $this->props['show_add_to_cart'] ) {
				if ( 'on' === $this->props['hide_add_to_cart_icon'] ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_wrapper li.product a.button::after',
						'declaration' => 'display: none !important;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_wrapper li.product a.button:hover',
						'declaration' => 'padding: 0.3em 1em !important;',
					) );
				} elseif ( ! empty( $this->props['add_to_cart_icon'] ) ) {

					$add_to_cart_icon = str_replace( '&#x', '\\', esc_attr( et_pb_process_font_icon( $this->props['add_to_cart_icon'] ) ) );
					$add_to_cart_icon = str_replace( ';', '', $add_to_cart_icon );

					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_wrapper li.product a.button::after',
						'declaration' => sprintf( 'content: "%1$s";', $add_to_cart_icon ),
					) );

					if ( class_exists( 'ET_Builder_Module_Helper_Style_Processor' ) && method_exists( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ) ) {
						$this->generate_styles( array(
							'utility_arg'    => 'icon_font_family',
							'render_slug'    => $render_slug,
							'base_attr_name' => 'add_to_cart_icon',
							'important'      => true,
							'selector'       => '%%order_class%% .aioc_swiper_wrapper li.product a.button::after',
							'processor'      => array(
								'ET_Builder_Module_Helper_Style_Processor',
								'process_extended_icon',
							),
						) );
					}
				}
			}

			$enable_quickview = $this->props['enable_quickview'];
			if ( 'on' === $enable_quickview ) {
				$lightbox_bg_color = $this->props['lightbox_bg_color'];
				self::set_style( $render_slug, array(
					'selector'    => "{$this->main_css_element}_lightbox.mfp-bg",
					'declaration' => sprintf('background-color: %1$s !important;', esc_attr( $lightbox_bg_color ) ),
				) );
				$lightbox_close_icon_color	= $this->props['lightbox_close_icon_color'];
				self::set_style( $render_slug, array(
					'selector'    => "{$this->main_css_element}_lightbox .mfp-close",
					'declaration' => sprintf('color: %1$s !important;', esc_attr( $lightbox_close_icon_color ) ),
				) );
				$lightbox_content_width	= et_pb_responsive_options()->get_property_values( $this->props, 'lightbox_content_width' );
				et_pb_responsive_options()->generate_responsive_css( $lightbox_content_width, "{$this->main_css_element}_lightbox .mfp-content", 'width', $render_slug, '!important;', 'range' );
				
				$quickview_sale_badge_bg_color = $this->props['quickview_sale_badge_bg_color'];
				if ( !empty( $quickview_sale_badge_bg_color ) ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%_lightbox .woocommerce div.product .aioc-onsale',
						'declaration' => sprintf( 'background-color: %1$s !important;', esc_attr( $quickview_sale_badge_bg_color ) ),
					) );
				}

				if ( 'on' === $this->props['quickview_hide_addtocart_icon'] ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:after, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button.added_to_cart:after',
						'declaration' => 'display: none !important;',
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:hover, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button.added_to_cart:hover',
						'declaration' => 'padding: 0.3em 1em !important;',
					) );
				} else {
					if ( ! empty( $this->props['quickview_addtocart_icon'] ) ) {
						self::set_style( $render_slug, array(
							'selector'    => '%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:after, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button.added_to_cart:after',
							'declaration' => sprintf( 'content: "%1$s";', esc_attr( et_pb_extended_process_font_icon( $this->props['quickview_addtocart_icon'] ) ) ),
						) );
	
						if ( class_exists( 'ET_Builder_Module_Helper_Style_Processor' ) && method_exists( 'ET_Builder_Module_Helper_Style_Processor', 'process_extended_icon' ) ) {
							$this->generate_styles( array(
								'utility_arg'    => 'icon_font_family',
								'render_slug'    => $render_slug,
								'base_attr_name' => 'quickview_addtocart_icon',
								'important'      => true,
								'selector'       => '%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:after, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button.added_to_cart:after',
								'processor'      => array(
									'ET_Builder_Module_Helper_Style_Processor',
									'process_extended_icon',
								),
							) );
						}
	
						if ( 'off' === $this->props['quickview_icon_on_hover'] ) {
							self::set_style( $render_slug, array(
								'selector'    => '%%order_class%% .aioc_swiper_wrapper li.product .aioc-quick-view-button',
								'declaration' => 'padding-right: 2.3em; padding-left: 0.8em;',
							) );
							self::set_style( $render_slug, array(
								'selector'    => '%%order_class%% .aioc_swiper_wrapper li.product .aioc-quick-view-button::after',
								'declaration' => 'opacity: 1; margin-left: .15em; left: auto;',
							) );
						}
					}

					$quickview_addtocart_icon_size 	= et_pb_responsive_options()->get_property_values( $this->props, 'quickview_addtocart_icon_size' );
					et_pb_responsive_options()->generate_responsive_css( $quickview_addtocart_icon_size, '%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:after, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button.added_to_cart:after', 'font-size', $render_slug, '', 'range' );
				}
			}

			$enable_coverflow_shadow = $this->props['enable_coverflow_shadow'];
			if ( 'on' === $enable_coverflow_shadow ) {
				self::set_style( $render_slug, array(
					'selector'    => '%%order_class%% .swiper-container-3d .swiper-slide-shadow-left',
					'declaration' => sprintf( 'background-image: linear-gradient(to left,%1$s,rgba(0,0,0,0)) !important;', esc_attr( $coverflow_shadow_color ) ),
				) );
				self::set_style( $render_slug, array(
					'selector'    => '%%order_class%% .swiper-container-3d .swiper-slide-shadow-right',
					'declaration' => sprintf( 'background-image: linear-gradient(to right,%1$s,rgba(0,0,0,0)) !important;', esc_attr( $coverflow_shadow_color ) ),
				) );
			} else {
				self::set_style( $render_slug, array(
					'selector'    => '%%order_class%% .swiper-container-3d .swiper-slide-shadow-left, %%order_class%% .swiper-container-3d .swiper-slide-shadow-right',
					'declaration' => 'background-image: none !important;',
				) );
			}

			if ( 'on' === $show_control_dot ) {
				$control_dot_inactive_color = $this->props['control_dot_inactive_color'];
				if ( $control_dot_inactive_color ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_pagination .swiper-pagination-bullet',
						'declaration' => sprintf( 'background: %1$s !important;', esc_attr( $control_dot_inactive_color ) ),
					) );
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_pagination .transparent_dot .swiper-pagination-bullet',
						'declaration' => sprintf( 'border-color: %1$s;', esc_attr( $control_dot_inactive_color ) ),
					) );
				}
				$control_dot_active_color = $this->props['control_dot_active_color'];
				if ( $control_dot_active_color ) {
					self::set_style( $render_slug, array(
							'selector'    => '%%order_class%% .aioc_swiper_pagination .swiper-pagination-bullet.swiper-pagination-bullet-active',
							'declaration' => sprintf( 'background: %1$s !important;', esc_attr( $control_dot_active_color ) ),
						)
					);
				}
				$slide_transition_duration = $this->props['control_dot_active_color'];
				if ( 'stretched_dot' === $control_dot_style && $slide_transition_duration ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .aioc_swiper_pagination .stretched_dot .swiper-pagination-bullet',
						'declaration' => sprintf( 'transition: all %1$sms ease;', intval( $slide_transition_duration ) ),
					) );
				}
				$number_dot_text_color = $this->props['number_dot_text_color']; 
				if ( ! empty( $number_dot_text_color ) ) {
					self::set_style( $render_slug, array(
						'selector'    => '%%order_class%% .swiper-pagination-bullet.number-bullet',
						'declaration' => sprintf( 'color: %1$s;', esc_attr( $number_dot_text_color ) ),
					) );
				}
			}

			$sale_badge_bg_color = $this->props['sale_badge_bg_color'];
			if ( !empty( $sale_badge_bg_color ) ) {
				self::set_style( $render_slug, array(
					'selector'    => '%%order_class%% .aioc_products_carousel_container li.product .aioc-onsale',
					'declaration' => sprintf( 'background-color: %1$s !important;', esc_attr( $sale_badge_bg_color ) ),
				) );
			}

			$add_to_cart_icon_size 	= et_pb_responsive_options()->get_property_values( $this->props, 'add_to_cart_icon_size' );
			et_pb_responsive_options()->generate_responsive_css( $add_to_cart_icon_size, '%%order_class%% .aioc_swiper_wrapper li.product .add_to_cart_button::after, %%order_class%% .aioc_swiper_wrapper li.product a.button::after', 'font-size', $render_slug, '', 'range' );

			$fields = array( 'slider_margin_padding' );
			AIOC_Helper::process_advanced_margin_padding_css( $this, $render_slug, $this->margin_padding, $fields );
		}

		$args = array(
			'render_slug'	=> $render_slug,
			'props'			=> $this->props,
			'fields'		=> $this->fields_unprocessed,
			'module'		=> $this,
			'backgrounds' 	=> array(
				'product_bg' => array(
					'normal' => "%%order_class%% .aioc_swiper_wrapper .products li.product",
					'hover' => "%%order_class%% .aioc_swiper_wrapper .products li.product:hover",
				),
				'add_to_cart_bg' => array(
					'normal' => "%%order_class%% .aioc_swiper_wrapper .add_to_cart_button, %%order_class%% .aioc_swiper_wrapper .product a.button, %%order_class%% .aioc_swiper_wrapper .product a.added_to_cart",
					'hover' => "%%order_class%% .aioc_swiper_wrapper .add_to_cart_button:hover, %%order_class%% .aioc_swiper_wrapper .product a.button:hover, %%order_class%% .aioc_swiper_wrapper .product a.added_to_cart:hover",
				),
				'quickview_button_bg' => array(
					'normal' => "%%order_class%% .aioc_swiper_wrapper .products li.product button.aioc-quick-view-button",
					'hover' => "%%order_class%% .aioc_swiper_wrapper .products li.product button.aioc-quick-view-button:hover",
				 ),
				'quickview_addtocart_button_bg' => array(
					'normal' => "%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button.added_to_cart",
					'hover' => "%%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button:hover, %%order_class%%_lightbox .woocommerce div.product .single_add_to_cart_button.added_to_cart:hover",
				),
			),
		);
		AIOC_Helper::process_background( $args );

		self::$rendering = false;

		return et_core_intentionally_unescaped( $output, 'html' );
	}

	public function before_render() {
		$is_responsive = et_pb_responsive_options()->is_responsive_enabled( $this->props, 'products_per_slide' );
		if ( ! $is_responsive ) {
			$products_per_slide = $this->props['products_per_slide'];
			if ( 'slide' === $this->props['slide_effect'] ) {
				$products_per_slide_tablet = $products_per_slide < 3 ? $products_per_slide : 2;
				$products_per_slide_mobile = 1;
			} elseif ( 'coverflow' === $this->props['slide_effect'] ) {
				$products_per_slide_tablet = 3;
				$products_per_slide_mobile = 1;
			}
			if ( isset( $products_per_slide_tablet ) && '' !== $products_per_slide_tablet ) {
				$this->props['products_per_slide_tablet'] = $products_per_slide_tablet;
			}
			if ( isset( $products_per_slide_mobile ) && '' !== $products_per_slide_mobile ) {
				$this->props['products_per_slide_phone'] = $products_per_slide_mobile;
			}
		}
	}

	/**
	 * This function dynamically creates script parameters according to the user settings
	 *
	 * @return string
	 * */
	public function aioc_render_products_carousel_script() {

		$order_class = $this->get_module_order_class( 'aioc_products_carousel' );

		$products_per_view        		= 1;
		$products_per_view_ipad   		= 1;
		$products_per_view_mobile 		= 1;

		$products_space_between   		= 0;
		$products_space_between_ipad	= 0;
		$products_space_between_mobile	= 0;

		$slidesPerGroup 			= 1;
		$slidesPerGroupIpad			= 1;
		$slidesPerGroupMobile		= 1;
		
		$slidesPerGroupSkip			= 0;
		$slidesPerGroupSkipIpad		= 0;
		$slidesPerGroupSkipMobile	= 0;

		$slide_effect = esc_attr( $this->props['slide_effect'] );
		if ( in_array( $slide_effect, array( 'slide', 'coverflow' ), true ) ) {

			$products_per_slide 			= et_pb_responsive_options()->get_property_values( $this->props, 'products_per_slide', '', true );
			$products_per_view				= $products_per_slide['desktop'];
			$products_per_view_ipad			= ('' !== $products_per_slide['tablet']) ? $products_per_slide['tablet'] : $this->props['products_per_slide_tablet'];
			$products_per_view_mobile		= ('' !== $products_per_slide['phone']) ? $products_per_slide['phone'] : $this->props['products_per_slide_phone'];

			$space_between_slides			= et_pb_responsive_options()->get_property_values( $this->props, 'space_between_slides', '', true );
			$products_space_between   		= $space_between_slides['desktop'];
			$products_space_between_ipad  	= ('' !== $space_between_slides['tablet']) ? $space_between_slides['tablet'] : $products_space_between;
			$products_space_between_mobile 	= ('' !== $space_between_slides['phone']) ? $space_between_slides['phone'] : $products_space_between_ipad;
			
			$slides_per_group				= et_pb_responsive_options()->get_property_values( $this->props, 'slides_per_group', '', true );
			$slidesPerGroup 				= $slides_per_group['desktop'];
			$slidesPerGroupIpad				= ('' !== $slides_per_group['tablet']) ? $slides_per_group['tablet'] : $slidesPerGroup;
			$slidesPerGroupMobile			= ('' !== $slides_per_group['phone']) ? $slides_per_group['phone'] : $slidesPerGroupIpad;

			if ( $products_per_view > $slidesPerGroup && 1 !== $slidesPerGroup ) {
				$slidesPerGroupSkip = $products_per_view - $slidesPerGroup;
			}
			if ( $products_per_view_ipad > $slidesPerGroupIpad && 1 !== $slidesPerGroupIpad ) {
				$slidesPerGroupSkipIpad = $products_per_view_ipad - $slidesPerGroupIpad;
			}
			if ( $products_per_view_mobile > $slidesPerGroupMobile && 1 !== $slidesPerGroupMobile ) {
				$slidesPerGroupSkipMobile = $products_per_view_mobile - $slidesPerGroupMobile;
			}
		}

		$arrows = 'false';
		if ( isset($this->props['show_arrow']) && 'on' === $this->props['show_arrow'] ) {
			$arrows = "{    
				nextEl: '." . esc_attr( $order_class ) . " .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-next',
				prevEl: '." . esc_attr( $order_class ) . " .aioc_products_carousel_container > .aioc_swiper_navigation .swiper-button-prev',
			}";
		}
		$dots = 'false';
		if ( isset($this->props['show_control_dot']) && 'on' === $this->props['show_control_dot'] ) {
			$number_dot = 'false';
			if ( 'number_dot' === $this->props['control_dot_style'] ) {
				$number_dot = "function (index, className) {
					return '<span class=\"' + className + ' number-bullet\">' + (index + 1) + ' </span>';
				}";
			}
			$dynamic_bullets = 'on' === $this->props['enable_dynamic_dots'] && in_array( $this->props['control_dot_style'], array( 'solid_dot', 'transparent_dot', 'square_dot', 'number_dot' ), true ) ? 'true' : 'false';
			$dots = "{
				el: '." . esc_attr( $order_class ) . " .aioc_products_carousel_container + .aioc_swiper_pagination .swiper-pagination',
				dynamicBullets: " . $dynamic_bullets . ",
				clickable: true,
				renderBullet: " . $number_dot . ",
			}";
		}

		$autoplay		= esc_attr( $this->props['autoplay'] );
		$pause_on_hover	= esc_attr( $this->props['pause_on_hover'] );
		$autoplaySlides = 0;
		if ( 'on' === $autoplay ) {
			$autoplay_speed = isset( $this->props['autoplay_speed'] ) ? intval( $this->props['autoplay_speed'] ) : 3000;
			if ( 'on' === $pause_on_hover ) {
				$autoplaySlides = '{ delay:' . $autoplay_speed . ', disableOnInteraction: true }';
			} else {
				$autoplaySlides = '{ delay:' . $autoplay_speed . ', disableOnInteraction: false }';
			}
		}

		$cube = 'false';
		if ( 'cube' === $slide_effect ) {
			$cube = '{ shadow: false, slideShadows: false }';
		}
		$coverflow = 'false';
		if ( 'coverflow' === $slide_effect ) {
			$enable_coverflow_shadow = ('on' === $this->props['enable_coverflow_shadow']) ? 'true' : 'false';
			$coverflow_rotate	     = intval( $this->props['coverflow_rotate'] );
			$coverflow_depth		 = intval( $this->props['coverflow_depth'] );

			$coverflow = '{
				rotate: ' . $coverflow_rotate . ',
				stretch: 0,
				depth: ' . $coverflow_depth . ',
				modifier: 1,
				slideShadows : ' . $enable_coverflow_shadow . ',
			}';
		}
		$fade = 'false';
		if ( 'fade' === $slide_effect ) {
			$fade = '{ crossFade: true }';
		}

		$transition_duration = intval( $this->props['slide_transition_duration'] );
		$transition_duration = '' !== $transition_duration || 0 !== $transition_duration ? $transition_duration : 1000;

		$loop				 = ( $this->props['slider_loop'] && 'on' === esc_attr($this->props['slider_loop']) ) ? 'true' : 'false';
		$auto_height_slider	 = ( $this->props['auto_height_slider'] && 'on' === esc_attr( $this->props['auto_height_slider'] ) ) ? 'true' : 'false';

		// If equal height is enabled, auto height is not possible.
		$auto_height_slider  = ( $this->props['equalize_slides_height'] && 'on' === esc_attr( $this->props['equalize_slides_height'] ) ) ? 'false' : $auto_height_slider;

		$script  = '<script type="text/javascript">';
		$script .= 'jQuery( function($) {';
		$script .= 'var ' . esc_attr( $order_class ) . '_swiper = new Swiper( \'.' . esc_attr( $order_class ) . ' .aioc_products_carousel_container > .swiper-container\', {
			slidesPerView: ' . $products_per_view . ',
			autoplay: ' . $autoplaySlides . ',
			spaceBetween: ' . intval( $products_space_between ) . ',
			slidesPerGroup: ' . $slidesPerGroup . ',
			slidesPerGroupSkip: ' . $slidesPerGroupSkip . ',
			effect: "' . $slide_effect . '",
			cubeEffect: ' . $cube . ',
			coverflowEffect: ' . $coverflow . ',
			fadeEffect: ' . $fade . ',
			speed: ' . $transition_duration . ',
			loop: ' . $loop . ',
			autoHeight: ' . $auto_height_slider . ',
			pagination: ' . $dots . ',
			navigation: ' . $arrows . ',
			grabCursor: \'true\',
			observer: true,
			observeParents: true,
			breakpoints: {
				981: {
					slidesPerView: ' . $products_per_view . ',
					spaceBetween: ' . intval( $products_space_between ) . ',
					slidesPerGroup: ' . $slidesPerGroup . ',
					slidesPerGroupSkip: ' . $slidesPerGroupSkip . ',
				},
				768: {
					slidesPerView: ' . $products_per_view_ipad . ',
					spaceBetween: ' . intval( $products_space_between_ipad ) . ',
					slidesPerGroup: ' . $slidesPerGroupIpad . ',
					slidesPerGroupSkip: ' . $slidesPerGroupSkipIpad . ',
				},
				0: {
					slidesPerView: ' . $products_per_view_mobile . ',
					spaceBetween: ' . intval( $products_space_between_mobile ) . ',
					slidesPerGroup: ' . $slidesPerGroupMobile . ',
					slidesPerGroupSkip: ' . $slidesPerGroupSkipMobile . ',
				}
			},
		} );';

		if ( 'on' === $pause_on_hover && 'on' === $autoplay ) {
			$script .= '$( ".' . esc_attr( $order_class ) . ' .aioc_products_carousel_container > .swiper-container" ).on( "mouseenter", function(e) {
				if ( typeof ' . esc_attr( $order_class ) . '_swiper.autoplay.stop === "function" ) {
					' . esc_attr( $order_class ) . '_swiper.autoplay.stop();
				}
			});';
			$script .= '$( ".' . esc_attr( $order_class ) . ' .aioc_products_carousel_container > .swiper-container" ).on( "mouseleave", function(e) {
				if ( typeof ' . esc_attr( $order_class ) . '_swiper.autoplay.start === "function" ) {
					' . esc_attr( $order_class ) . '_swiper.autoplay.start();
				}
			});';
		}
		if ( 'true' !== $loop ) {
			$script .=  esc_attr( $order_class ) . '_swiper.on( \'reachEnd\', function() {
				' . esc_attr( $order_class ) . '_swiper.autoplay = false;
			} );';
		}
		$script .= '} );</script>';

		return $script;
	}

}

if ( et_is_woocommerce_plugin_active() ) {
	new AIOC_ProductsCarousel();
}
