<?php
/**
 * General tab in plugin settings.
 *
 * @package YITH\CostOfGoods
 */

return array(
	'settings' => apply_filters(
		'yith_cog_settings_options',
		array(
			'settings_tab_settings_options_start'   => array(
				'type' => 'sectionstart',
				'id'   => 'yith_settings_tab_start',
			),
			'settings_tab_settings_options_title'   => array(
				'title' => esc_html__( 'Sales report data', 'yith-cost-of-goods-for-woocommerce' ),
				'type'  => 'title',
				'desc'  => esc_html__( 'Select which information you want to add to the total section of the sales report table', 'yith-cost-of-goods-for-woocommerce' ),
				'id'    => 'yith_cog_settings_tab_title',
			),
			'order_fees'                            => array(
				'name'            => '',
				'type'            => 'checkbox',
				'checkboxgroup'   => 'start',
				'show_if_checked' => 'option',
				'id'              => 'yith_cog_include_fees_as_cost',
				'desc'            => __( 'Add order fees as a cost in the totals', 'yith-cost-of-goods-for-woocommerce' ),
				'default'         => 'no',
			),
			'order_shipping_cost'                   => array(
				'type'          => 'checkbox',
				'checkboxgroup' => '',
				'id'            => 'yith_cog_include_shipping_as_cost',
				'desc'          => __( 'Add order shipping as a cost in the totals', 'yith-cost-of-goods-for-woocommerce' ),
				'default'       => 'no',
			),
			'order_shipping_margin'                 => array(
				'type'          => 'checkbox',
				'checkboxgroup' => '',
				'id'            => 'yith_cog_include_shipping_as_margin',
				'desc'          => __( 'Add order shipping as a profit in the totals', 'yith-cost-of-goods-for-woocommerce' ),
				'default'       => 'no',
			),
			'order_taxes_cost'                      => array(
				'type'          => 'checkbox',
				'checkboxgroup' => 'end',
				'id'            => 'yith_cog_include_taxes_as_cost',
				'desc'          => __( 'Add taxes as a cost in each product', 'yith-cost-of-goods-for-woocommerce' ),
				'default'       => 'no',
			),
			'settings_tab_settings_options_end'     => array(
				'type' => 'sectionend',
				'id'   => 'yith_settings_tab_end',
			),
			'add_columns_tab_start'                 => array(
				'type' => 'sectionstart',
				'id'   => 'yith_add_columns_settings_tab_start',
			),
			'add_columns_tab_title'                 => array(
				'title' => esc_html__( 'Custom report columns', 'yith-cost-of-goods-for-woocommerce' ),
				'type'  => 'title',
				'desc'  => esc_html__( 'Add extra columns to show custom fields in the reports', 'yith-cost-of-goods-for-woocommerce' ),
				'id'    => 'yith_cog_add_columns_tab',
			),
			'yith_cog_columns_custom_fields_toggle' => array(
				'id'               => 'yith_cog_columns_custom_fields_toggle',
				'type'             => 'yith-field',
				'yith-type'        => 'toggle-element',
				'add_button'       => __( 'Add new column', 'yith-cost-of-goods-for-woocommerce' ),
				'title'            => '%%cog_custom_column_name%%',
				'yith-display-row' => false,
				'elements'         => array(
					array(
						'id'        => 'cog_custom_column_name',
						'name'      => _x( 'Column name', '[admin]Plugin option label', 'yith-cost-of-goods-for-woocommerce' ),
						'desc'      => _x( 'Enter the name that will be displayed in the column header', '[admin]Plugin option label', 'yith-cost-of-goods-for-woocommerce' ),
						'type'      => 'yith-field',
						'yith-type' => 'text',
					),
					array(
						'id'        => 'cog_custom_column_meta',
						'name'      => _x( 'Custom field', '[admin]Plugin option label', 'yith-cost-of-goods-for-woocommerce' ),
						'desc'      => _x( 'Enter the custom field or meta name, as stored in the database', '[admin]Plugin option label', 'yith-cost-of-goods-for-woocommerce' ),
						'type'      => 'yith-field',
						'yith-type' => 'text',
					),
				),
				'save_button'      => array(
					'id'   => 'yith_cog_save_column',
					'name' => _x( 'Save column', 'Save custom columns in settings', 'yith-cost-of-goods-for-woocommerce' ),
				),
				'sortable'         => true,
				'delete_button'    => array(
					'id'   => 'yith_cog_delete_column',
					'name' => _x( 'Delete column', 'Delete custom columns in settings', 'yith-cost-of-goods-for-woocommerce' ),
				),
			),
			'add_columns_tab_end'                   => array(
				'type' => 'sectionend',
				'id'   => 'yith_add_columns_settings_tab_end',
			),

			'previous_orders_tab_start'             => array(
				'type' => 'sectionstart',
				'id'   => 'yith_previous_orders_settings_tab_start',
			),
			'previous_orders_tab_title'             => array(
				'title' => esc_html__( 'Manage previous orders\' costs', 'yith-cost-of-goods-for-woocommerce' ),
				'type'  => 'title',
				'desc'  => esc_html__( 'Apply the cost to orders made before the plugin installation', 'yith-cost-of-goods-for-woocommerce' ),
				'id'    => 'yith_cog_previous_orders_tab',
			),
			'previous_orders_tab_no_costs_set'      => array(
				'title' => '',
				'desc'  => '',
				'id'    => '',
				'type'  => 'yith_cog_apply_cost_html',
				'html'  => '',
			),
			'previous_orders_tab_end'               => array(
				'type' => 'sectionend',
				'id'   => 'yith_settings_tab_end',
			),
		)
	),
);


