<?php
namespace Sifency\Traits;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use Elementor\Controls_Manager;

trait Sifency_Related_Product_Controls {

	protected function add_sifency_related_product_controls() {

		$this->start_controls_section(
			'query',
			array(
				'label' => esc_html__( 'Query', 'sifency-addons' ),
			)
		);

		$this->add_control(
			'posts_per_page',
			array(
				'label'   => esc_html__( 'Products Count', 'sifency-addons' ),
				'type'    => Controls_Manager::NUMBER,
				'default' => 4,
			)
		);

		$this->add_control(
			'orderby',
			array(
				'label'   => esc_html__( 'Order By', 'sifency-addons' ),
				'type'    => Controls_Manager::SELECT,
				'options' => array(
					'date'  => 'Date',
					'rand'  => 'Random',
					'title' => 'Title',
				),
				'default' => 'rand',
			)
		);

		$this->add_control(
			'order',
			array(
				'label'   => esc_html__( 'Order', 'sifency-addons' ),
				'type'    => Controls_Manager::SELECT,
				'options' => array(
					'DESC' => 'DESC',
					'ASC'  => 'ASC',
				),
				'default' => 'DESC',
			)
		);
		$this->end_controls_section();

		$this->start_controls_section(
			'layout',
			array(
				'label' => esc_html__( 'Layout', 'sifency-addons' ),
			)
		);

		$this->add_control(
			'layout_style',
			array(
				'label'   => esc_html__( 'Layout Type', 'sifency-addons' ),
				'type'    => Controls_Manager::SELECT,
				'options' => array(
					'grid'     => 'Grid',
					'carousel' => 'Carousel',
				),
				'default' => 'grid',
			)
		);

		$this->add_control(
			'skin_style',
			array(
				'label'   => esc_html__( 'Skin', 'sifency-addons' ),
				'type'    => Controls_Manager::SELECT,
				'options' => array(
					'card'    => 'Modern Card',
					'minimal' => 'Minimal',
					'list'    => 'List',
					'overlay' => 'Overlay',
					'glass'   => 'Glass',
					'compact' => 'Compact',
				),
				'default' => 'card',
			)
		);
		$this->end_controls_section();
	}
}
