<?php

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

add_action( 'csf_loaded', 'glowify_shop_options_widgets' );
function glowify_shop_options_widgets() {

    // Set a unique slug-like ID
    $glowify_wp_shop_options = 'glowify_wp_shop_options';

    // Create a metabox
    CSF::createMetabox($glowify_wp_shop_options, array(
        'title'     => esc_html__('Shop Options', 'glowify-wp'),
        'post_type' => 'product',
        'priority'  => 'high',
    ));

     // Create a section
     CSF::createSection($glowify_wp_shop_options, array(
        'title'  => esc_html__('Layout Style', 'glowify-wp'),
        'fields' => array(
            array(
                'id'      => 'shop_layout',
                'type'    => 'select',
                'title'   => esc_html__('Select Style', 'glowify-wp'),
                'default' => 'style-1',
                'options' => array(
                    'style-1'  => esc_attr__('Style 1', 'glowify-wp'),
                    'style-2'    => esc_attr__('Style 2', 'glowify-wp'),
                    'style-3'    => esc_attr__('Style 3', 'glowify-wp'),
                    'style-4'    => esc_attr__('Style 4', 'glowify-wp'),
                ),
                'desc'    => esc_html__('Select product detail style.', 'glowify-wp'),
            ),
        ),
    ));

    // Create a section
    CSF::createSection($glowify_wp_shop_options, array(
        'title'     => esc_html__('Voucher Promo', 'glowify-wp'),
        'fields' => array(
            array(
                'id'      => 'enable_voucher',
                'type'    => 'switcher',
                'title'   => esc_html__('Enable Voucher Promo', 'glowify-wp'),
                'default' => false,
            ),

            array(
                'id'         => 'voucher_heading',
                'type'       => 'text',
                'title'      => esc_html__('Voucher Heading', 'glowify-wp'),
                'desc'       => esc_html__('Type title here', 'glowify-wp'),
                'dependency' => array('enable_voucher', '==', 'true'),
            ),

            array(
                'id'         => 'voucher_desc',
                'type'       => 'text',
                'title'      => esc_html__('Voucher Description', 'glowify-wp'),
                'desc'       => esc_html__('Type desription here', 'glowify-wp'),
                'dependency' => array('enable_voucher', '==', 'true'),
            ),


            array(
				'id'       => 'voucher_list',
				'type'     => 'group',
				'title'    => esc_html__('Voucher List', 'glowify-wp'),
				'dependency' => array('enable_voucher', '==', 'true'),
				'fields'   => array(
                    array(
                        'id'         => 'title',
                        'type'       => 'text',
                        'title'      => esc_html__('Type Title', 'glowify-wp'),
                        'default'    => '5% off',
                    ),
					array(
                        'id'         => 'desc',
                        'type'       => 'text',
                        'title'      => esc_html__('Type Text', 'glowify-wp'),
                        'default'    => 'for your entire purchase',
                    ),
					array(
                        'id'         => 'promo',
                        'type'       => 'text',
                        'title'      => esc_html__('Promo Code', 'glowify-wp'),
                        'default'    => 'GLOW15',
                    ),
                    array(
                        'id'         => 'tooltip',
                        'type'       => 'text',
                        'title'      => esc_html__('Tooltip Text', 'glowify-wp'),
                        'default'    => 'This voucher will apply only for first user',
                    ),
				),
			),

        ),
    ));

    // Create a section
    CSF::createSection($glowify_wp_shop_options, array(
        'title'     => esc_html__('Ingredients', 'glowify-wp'),
        'fields' => array(
            array(
				'id'       => 'product_features',
				'type'     => 'group',
				'title'    => esc_html__('Product Features', 'glowify-wp'),
				'fields'   => array(
                    array(
                        'id'         => 'title',
                        'type'       => 'text',
                        'title'      => esc_html__('Type Title', 'glowify-wp'),
                        'default'    => 'Synthetic Silk Fibers:',
                    ),
					array(
                        'id'         => 'desc',
                        'type'       => 'textarea',
                        'title'      => esc_html__('Type Text', 'glowify-wp'),
                        'default'    => 'Mimic the look and feel of natural lashes, providing a soft and lightweight texture',
                    ),
				),
			),

        ),
    ));

    // Create a section
    CSF::createSection($glowify_wp_shop_options, array(
        'title'     => esc_html__('How to Use', 'glowify-wp'),
        'fields' => array(
            array(
				'id'       => 'product_use',
				'type'     => 'group',
				'title'    => esc_html__('How to Use', 'glowify-wp'),
				'fields'   => array(
                    array(
                        'id'         => 'title',
                        'type'       => 'textarea',
                        'title'      => esc_html__('Type Title', 'glowify-wp'),
                        'default'    => 'Cleanse your face and pat dry.',
                    ),
				),
			),

        ),
    ));


    

   
}
?>
