<?php
/**
 * Home v1 Metabox
 *
 * Displays the home v1 meta box, tabbed, with several panels covering price, stock etc.
 *
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * Electro_Meta_Box_Home_v1 Class.
 */
class Electro_Meta_Box_Home_v1 {

	/**
	 * Output the metabox.
	 *
	 * @param WP_Post $post
	 */
	public static function output( $post ) {
		global $post, $thepostid;

		wp_nonce_field( 'electro_save_data', 'electro_meta_nonce' );

		$thepostid 		= $post->ID;
		$template_file 	= get_post_meta( $thepostid, '_wp_page_template', true );

		if ( $template_file !== 'template-homepage-v1.php' ) {
			return;
		}

		self::output_home_v1( $post );
	}

	private static function output_home_v1( $post ) {

		$home_v1 = electro_get_home_v1_meta();

		?>
		<div class="panel-wrap meta-box-home">
			<ul class="home_data_tabs ec-tabs">
			<?php
				$product_data_tabs = apply_filters( 'woocommerce_product_data_tabs', array(
					'general' => array(
						'label'  => __( 'Genel', 'electro' ),
						'target' => 'general_block',
						'class'  => array(),
					),
					'slider' => array(
						'label'  => __( 'Slider', 'electro' ),
						'target' => 'slider_block',
						'class'  => array(),
					),
					'ads_block' => array(
						'label'  => __( 'Reklam Bloğu', 'electro' ),
						'target' => 'ads_block',
						'class'  => array(),
					),
					'deal_and_tabs' => array(
						'label'  => __( 'Teklif ve Sekmeler Bloğu', 'electro' ),
						'target' => 'deals_and_tabs',
						'class'  => array(),
					),
					'tot_block' => array(
						'label'  => __( '2-1-2 Ürünler Bloğu', 'electro' ),
						'target' => 'tot_block',
						'class'  => array(),
					),
					'cards_carousel' => array(
						'label'  => __( 'Ürün Kart Carousel', 'electro' ),
						'target' => 'products_cards_carousel',
						'class'  => array(),
					),
					'banner' => array(
						'label'  => __( 'Banner', 'electro' ),
						'target' => 'banner_data',
						'class'  => array(),
					),
					'products_carousel' => array(
						'label'  => __( 'Ürünler Carousel', 'electro' ),
						'target' => 'products_carousel',
						'class'  => array(),
					)
				) );
				foreach ( $product_data_tabs as $key => $tab ) {
					?><li class="<?php echo esc_attr( $key ); ?>_options <?php echo esc_attr( $key ); ?>_tab <?php echo implode( ' ' , $tab['class'] ); ?>">
						<a href="#<?php echo esc_attr( $tab['target'] ); ?>"><?php echo esc_html( $tab['label'] ); ?></a>
					</li><?php
				}
				do_action( 'electro_home_write_panel_tabs' );
			?>
			</ul>
			<div id="general_block" class="panel electro_options_panel">
				<div class="options_group">
					<?php 
						$home_v1_blocks = array(
							'sdr'	=> esc_html__( 'Slider', 'electro' ),
							'ad'	=> esc_html__( 'Reklam Bloğu', 'electro' ),
							'dtd'	=> esc_html__( 'Teklif ve Sekmeler Bloğu', 'electro' ),
							'tot'	=> esc_html__( '2-1-2 Ürünler Bloğu', 'electro' ),
							'pcc'	=> esc_html__( 'Ürün Kart', 'electro' ),
							'bd'	=> esc_html__( 'Banner', 'electro' ),
							'pc'	=> esc_html__( 'Ürün Carousel', 'electro' ),
						);
					?>
					<table class="general-blocks-table widefat striped">
						<thead>
							<tr>
								<th><?php echo esc_html__( 'Blok', 'electro' ); ?></th>
								<th><?php echo esc_html__( 'Animasyon', 'electro' ); ?></th>
								<th><?php echo esc_html__( 'Öncelik', 'electro' ); ?></th>
								<th><?php echo esc_html__( 'Aktif Mi ?', 'electro' ); ?></th>
							</tr>	
						</thead>
						<tbody>
							<?php foreach( $home_v1_blocks as $key => $home_v1_block ) : ?>
							<tr>
								<td><?php echo esc_html( $home_v1_block ); ?></td>
								<td><?php electro_wp_animation_dropdown( array(  'id' => '_home_v1_' . $key . '_animation', 'label'=> '', 'name' => '_home_v1[' . $key . '][animation]', 'value' => isset( $home_v1['' . $key . '']['animation'] ) ? $home_v1['' . $key . '']['animation'] : '', )); ?></td>
								<td><?php electro_wp_text_input( array(  'id' => '_home_v1_' . $key . '_priority', 'label'=> '', 'name' => '_home_v1[' . $key . '][priority]', 'value' => isset( $home_v1['' . $key . '']['priority'] ) ? $home_v1['' . $key . '']['priority'] : 10, ) ); ?></td>
								<td><?php electro_wp_checkbox( array( 'id' => '_home_v1_' . $key . '_is_enabled', 'label' => '', 'name' => '_home_v1[' . $key . '][is_enabled]', 'value'=> isset( $home_v1['' . $key . '']['is_enabled'] ) ? $home_v1['' . $key . '']['is_enabled'] : '', ) ); ?></td>
							</tr>
							<?php endforeach; ?>
						</tbody>
					</table>
				</div>
			</div><!-- /#general_block -->
			
			<div id="slider_block" class="panel electro_options_panel">
				<div class="options_group">
				<?php 
					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_sdr_shortcode', 
						'label' 		=> esc_html__( 'Shortcode', 'electro' ), 
						'placeholder' 	=> __( 'Kullanılacak slider için shortcode yazınız', 'electro' ),
						'name'			=> '_home_v1[sdr][shortcode]',
						'value'			=> isset( $home_v1['sdr']['shortcode'] ) ? $home_v1['sdr']['shortcode'] : '',
					) );
				?>
				</div>
			</div><!-- /#slider_block -->
			
			<div id="ads_block" class="panel electro_options_panel">

				<?php electro_wp_legend( esc_html__( 'Reklam Bloğu', 'electro' ) ); ?>

				<div class="options_group">
				<?php

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_1_ad_text', 
						'label' 		=> esc_html__( 'Reklam Metni', 'electro' ), 
						'name'			=> '_home_v1[ad][0][ad_text]',
						'value'			=> isset( $home_v1['ad'][0]['ad_text'] ) ? $home_v1['ad'][0]['ad_text'] : wp_kses_post( __( 'Catch Big <strong>Deals</strong> on the Cameras', 'electro' ) ),
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_1_action_text', 
						'label' 		=> esc_html__( 'Alt Metin', 'electro' ), 
						'name'			=> '_home_v1[ad][0][action_text]',
						'value'			=> isset( $home_v1['ad'][0]['action_text'] ) ? $home_v1['ad'][0]['action_text'] : wp_kses_post( __( 'Shop now', 'electro' ) ),
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_1_action_link', 
						'label' 		=> esc_html__( 'Alt Metin Link', 'electro' ), 
						'name'			=> '_home_v1[ad][0][action_link]',
						'value'			=> isset( $home_v1['ad'][0]['action_link'] ) ? $home_v1['ad'][0]['action_link'] : '#',
					) );

					electro_wp_upload_image( array(
						'id'			=> '_home_v1_ad_1_ad_image',
						'label'			=> esc_html__( 'Reklam Resmi', 'electro' ),
						'name'			=> '_home_v1[ad][0][ad_image]',
						'value'			=> isset( $home_v1['ad'][0]['ad_image'] ) ? $home_v1['ad'][0]['ad_image'] : '',
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_1_el_class', 
						'label' 		=> esc_html__( 'Harici Sınıf', 'electro' ), 
						'name'			=> '_home_v1[ad][0][el_class]',
						'value'			=> isset( $home_v1['ad'][0]['el_class'] ) ? $home_v1['ad'][0]['el_class'] : 'col-xs-12 col-sm-4',
					) );
				?>
				</div>

				<?php electro_wp_legend( esc_html__( 'Reklam Bloğu 2', 'electro' ) ); ?>

				<div class="options_group">
				<?php

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_2_ad_text', 
						'label' 		=> esc_html__( 'Reklam Metni', 'electro' ), 
						'name'			=> '_home_v1[ad][1][ad_text]',
						'value'			=> isset( $home_v1['ad'][1]['ad_text'] ) ? $home_v1['ad'][1]['ad_text'] : wp_kses_post( __( 'Tablets, Smartphones <strong>and more</strong>', 'electro' ) ),
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_2_action_text', 
						'label' 		=> esc_html__( 'Alt Metin', 'electro' ), 
						'name'			=> '_home_v1[ad][1][action_text]',
						'value'			=> isset( $home_v1['ad'][1]['action_text'] ) ? $home_v1['ad'][1]['action_text'] : wp_kses_post( __( '<span class="upto"><span class="prefix">Upto</span><span class="value">70</span><span class="suffix">%</span>', 'electro' ) ),
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_2_action_link', 
						'label' 		=> esc_html__( 'Alt Metin Linki', 'electro' ), 
						'name'			=> '_home_v1[ad][1][action_link]',
						'value'			=> isset( $home_v1['ad'][1]['action_link'] ) ? $home_v1['ad'][1]['action_link'] : '#',
					) );

					electro_wp_upload_image( array(
						'id'			=> '_home_v1_ad_2_ad_image',
						'label'			=> esc_html__( 'Reklam Resmi', 'electro' ),
						'name'			=> '_home_v1[ad][1][ad_image]',
						'value'			=> isset( $home_v1['ad'][1]['ad_image'] ) ? $home_v1['ad'][1]['ad_image'] : '',
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_2_el_class', 
						'label' 		=> esc_html__( 'Harici Sınıf', 'electro' ), 
						'name'			=> '_home_v1[ad][1][el_class]',
						'value'			=> isset( $home_v1['ad'][1]['el_class'] ) ? $home_v1['ad'][1]['el_class'] : 'col-xs-12 col-sm-4',
					) );
				?>
				</div>

				<?php electro_wp_legend( esc_html__( 'Reklam Bloğu 3', 'electro' ) ); ?>

				<div class="options_group">
				<?php

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_3_ad_text', 
						'label' 		=> esc_html__( 'Reklam Metni', 'electro' ), 
						'name'			=> '_home_v1[ad][2][ad_text]',
						'value'			=> isset( $home_v1['ad'][2]['ad_text'] ) ? $home_v1['ad'][2]['ad_text'] : wp_kses_post( __( 'Shop the <strong>Hottest</strong> Products', 'electro' ) ),
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_3_action_text', 
						'label' 		=> esc_html__( 'Alt Metin', 'electro' ), 
						'name'			=> '_home_v1[ad][2][action_text]',
						'value'			=> isset( $home_v1['ad'][2]['action_text'] ) ? $home_v1['ad'][2]['action_text'] : wp_kses_post( __( 'Shop now', 'electro' ) ),
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_3_action_link', 
						'label' 		=> esc_html__( 'Reklam Metni Linki', 'electro' ), 
						'name'			=> '_home_v1[ad][2][action_link]',
						'value'			=> isset( $home_v1['ad'][2]['action_link'] ) ? $home_v1['ad'][2]['action_link'] : '#',
					) );

					electro_wp_upload_image( array(
						'id'			=> '_home_v1_ad_3_ad_image',
						'label'			=> esc_html__( 'Reklam Resmi', 'electro' ),
						'name'			=> '_home_v1[ad][2][ad_image]',
						'value'			=> isset( $home_v1['ad'][2]['ad_image'] ) ? $home_v1['ad'][2]['ad_image'] : '',
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_ad_3_el_class', 
						'label' 		=> esc_html__( 'Harici Sınıf', 'electro' ), 
						'name'			=> '_home_v1[ad][2][el_class]',
						'value'			=> isset( $home_v1['ad'][2]['el_class'] ) ? $home_v1['ad'][2]['el_class'] : 'col-xs-12 col-sm-4',
					) );
				?>
				</div>
			</div><!-- /#ads_block -->

			<div id="deals_and_tabs" class="panel electro_options_panel">
				
				<?php electro_wp_legend( esc_html__( 'Teklifler Bloğu', 'electro' ) ); ?>
				
				<div class="options_group">
				<?php

					electro_wp_checkbox( array(
						'id'			=> '_home_v1_dtd_deal_is_enabled',
						'label'			=> esc_html__( 'Teklif Bloğunu Aktif Et', 'electro' ), 
						'name'			=> '_home_v1[dtd][deal][is_enabled]',
						'value'			=> isset( $home_v1['dtd']['deal']['is_enabled'] ) ? $home_v1['dtd']['deal']['is_enabled'] : '',
					) );

					electro_wp_text_input( array( 
						'id' 			=> '_home_v1_dtd_deal_block_title', 
						'label' 		=> esc_html__( 'Teklif Bloğu Başlığı', 'electro' ), 
						'placeholder' 	=> __( 'Özel Teklif', 'electro' ),
						'name'			=> '_home_v1[dtd][deal][title]',
						'value'			=> isset( $home_v1['dtd']['deal']['title'] ) ? $home_v1['dtd']['deal']['title'] : esc_html__( 'Özel Teklif', 'electro' ),
					) );

					electro_wp_select( array(
						'id'			=> '_home_v1_dtd_deal_product_choice',
						'label'			=> esc_html__( 'Ürün Seçimi', 'electro' ),
						'options'		=> array(
							'random'	=> esc_html__( 'İndirimdeki ürünler içinden rasgele getir', 'electro' ),
							'recent'	=> esc_html__( 'İndirimdeki ürünlerden sonuncuyu getir', 'electro' ),
							'specific'	=> esc_html__( 'ID ile belirle', 'electro' ),
						),
						'class'			=> 'show_hide_select',
						'name'			=> '_home_v1[dtd][deal][product_choice]',
						'value'			=> isset( $home_v1['dtd']['deal']['product_choice'] ) ? $home_v1['dtd']['deal']['product_choice'] : 'random',
					) );
					
					electro_wp_text_input( array( 
						'id'			=> '_home_v1_dtd_deal_product_id', 
						'label' 		=>  esc_html__( 'Teklif Ürün ID', 'electro' ),
						'name'			=> '_home_v1[dtd][deal][product_id]',
						'wrapper_class'	=> 'show_if_specific hide',
						'value'			=> $home_v1['dtd']['deal']['product_id']
					) );

					electro_wp_select( array( 
						'id'            => '_home_v1_dtd_deal_savings_in',
						'label'         => esc_html__( 'İndirim Türü', 'electro' ),
						'options'       => array(
							'amount'     => esc_html__( 'Tutar', 'electro' ),
							'percentage' => esc_html__( 'Yüzde', 'electro' ),
						),
						'name'          => '_home_v1[dtd][deal][savings_in]',
						'value'         => isset( $home_v1['dtd']['deal']['savings_in'] ) ? $home_v1['dtd']['deal']['savings_in'] : 'amount',
					) );	
				?>
				</div>

				<?php electro_wp_legend( esc_html__( 'Sekmeler Bloğu', 'electro' ) ); ?>

				<div class="options_group">
				<?php 
					electro_wp_text_input( array( 
						'id'			=> '_home_v1_dtd_tab_block_product_limit', 
						'label' 		=>  esc_html__( 'Ürün Limiti', 'electro' ),
						'placeholder' 	=> esc_html__( 'Gösterilecek ürün sayısını yazınız', 'electro' ),
						'name'			=> '_home_v1[dtd][tab][product_limit]',
						'class'			=> 'product_limit',
						'size'			=> 2,
						'value'			=> isset( $home_v1['dtd']['tab']['product_limit'] ) ? $home_v1['dtd']['tab']['product_limit'] : 6,
					) );

					electro_wp_select( array( 
						'id'			=> '_home_v1_dtd_tab_block_product_columns', 
						'label' 		=>  esc_html__( 'Sütun', 'electro' ),
						'options'		=> array(
							'2'	=> '2',
							'3'	=> '3',
							'4'	=> '4',
						),
						'class'			=> 'columns_select',
						'default'		=> '3',
						'name'			=> '_home_v1[dtd][tab][product_columns]',
						'value'			=> isset( $home_v1['dtd']['tab']['product_columns'] ) ? $home_v1['dtd']['tab']['product_columns'] : 3,
					) );
				?>
				</div>

				<div class="options_group">
				<?php	
					electro_wp_text_input( array( 
						'id'			=> '_home_v1_dtd_tab_1_title', 
						'label' 		=> esc_html__( 'Sekme #1 Başlık', 'electro' ),
						'placeholder' 	=> esc_html__( 'Öne Çıkanlar', 'electro' ),
						'name'			=> '_home_v1[dtd][tab][tabs][0][title]',
						'value'			=> isset( $home_v1['dtd']['tab']['tabs'][0]['title'] ) ? $home_v1['dtd']['tab']['tabs'][0]['title'] : esc_html__( 'Öne Çıkanlar', 'electro' ),
					) );

					electro_wp_wc_shortcode( array( 
						'id' 			=> '_home_v1_dtd_tab_1_content',
						'label'			=> esc_html__( 'Sekme #1 İçerik', 'electro' ),
						'default'		=> 'featured_products',
						'name'			=> '_home_v1[dtd][tab][tabs][0][content]',
						'value'			=> isset( $home_v1['dtd']['tab']['tabs'][0]['content'] ) ? $home_v1['dtd']['tab']['tabs'][0]['content'] : '',
					) );
				?>
				</div>
				<div class="options_group">
				<?php
					electro_wp_text_input( array( 
						'id'			=> '_home_v1_dtd_tab_2_title', 
						'label' 		=> esc_html__( 'Sekme #2 Başlık', 'electro' ),
						'placeholder' 	=> esc_html__( 'İndirimli Ürünler', 'electro' ),
						'name'			=> '_home_v1[dtd][tab][tabs][1][title]',
						'value'			=> isset( $home_v1['dtd']['tab']['tabs'][1]['title'] ) ? $home_v1['dtd']['tab']['tabs'][1]['title'] : esc_html__( 'İndirimli Ürünler', 'electro' ),
					) );

					electro_wp_wc_shortcode( array( 
						'id' 			=> '_home_v1_dtd_tab_2_content',
						'label'			=> esc_html__( 'Sekme #2 İçerik', 'electro' ),
						'default'		=> 'sale_products',
						'name'			=> '_home_v1[dtd][tab][tabs][1][content]',
						'value'			=> isset( $home_v1['dtd']['tab']['tabs'][1]['content'] ) ? $home_v1['dtd']['tab']['tabs'][1]['content'] : '',
					) );
				?>
				</div>
				<div class="options_group">
				<?php
					electro_wp_text_input( array( 
						'id'			=> '_home_v1_dtd_tab_3_title', 
						'label' 		=> esc_html__( 'Sekme #3 Başlık', 'electro' ),
						'placeholder' 	=> esc_html__( 'En Çok Oy Alanlar', 'electro' ),
						'name'			=> '_home_v1[dtd][tab][tabs][2][title]',
						'value'			=> isset( $home_v1['dtd']['tab']['tabs'][2]['title'] ) ? $home_v1['dtd']['tab']['tabs'][2]['title'] : esc_html__( 'En Çok Oy Alanlar', 'electro' ),
					) );
					electro_wp_wc_shortcode( array( 
						'id' 			=> '_home_v1_dtd_tab_3_content',
						'label'			=> esc_html__( 'Sekme #3 İçerik', 'electro' ),
						'default'		=> 'top_rated_products',
						'name'			=> '_home_v1[dtd][tab][tabs][2][content]',
						'value'			=> isset( $home_v1['dtd']['tab']['tabs'][2]['content'] ) ? $home_v1['dtd']['tab']['tabs'][2]['content'] : '',
					) );
				?>
				</div>
			</div><!-- /#deals_and_tabs_data -->
			
			<div id="tot_block" class="panel electro_options_panel">
				<div class="options_group">
				<?php
					electro_wp_text_input( array(
						'id'			=> '_home_v1_tot_section_title',
						'label'			=> esc_html__( 'Bölüm Başlığı', 'electro' ),
						'name'			=> '_home_v1[tot][section_title]',
						'default'		=> esc_html__( 'En İyi Teklifler', 'electro' ),
						'value'			=> isset( $home_v1['tot']['section_title'] ) ? $home_v1['tot']['section_title'] : esc_html__( 'En İyi Teklifler', 'electro' ),
						'placeholder'	=> esc_html__( 'En İyi Teklifler', 'electro' )
					) );

					electro_wp_text_input( array(
						'id'			=> '_home_v1_tot_cat_limit',
						'label'			=> esc_html__( 'Kategori Sınırı', 'electro' ),
						'name'			=> '_home_v1[tot][cat_limit]',
						'default'		=> 7,
						'value'			=> isset( $home_v1['tot']['cat_limit'] ) ? $home_v1['tot']['cat_limit'] : 7,
						'placeholder'	=> 7
					) );

					electro_wp_text_input( array(
						'id'			=> '_home_v1_tot_cat_slugs',
						'label'			=> esc_html__( 'Kategori Kısa Adı', 'electro' ),
						'name'			=> '_home_v1[tot][cat_slugs]',
						'default'		=> '',
						'value'			=> isset( $home_v1['tot']['cat_slugs'] ) ? $home_v1['tot']['cat_slugs'] : '',
						'placeholder'	=> esc_html__( 'Kategori kısa adlarını virgül ile ayırarak yazınız', 'electro' )
					) );

					electro_wp_wc_shortcode( array( 
						'id' 			=> '_home_v1_tot_content',
						'label'			=> esc_html__( 'Ürünler', 'electro' ),
						'default'		=> 'sale_products',
						'name'			=> '_home_v1[tot][content]',
						'value'			=> isset( $home_v1['tot']['content'] ) ? $home_v1['tot']['content'] : ''
					) );
				?>
				</div>
			</div>

			<div id="products_cards_carousel" class="panel electro_options_panel">
				<div class="options_group">
				<?php
					electro_wp_text_input( array(
						'id'			=> '_home_v1_pcc_section_title',
						'label'			=> esc_html__( 'Bölüm Başlığı', 'electro' ),
						'name'			=> '_home_v1[pcc][section_title]',
						'default'		=> esc_html__( 'En Çok Satanlar', 'electro' ),
						'value'			=> isset( $home_v1['pcc']['section_title'] ) ? $home_v1['pcc']['section_title'] : esc_html__( 'En Çok Satanlar', 'electro' ),
						'placeholder'	=> esc_html__( 'En Çok Satanlar', 'electro' )
					) );
					electro_wp_text_input( array(
						'id'			=> '_home_v1_pcc_product_limit',
						'label'			=> esc_html__( 'Ürün Limiti', 'electro' ),
						'name'			=> '_home_v1[pcc][product_limit]',
						'value'			=> isset( $home_v1['pcc']['product_limit'] ) ? $home_v1['pcc']['product_limit'] : 20,
						'placeholder'	=> esc_html__( 'Gösterilecek ürün sayısını yazınız', 'electro' ),
					) );
					electro_wp_text_input( array(
						'id'			=> '_home_v1_pcc_product_rows',
						'label'			=> esc_html__( 'Satır', 'electro' ),
						'name'			=> '_home_v1[pcc][product_rows]',
						'value'			=> isset( $home_v1['pcc']['product_rows'] ) ? $home_v1['pcc']['product_rows'] : 2,
						'placeholder'	=> esc_html__( 'Gösterilecek satır sayısını yazınız', 'electro' ),
					) );
					electro_wp_text_input( array(
						'id'			=> '_home_v1_pcc_product_columns',
						'label'			=> esc_html__( 'Sütun', 'electro' ),
						'name'			=> '_home_v1[pcc][product_columns]',
						'value'			=> isset( $home_v1['pcc']['product_columns'] ) ? $home_v1['pcc']['product_columns'] : 3,
						'placeholder'	=> esc_html__( 'Gösterilecek sütun sayısını yazınız', 'electro' ),
					) );
					electro_wp_wc_shortcode( array( 
						'id' 			=> '_home_v1_pcc_content',
						'label'			=> esc_html__( 'Ürünler', 'electro' ),
						'default'		=> 'best_selling_products',
						'name'			=> '_home_v1[pcc][content]',
						'value'			=> isset( $home_v1['pcc']['content'] ) ? $home_v1['pcc']['content'] : ''
					) );
				?>
				</div>
				<div class="options_group">
				<?php
					electro_wp_text_input( array(
						'id'			=> '_home_v1_pcc_cat_limit',
						'label'			=> esc_html__( 'Kategori Sınırı', 'electro' ),
						'name'			=> '_home_v1[pcc][cat_limit]',
						'default'		=> 3,
						'value'			=> isset( $home_v1['pcc']['cat_limit'] ) ? $home_v1['pcc']['cat_limit'] : 3,
						'placeholder'	=> 3
					) );

					electro_wp_text_input( array(
						'id'			=> '_home_v1_pcc_cat_slugs',
						'label'			=> esc_html__( 'Kategori Kısa Adı', 'electro' ),
						'name'			=> '_home_v1[pcc][cat_slugs]',
						'default'		=> '',
						'value'			=> isset( $home_v1['pcc']['cat_slugs'] ) ? $home_v1['pcc']['cat_slugs'] : '',
						'placeholder'	=> esc_html__( 'Kategori kısa adlarını virgül ile ayırarak yazınız', 'electro' )
					) );
				?>
				</div>
			</div><!-- /#products_cards_carousel -->
			
			<div id="banner_data" class="panel electro_options_panel">
				<div class="options_group">
				<?php 
					electro_wp_upload_image( array(
						'id'			=> '_home_v1_bd_image',
						'label'			=> esc_html__( 'Banner Resmi', 'electro' ),
						'name'			=> '_home_v1[bd][image]',
						'value'			=> isset( $home_v1['bd']['image'] ) ? $home_v1['bd']['image'] : '',
					) );
					
					electro_wp_text_input( array(
						'id'			=> '_home_v1_bd_link',
						'label'			=> esc_html__( 'Link', 'electro' ),
						'name'			=> '_home_v1[bd][link]',
						'value'			=> isset( $home_v1['bd']['link'] ) ? $home_v1['bd']['link'] : '#',
					) );
				?>
				</div>
			</div><!-- /#banner_data -->

			<div id="products_carousel" class="panel electro_options_panel">
				<div class="options_group">
				<?php
					electro_wp_text_input( array(
						'id'			=> '_home_v1_pc_section_title',
						'label'			=> esc_html__( 'Section Title', 'electro' ),
						'name'			=> '_home_v1[pc][section_title]',
						'value'			=> isset( $home_v1['pc']['section_title'] ) ? $home_v1['pc']['section_title'] : esc_html__( 'Recently Added', 'electro' ),
					) );

					electro_wp_text_input( array(
						'id'			=> '_home_v1_pc_product_limit',
						'label'			=> esc_html__( 'Limit', 'electro' ),
						'name'			=> '_home_v1[pc][product_limit]',
						'value'			=> isset( $home_v1['pc']['product_limit'] ) ? $home_v1['pc']['product_limit'] : 20,
					) );
					electro_wp_text_input( array(
						'id'			=> '_home_v1_pc_product_columns',
						'label'			=> esc_html__( 'Columns', 'electro' ),
						'name'			=> '_home_v1[pc][product_columns]',
						'value'			=> isset( $home_v1['pc']['product_columns'] ) ? $home_v1['pc']['product_columns'] : 5,
					) );

					electro_wp_wc_shortcode( array( 
						'id' 			=> '_home_v1_pc_content',
						'label'			=> esc_html__( 'Products', 'electro' ),
						'default'		=> 'recent_products',
						'name'			=> '_home_v1[pc][content]',
						'value'			=> isset( $home_v1['pc']['content'] ) ? $home_v1['pc']['content'] : '',
					) );
				?>
				</div>
			</div>
		</div>
		<?php
	}

	public static function save( $post_id, $post ) {
		if ( isset( $_POST['_home_v1'] ) ) {
			$clean_home_v1_options = electro_clean_kses_post( $_POST['_home_v1'] );
			update_post_meta( $post_id, '_home_v1_options',  addslashes( json_encode( $clean_home_v1_options ) ) );
		}	
	}
}