<?php
/**
 * Define setting fields for all vendors page. This will be use for VueJS
 *
 * @version 2.6.5 - Fix security issues.
 *
 * @phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
 * @phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
 */
$currency_symbol   = html_entity_decode( get_woocommerce_currency_symbol() );
$policy_html       = wc_string_to_bool( get_option( 'wcvendors_allow_settings_policy_html', 'no' ) );
$store_notice_html = wc_string_to_bool( get_option( 'wcvendors_allow_settings_store_notice', 'no' ) );
$shop_desc_html    = wc_string_to_bool( get_option( 'wcvendors_display_shop_description_html', 'no' ) );
$allow_markup      = wc_string_to_bool( get_option( 'wcvendors_allow_form_markup', 'no' ) );
$site_country      = wc_get_base_location();
$general_fields    = array(
    array(
        'id'          => 'shop_name',
        'title'       => __( 'Shop Name', 'wc-vendors' ),
        'desc'        => __( 'Enter the name of vendor store.', 'wc-vendors' ),
        'type'        => 'text',
        'default'     => '',
        'placeholder' => __( 'Enter vendor store name', 'wc-vendors' ),
        'is_pro'      => false,
    ),
    array(
        'id'         => 'seller_info',
        'title'      => __( 'Seller Information', 'wc-vendors' ),
        'desc'       => __( 'Enter the information of vendor store.', 'wc-vendors' ),
        'type'       => 'wp_editor',
        'default'    => '',
        'is_pro'     => false,
        'use_editor' => $allow_markup,
    ),
    array(
        'id'         => 'shop_description',
        'title'      => __( 'Store Description', 'wc-vendors' ),
        'desc'       => __( 'Enter the description of vendor store.', 'wc-vendors' ),
        'type'       => 'wp_editor',
        'default'    => '',
        'is_pro'     => false,
        'use_editor' => $shop_desc_html,
    ),
    array(
        'id'      => 'html_enabled',
        'title'   => __( 'Store HTML', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Enable HTML in store description.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => false,
    ),
    array(
        'id'      => 'verified_vendor',
        'title'   => __( 'Verifed Vendor', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Check to publish that this vendor is verified by the store admin.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Check to publish that this vendor is verified by the store admin.', 'wc-vendors' ),
    ),
    array(
        'id'      => 'trusted_vendor',
        'title'   => __( 'Trusted Vendor', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Check to allow this vendor to publish products immediately regardless of global publishing rules.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Check to allow this vendor to publish products immediately regardless of global publishing rules.', 'wc-vendors' ),
    ),
    array(
        'id'      => 'untrusted_vendor',
        'title'   => __( 'Untrusted Vendor', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Check to require all products submitted to be reviewed, regardless of global publishing rules. This overrides the trusted vendor option.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Check to require all products submitted to be reviewed, regardless of global publishing rules. This overrides the trusted vendor option.', 'wc-vendors' ),
    ),
    array(
        'id'      => 'lock_new_products',
        'title'   => __( 'Lock New Products', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Prevent this Vendor from creating new products.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( ' From time to time you may wish to stop a Vendor from creating any further new products. This allows you to implement some admin control without completely disabling the Vendor.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'lock_new_products_msg',
        'title'            => __( 'Lock New Products Message', 'wc-vendors' ),
        'type'             => 'wp_editor',
        'desc'             => __( 'Enter the message to display to vendors when they try to create a new product.', 'wc-vendors' ),
        'default'          => '',
        'is_pro'           => true,
        'intro'            => __( 'Prevent vendors from creating new products', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'lock_new_products',
            'value' => array( 'yes' ),
        ),
        'use_editor'       => $allow_markup,
    ),
    array(
        'id'      => 'lock_edit_products',
        'title'   => __( 'Lock Edit Products', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Prevent this Vendor from editing existing products.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'From time to time you may wish to stop a Vendor from editing any of their existing products. This allows you to implement some admin control without completely disabling the Vendor.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'lock_edit_products_msg',
        'title'            => __( 'Lock Edit Products Message', 'wc-vendors' ),
        'type'             => 'wp_editor',
        'desc'             => __( 'Enter the message to display to vendors when they try to edit an existing product.', 'wc-vendors' ),
        'default'          => '',
        'is_pro'           => true,
        'intro'            => __( 'Prevent vendors from editing existing products', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'lock_edit_products',
            'value' => array( 'yes' ),
        ),
        'use_editor'       => $allow_markup,
    ),
    array(
        'id'      => 'show_total_sales',
        'title'   => __( 'Product Total Sales', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( ' Show the total number of product sales by this vendor on their store.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Show the total number of product sales by this vendor on their store. This is a great way to boost trust in Vendors and show end customers how many sales this Vendor has had historically.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_url',
        'title'       => __( 'Store Website/Blog URL', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the URL of vendor store.', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter vendor store URL', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'Allow your Vendors to add an external link to their website or blog.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_phone',
        'title'       => __( 'Store Phone', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the phone number of vendor store.', 'wc-vendors' ),
        'default'     => '112',
        'placeholder' => __( 'Enter vendor store phone', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'Allow your Vendors to specify a phone number to be shown on their store pages.', 'wc-vendors' ),
    ),
    array(
        'id'        => 'store_map',
        'title'     => __( 'Store Map', 'wc-vendors' ),
        'type'      => 'component',
        'component' => 'GMap',
        'is_pro'    => true,
        'intro'     => __( 'Let your Vendors show a Google Map of their store location on their store pages. This is great for Vendors with both digital and physical presences.', 'wc-vendors' ),
    ),
    array(
        'id'     => 'store_coordinates',
        'type'   => 'coordinates',
        'title'  => __( 'Store Coordinates', 'wc-vendors' ),
        'childs' => array(
            'lat' => array(
                'id'    => 'store_lat',
                'title' => __( 'Store Latitude', 'wc-vendors' ),
                'type'  => 'text',
            ),
            'lng' => array(
                'id'    => 'store_lng',
                'title' => __( 'Store Longitude', 'wc-vendors' ),
                'type'  => 'text',
            ),
        ),
        'is_pro' => true,
    ),
    array(
        'id'          => 'store_address',
        'title'       => __( 'Store Address', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the address of vendor store.', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter vendor store address', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'Let your Vendors set their store address to show on their store pages. This is great for Vendors with both digital and physical presences.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_address2',
        'title'       => __( 'Store Address 2', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the address 2 of vendor store.', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter vendor store address 2', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'Let your Vendors set their second store address to show on their store pages. This is great for Vendors with both digital and physical presences.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_country',
        'title'       => __( 'Store Country', 'wc-vendors' ),
        'type'        => 'country_select',
        'desc'        => __( 'Select the country of vendor store.', 'wc-vendors' ),
        'default'     => $site_country['country'],
        'placeholder' => __( 'Select vendor store country', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'The vendor\'s country', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_state',
        'title'       => __( 'Store State', 'wc-vendors' ),
        'type'        => 'state_select',
        'desc'        => __( 'Enter the state of vendor store.', 'wc-vendors' ),
        'default'     => $site_country['state'],
        'placeholder' => __( 'Enter vendor store state', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'The vendor\'s state', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_city',
        'title'       => __( 'Store City', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the city of vendor store.', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter vendor store city', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'The vendor\'s city', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_postcode',
        'title'       => __( 'Store PostCode/Zip', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the zip of vendor store.', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter vendor store zip', 'wc-vendors' ),
        'is_pro'      => false,
        'intro'       => __( 'The vendor\'s zip code', 'wc-vendors' ),
    ),
    array(
        'id'      => 'enabled_store_notice',
        'title'   => __( 'Store Notice', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Let the Vendor show a message to customers with a notice at the top of their store.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'From time to time, your Vendors may want to show a custom message to customers. This lets your Vendors write a short notice to display at the top of their store pages.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'store_notice',
        'title'            => __( 'Store Notice Message', 'wc-vendors' ),
        'type'             => 'wp_editor',
        'desc'             => __( 'Enter the message to display on vendor store', 'wc-vendors' ),
        'default'          => '',
        'is_pro'           => true,
        'intro'            => __( 'Enter the message to display on vendor store', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'enabled_store_notice',
            'value' => array( 'yes' ),
        ),
        'use_editor'       => $store_notice_html && $allow_markup,
    ),
    array(
        'id'      => 'vacation_mode',
        'title'   => __( 'Store Vacation', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Enable Store Vacation.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Let your Vendors enable Vacation Mode which prevents their products being purchased during a specific time period.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'vacation_mode_msg',
        'title'            => __( 'Store Vacation Message', 'wc-vendors' ),
        'type'             => 'wp_editor',
        'desc'             => __( 'Enter the message to display on vendor store', 'wc-vendors' ),
        'default'          => '',
        'is_pro'           => true,
        'intro'            => __( 'Enter the message to display on vendor store', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'vacation_mode',
            'value' => array( 'yes' ),
        ),
        'use_editor'       => $allow_markup,
    ),
    array(
        'id'      => 'enable_google_analytics',
        'title'   => __( 'Store Google Analytics', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Let the Vendor add Google Analytics code to their store pages.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Let the Vendor add Google Analytics code to their store pages.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'google_analytics_id',
        'title'            => __( 'Store Google Analytics ID', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the Google Analytics ID for the vendor\'s store', 'wc-vendors' ),
        'default'          => '',
        'is_pro'           => true,
        'intro'            => __( 'Enter the Google Analytics ID for the vendor\'s store', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'enable_google_analytics',
            'value' => array( 'yes' ),
        ),
    ),
    array(
        'id'      => 'enable_store_opening_hours',
        'title'   => __( 'Store Opening Hours', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Allow the Vendor to set specific opening hours on their store.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Allow the Vendor to set specific opening hours to be shown on their store pages.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'store_opening_hours',
        'title'            => __( 'Store Opening Hours Table', 'wc-vendors' ),
        'type'             => 'component',
        'component'        => 'OpeningHours',
        'desc'             => __( 'Set the opening hours for the vendor\'s store', 'wc-vendors' ),
        'default'          => '',
        'is_pro'           => true,
        'intro'            => __( 'Set the opening hours for the vendor\'s store', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'enable_store_opening_hours',
            'value' => array( 'yes' ),
        ),
        'is_row_full'      => true,
    ),
    array(
        'id'               => 'disable_cart',
        'title'            => __( 'Disable Add to Cart', 'wc-vendors' ),
        'type'             => 'checkbox',
        'desc'             => __( 'Disable cart when vendor is on vacation.', 'wc-vendors' ),
        'default'          => 'no',
        'is_pro'           => true,
        'intro'            => __( 'Disable cart when vendor is on vacation.', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'vacation_mode',
            'value' => array( 'yes' ),
        ),
    ),
);

$commission_payout_fields = array(
    array(
        'id'      => 'payout_method',
        'title'   => __( 'Commission Payout Method', 'wc-vendors' ),
        'type'    => 'select',
        'desc'    => __( 'Select the commission payout method for the vendor', 'wc-vendors' ),
        'default' => '',
        'options' => array(
            'paypal' => __( 'PayPal', 'wc-vendors' ),
            'bank'   => __( 'Bank', 'wc-vendors' ),

        ),
        'intro'   => __( 'Select the commission payout method for the vendor', 'wc-vendors' ),
    ),
    array(
        'id'               => 'paypal_masspay',
        'type'             => 'select',
        'title'            => __( 'PayPal Payout Method', 'wc-vendors' ),
        'desc'             => __( 'Select the payout method for the vendor', 'wc-vendors' ),
        'default'          => '',
        'options'          => array(
            'paypal' => __( 'PayPal Email', 'wc-vendors' ),
            'venmo'  => __( 'Venmo ID', 'wc-vendors' ),
        ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'payout_method',
            'value' => array( 'paypal' ),
        ),
    ),
    array(
        'id'               => 'paypal_email',
        'title'            => __( 'PayPal Email', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the PayPal email address for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter PayPal email address', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'paypal_masspay',
            'value' => array( 'paypal' ),
        ),
    ),
    array(
        'id'               => 'venmo_id',
        'title'            => __( 'Venmo ID', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the Venmo ID for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter Venmo ID', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'paypal_masspay',
            'value' => array( 'venmo' ),
        ),
    ),
    array(
        'id'               => 'bank_account_name',
        'title'            => __( 'Bank Account Name', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the bank account name for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter bank account name', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'payout_method',
            'value' => array( 'bank' ),
        ),
    ),
    array(
        'id'               => 'bank_account_number',
        'title'            => __( 'Bank Account Number', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the bank account number for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter bank account number', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'payout_method',
            'value' => array( 'bank' ),
        ),
    ),
    array(
        'id'               => 'bank_name',
        'title'            => __( 'Bank Name', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the bank name for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter bank name', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'payout_method',
            'value' => array( 'bank' ),
        ),
    ),
    array(
        'id'               => 'bank_routing_number',
        'title'            => __( 'Bank Routing Number', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the bank routing number for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter bank routing number', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'payout_method',
            'value' => array( 'bank' ),
        ),
    ),
    array(
        'id'               => 'bank_bic',
        'title'            => __( 'Bank BIC/SWIFT', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the bank BIC/SWIFT for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter bank BIC/SWIFT', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'payout_method',
            'value' => array( 'bank' ),
        ),
    ),
    array(
        'id'               => 'bank_iban',
        'title'            => __( 'Bank IBAN', 'wc-vendors' ),
        'type'             => 'text',
        'desc'             => __( 'Enter the bank IBAN for the vendor', 'wc-vendors' ),
        'default'          => '',
        'placeholder'      => __( 'Enter bank IBAN', 'wc-vendors' ),
        'is_pro'           => false,
        'render_condition' => array(
            'key'   => 'payout_method',
            'value' => array( 'bank' ),
        ),
    ),
    array(
        'id'      => 'give_tax',
        'title'   => __( 'Give Tax Override', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Allow the vendor to override the default tax settings for their products.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Allow the vendor to override the default tax settings for their products. This is useful if the vendor is selling products in a different country or state with different tax rates.', 'wc-vendors' ),
    ),
    array(
        'id'      => 'give_shipping',
        'title'   => __( 'Give Shipping Override', 'wc-vendors' ),
        'type'    => 'checkbox',
        'desc'    => __( 'Allow the vendor to override the default shipping settings for their products.', 'wc-vendors' ),
        'default' => 'no',
        'is_pro'  => true,
        'intro'   => __( 'Allow the vendor to override the default shipping settings for their products. This is useful if the vendor is selling products in a different country or state with different shipping rates.', 'wc-vendors' ),
    ),
    array(
        'id'      => 'commission_type',
        'title'   => __( 'Commission Type', 'wc-vendors' ),
        'type'    => 'select',
        'desc'    => __( 'Select the commission type for the vendor', 'wc-vendors' ),
        'default' => 'percent',
        'options' => array(
            'percent'       => __( 'Percent', 'wc-vendors' ),
            'fixed'         => __( 'Fixed', 'wc-vendors' ),
            'percent_fee'   => __( 'Percent Fee', 'wc-vendors' ),
            'fixed_fee'     => __( 'Fixed Fee', 'wc-vendors' ),
            'vendor_sales'  => __( 'Vendor Sales', 'wc-vendors' ),
            'product_sales' => __( 'Product Sales', 'wc-vendors' ),
            'product_price' => __( 'Product Price', 'wc-vendors' ),
        ),
        'is_pro'  => true,
        'intro'   => sprintf(
            /* translators: %s break line */
            esc_html__(
                'The type of commission that will be paid to the vendor for products sold. This could be a percentage of the sale price or a fixed amount.%1$s
        Available options:%2$s
        - Percentage (Pro)%3$s
        - Percentage + fee (Pro)%4$s
        - Fixed (Pro)%5$s
        - Fixed + fee (Pro)%6$s
        - Sales by vendor (Pro)%7$s
        - Sales by Product (Pro)%8$s
        - Product Price (Pro)',
                'wc-vendors'
            ),
            '<br>',
            '<br>',
            '<br>',
            '<br>',
            '<br>',
            '<br>',
            '<br>',
            '<br>'
        ),
    ),
    array(
        'id'               => 'commission_amount',
        'title'            => __( 'Commission Amount', 'wc-vendors' ),
        'type'             => 'number',
        'desc'             => __( 'Enter the commission amount for the vendor', 'wc-vendors' ),
        'is_pro'           => true,
        'render_condition' => array(
            'key'   => 'commission_type',
            'value' => array( 'fixed', 'fixed_fee' ),
        ),
        'addon_after'      => $currency_symbol,
        'intro'            => __( 'The amount of commission that will be paid to the vendor for products sold. This could be a percentage of the sale price or a fixed amount.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'commission_percent',
        'title'            => __( 'Commission Percent', 'wc-vendors' ),
        'type'             => 'number',
        'desc'             => __( 'Enter the commission percent for the vendor', 'wc-vendors' ),
        'is_pro'           => true,
        'intro'            => __( 'The percentage of the sale price that will be paid to the vendor for products sold.', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'commission_type',
            'value' => array( 'percent', 'percent_fee' ),
        ),
        'addon_after'      => '%',
    ),
    array(
        'id'               => 'commission_fee',
        'title'            => __( 'Commission Fee', 'wc-vendors' ),
        'type'             => 'number',
        'desc'             => __( 'Enter the commission fee for the vendor', 'wc-vendors' ),
        'is_pro'           => true,
        'intro'            => __( 'The fixed amount that will be paid to the vendor for products sold.', 'wc-vendors' ),
        'default'          => '0.00',
        'addon_after'      => $currency_symbol,
        'render_condition' => array(
            'key'   => 'commission_type',
            'value' => array( 'percent_fee', 'fixed_fee' ),
        ),
    ),
    array(
        'id'               => 'commission_tiers',
        'title'            => __( 'Commission Tiers', 'wc-vendors' ),
        'type'             => 'component',
        'component'        => 'CommissionTiers',
        'is_pro'           => true,
        'intro'            => __( 'Set commission tiers for your vendors. This allows you to set different commission rates for different sales volumes.', 'wc-vendors' ),
        'render_condition' => array(
            'key'   => 'commission_type',
            'value' => array( 'vendor_sales', 'product_sales', 'product_price' ),
        ),
    ),
);

$branding_fields = array(
    array(
        'id'          => 'store_banner',
        'title'       => __( 'Store Banner', 'wc-vendors' ),
        'type'        => 'image',
        'desc'        => __( 'Upload the banner for vendor store.', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Upload vendor store banner', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The store banner is a large image that will be displayed at the top of the vendor\'s store page.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'store_icon',
        'title'       => __( 'Store Icon', 'wc-vendors' ),
        'type'        => 'image',
        'desc'        => __( 'Upload the icon for vendor store.', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Upload vendor store icon', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The store icon is a small image that will be displayed next to the vendor\'s name on the store page.', 'wc-vendors' ),
    ),

);

$seo_social_fields = array(
    array(
        'id'          => 'seo_title',
        'title'       => __( 'SEO Title', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the SEO title for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter SEO title', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Allow Vendors to customize the SEO title of their Vendor store page. This helps them fine-tune their search visibility, allowing them to target specific keywords.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'seo_meta_description',
        'title'       => __( 'SEO Meta Description', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the SEO meta description for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter SEO meta description', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Allow Vendors to customize the SEO Meta Description of their Vendor store page. This helps them control the display of their listing in search engines.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'seo_meta_keywords',
        'title'       => __( 'SEO Meta Keywords', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the SEO meta keywords for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter SEO meta keywords', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Allow Vendors to customize the SEO Meta Keywords of their Vendor store page. This can help them control the target keywords of their store page in search engines.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'facebook_title',
        'title'       => __( 'Facebook Title', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the Facebook title for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter Facebook title', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Let Vendors control how Facebook shows the title of their Vendor store page when shared on Facebook and related Meta social networks.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'facebook_description',
        'title'       => __( 'Facebook Description', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the Facebook description for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter Facebook description', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Let Vendors control how Facebook shows the description text of their Vendor store page when shared on Facebook and related Meta social networks.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'facebook_image',
        'title'       => __( 'Facebook Image', 'wc-vendors' ),
        'type'        => 'image',
        'desc'        => __( 'Upload the Facebook image for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Upload Facebook image', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Let Vendors control the image that Facebook shows for the Vendor store page when shared on Facebook and related Meta social networks.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'twitter_title',
        'title'       => __( 'X (formerly Twitter) Title', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the X (formerly Twitter) title for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter X (formerly Twitter) title', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Let Vendors control how X (formerly Twitter) shows the title of their Vendor store page when shared.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'twitter_description',
        'title'       => __( 'X (formerly Twitter) Description', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the X (formerly Twitter) description for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter X (formerly Twitter) description', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Let Vendors control how X (formerly Twitter) shows the description text of their Vendor store page when shared.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'twitter_image',
        'title'       => __( 'X (formerly Twitter) Image', 'wc-vendors' ),
        'type'        => 'image',
        'desc'        => __( 'Upload the X (formerly Twitter) image for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Upload X (formerly Twitter) image', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'Let Vendors control the image that X (formerly Twitter) shows for their Vendor store page when shared.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'facebook_url',
        'title'       => __( 'Facebook URL', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the Facebook URL for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter Facebook URL', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The Facebook URL for the vendor\'s store. This is the URL of the vendor\'s Facebook page.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'instagram_username',
        'title'       => __( 'Instagram Username', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the Instagram username for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter Instagram username', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The Instagram username for the vendor\'s store. This is the username of the vendor\'s Instagram account.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'pinterest_url',
        'title'       => __( 'Pinterest URL', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the Pinterest URL for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter Pinterest URL', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The Pinterest URL for the vendor\'s store. This is the URL of the vendor\'s Pinterest page.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'youtube_url',
        'title'       => __( 'YouTube URL', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the YouTube URL for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter YouTube URL', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The YouTube URL for the vendor\'s store. This is the URL of the vendor\'s YouTube page.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'linkedin_url',
        'title'       => __( 'LinkedIn URL', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the LinkedIn URL for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter LinkedIn URL', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The LinkedIn URL for the vendor\'s store. This is the URL of the vendor\'s LinkedIn page.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'telegram_username',
        'title'       => __( 'Telegram Username', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the Telegram username for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter Telegram username', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The Telegram username for the vendor\'s store. This is the username of the vendor\'s Telegram account.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'snapchat_username',
        'title'       => __( 'Snapchat Username', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the Snapchat username for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter Snapchat username', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The Snapchat username for the vendor\'s store. This is the username of the vendor\'s Snapchat account.', 'wc-vendors' ),
    ),
    array(
        'id'          => 'twitter_username',
        'title'       => __( 'X (formerly Twitter) Username', 'wc-vendors' ),
        'type'        => 'text',
        'desc'        => __( 'Enter the X (formerly Twitter) username for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter X (formerly Twitter) username', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The X (formerly Twitter) username for the vendor\'s store. This is the username of the vendor\'s X (formerly Twitter) account.', 'wc-vendors' ),
    ),
);

$shipping_fields = array(
    array(
        'id'      => 'shipping_type',
        'title'   => __( 'Shipping Type', 'wc-vendors' ),
        'type'    => 'select',
        'desc'    => __( 'Select the shipping type for the vendor', 'wc-vendors' ),
        'default' => 'flat',
        'options' => array(
            'flat'    => __( 'Flat Rate', 'wc-vendors' ),
            'country' => __( 'Country Table Rates', 'wc-vendors' ),
        ),
        'is_pro'  => true,
        'intro'   => __( 'The type of shipping that will be used for products sold. This could be flat rate shipping, or country table rates', 'wc-vendors' ),
    ),
    array(
        'id'          => 'product_handling_fee',
        'title'       => __( 'Product Handling Fee', 'wc-vendors' ),
        'type'        => 'number',
        'desc'        => __( 'Enter the handling fee for the vendor', 'wc-vendors' ),
        'is_pro'      => true,
        'nested'      => true,
        'nested_key'  => 'shipping_flat_rate.product_handling_fee',
        'addon_after' => $currency_symbol,
        'intro'       => __( 'The handling fee that will be charged for each product sold. This is a fee that is added to the product price to cover the cost of shipping and handling.', 'wc-vendors' ),
    ),
    array(
        'id'         => 'shipping_from',
        'title'      => __( 'Shipping From', 'wc-vendors' ),
        'type'       => 'select',
        'desc'       => __( 'Select the shipping from for the vendor', 'wc-vendors' ),
        'default'    => 'store_address',
        'options'    => array(
            'store_address' => __( 'Store Address', 'wc-vendors' ),
            'other'         => __( 'Other Address', 'wc-vendors' ),
        ),
        'nested'     => true,
        'nested_key' => 'shipping_flat_rate.shipping_from',
        'is_pro'     => true,
        'intro'      => __( 'The location from which products will be shipped. This could be the vendor\'s physical store, a warehouse, or a fulfillment center.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'shipping_address',
        'title'            => __( 'Shipping Address', 'wc-vendors' ),
        'type'             => 'component',
        'component'        => 'ShippingAddress',
        'is_pro'           => true,
        'is_row_full'      => true,
        'render_condition' => array(
            'key'   => 'shipping_flat_rate.shipping_from',
            'value' => array( 'other' ),
        ),
    ),
    array(
        'id'               => 'shipping_flat_rate',
        'title'            => __( 'Flat Rate', 'wc-vendors' ),
        'type'             => 'component',
        'component'        => 'ShippingFlat',
        'desc'             => __( 'Enter the flat rate for the vendor', 'wc-vendors' ),
        'is_pro'           => true,
        'render_condition' => array(
            'key'   => 'shipping_type',
            'value' => array( 'flat' ),
        ),
        'props'            => array(
            'rates'    => 'shipping_flat_rate',
            'currency' => $currency_symbol,

        ),
        'is_row_full'      => true,
        'intro'            => __( 'Flat rates are shipping rates that are applied to all orders, regardless of the destination. This is a simple way to set shipping rates for your marketplace.', 'wc-vendors' ),
    ),
    array(
        'id'               => 'shipping_table_rates',
        'title'            => __( 'Table Rates', 'wc-vendors' ),
        'type'             => 'component',
        'component'        => 'ShippingTableRates',
        'render_condition' => array(
            'key'   => 'shipping_type',
            'value' => array( 'country' ),
        ),
        'props'            => array(
            'rates'    => 'shipping_table_rates',
            'currency' => $currency_symbol,
        ),
        'is_pro'           => true,
        'is_row_full'      => true,
        'intro'            => __( 'Country table rates are shipping rates that are applied to orders based on the destination country. This is a more complex way to set shipping rates, but it can be more accurate.', 'wc-vendors' ),
    ),
);

$policies_fields = array(
    array(
        'id'          => 'privacy_policy',
        'title'       => __( 'Privacy Policy', 'wc-vendors' ),
        'type'        => 'wp_editor',
        'desc'        => __( 'Enter the privacy policy for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter privacy policy', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The privacy policy that will be used for the vendor\'s store. This policy should explain how the vendor collects, uses, and shares customer data.', 'wc-vendors' ),
        'use_editor'  => $allow_markup && $policy_html,
    ),
    array(
        'id'          => 'terms_and_conditions',
        'title'       => __( 'Terms and Conditions', 'wc-vendors' ),
        'type'        => 'wp_editor',
        'desc'        => __( 'Enter the terms and conditions for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter terms and conditions', 'wc-vendors' ),
        'is_pro'      => true,
        'intro'       => __( 'The terms and conditions that will be used for the vendor\'s store. This policy should explain the terms of use for the vendor\'s store, such as the refund policy and the return policy.', 'wc-vendors' ),
        'use_editor'  => $allow_markup && $policy_html,
    ),
    array(
        'id'          => 'shipping_policy',
        'title'       => __( 'Shipping Policy', 'wc-vendors' ),
        'type'        => 'wp_editor',
        'desc'        => __( 'Enter the shipping policy for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter shipping policy', 'wc-vendors' ),
        'is_pro'      => true,
        'nested'      => true,
        'nested_key'  => 'shipping_flat_rate.shipping_policy',
        'intro'       => __( 'The shipping policy that will be used for the vendor\'s store. This policy should explain the shipping rates and shipping methods that are available for the vendor\'s products.', 'wc-vendors' ),
        'use_editor'  => $allow_markup && $policy_html,
    ),
    array(
        'id'          => 'return_policy',
        'title'       => __( 'Return Policy', 'wc-vendors' ),
        'type'        => 'wp_editor',
        'desc'        => __( 'Enter the return policy for the vendor', 'wc-vendors' ),
        'default'     => '',
        'placeholder' => __( 'Enter return policy', 'wc-vendors' ),
        'is_pro'      => true,
        'nested'      => true,
        'nested_key'  => 'shipping_flat_rate.return_policy',
        'intro'       => __( 'The return policy that will be used for the vendor\'s store. This policy should explain the conditions under which customers can return products for a refund or exchange.', 'wc-vendors' ),
        'use_editor'  => $allow_markup && $policy_html,
    ),
);

$settings_tabs = array(
    array(
        'key'    => 'general',
        'label'  => __( 'General', 'wc-vendors' ),
        'fields' => $general_fields,
    ),
    array(
        'key'    => 'commissions_payouts',
        'label'  => __( 'Commissions & Payouts', 'wc-vendors' ),
        'fields' => $commission_payout_fields,
    ),
    array(
        'key'    => 'branding',
        'label'  => __( 'Branding', 'wc-vendors' ),
        'fields' => $branding_fields,
    ),
    array(
        'key'    => 'seo_social',
        'label'  => __( 'SEO & Social', 'wc-vendors' ),
        'fields' => $seo_social_fields,
    ),
    array(
        'key'    => 'shipping',
        'label'  => __( 'Shipping', 'wc-vendors' ),
        'fields' => $shipping_fields,
    ),
    array(
        'key'    => 'policies',
        'label'  => __( 'Policies', 'wc-vendors' ),
        'fields' => $policies_fields,
    ),
);

return apply_filters( 'wc_vendors_all_vendors_page_setting_fields', $settings_tabs );
