fix Products, Coupons, and admin pages
This commit is contained in:
@@ -187,13 +187,111 @@ class Coupon {
|
||||
|
||||
public function rule_config($fields) {
|
||||
|
||||
$multicurrency = formipay_is_multi_currency_active();
|
||||
$all_currencies = formipay_currency_as_options();
|
||||
$global_selected_currencies = formipay_global_currency_options();
|
||||
$global_currencies = formipay_global_currency_options('raw');
|
||||
$default_currency = formipay_default_currency();
|
||||
|
||||
// Group : Rules
|
||||
$rules_group = array(
|
||||
$rules_group_1 = array(
|
||||
'rules_general_group' => array(
|
||||
'type' => 'group_title',
|
||||
'group' => 'started'
|
||||
),
|
||||
'active' => array(
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Active this coupon', 'formipay' ),
|
||||
'value' => true
|
||||
'value' => true,
|
||||
),
|
||||
'type' => array(
|
||||
'type' => 'radio',
|
||||
'label' => __( 'Type', 'formipay' ),
|
||||
'required' => true,
|
||||
'options' => array(
|
||||
'fixed' => __( 'Fixed', 'formipay' ),
|
||||
'percentage' => __( 'Percentage', 'formipay' )
|
||||
),
|
||||
),
|
||||
'amount_percentage' => array(
|
||||
'type' => 'number',
|
||||
'label' => __( 'Amount', 'formipay' ),
|
||||
'required' => true,
|
||||
'dependency' => array(
|
||||
'key' => 'type',
|
||||
'value' => 'percentage'
|
||||
),
|
||||
'group' => 'ended'
|
||||
)
|
||||
);
|
||||
|
||||
$rules_group_2 = [];
|
||||
|
||||
$global_currencies = get_global_currency_array();
|
||||
$default_currency = formipay_default_currency();
|
||||
|
||||
$rules_group_2['discount_amount_wrapper'] = array(
|
||||
'type' => 'group_title',
|
||||
'label' => __( 'Discount Amount', 'formipay' ),
|
||||
'dependency' => array(
|
||||
'key' => 'type',
|
||||
'value' => 'fixed'
|
||||
),
|
||||
'group' => 'started',
|
||||
);
|
||||
|
||||
$rules_group_max['discount_max_amount_wrapper'] = array(
|
||||
'type' => 'group_title',
|
||||
'label' => __( 'Max Discount Amount', 'formipay' ),
|
||||
'description' => __( 'Leave empty to not limit the max discount amount.', 'formipay' ),
|
||||
'group' => 'started',
|
||||
);
|
||||
|
||||
foreach($global_currencies as $currency){
|
||||
$default_currency_symbol = formipay_get_currency_data_by_value($default_currency, 'symbol');
|
||||
$currency_symbol = formipay_get_currency_data_by_value($currency['currency'], 'symbol');
|
||||
$currency_title = ucwords(formipay_get_currency_data_by_value($currency['currency'], 'title'));
|
||||
$decimal_digits = intval($currency['decimal_digits']);
|
||||
$step = $decimal_digits * 10;
|
||||
$step = $step > 0 ? 1 / $step : 1;
|
||||
|
||||
$rules_group_2['amount_fixed_'.$currency_symbol] = array(
|
||||
'type' => 'number',
|
||||
'label' => sprintf(
|
||||
__( '<img src="%s" width="18" /> Amount in %s', 'formipay' ),
|
||||
formipay_get_flag_by_currency($currency['currency']),
|
||||
$currency_symbol
|
||||
),
|
||||
'step' => $step,
|
||||
'min' => 0,
|
||||
'required' => true,
|
||||
'placeholder' => __( 'Enter Amount...', 'formipay' ),
|
||||
'dependency' => array(
|
||||
'key' => 'type',
|
||||
'value' => 'fixed'
|
||||
)
|
||||
);
|
||||
|
||||
$rules_group_max['max_amount_'.$currency_symbol] = array(
|
||||
'type' => 'number',
|
||||
'label' => sprintf(
|
||||
__( '<img src="%s" width="18" /> Max Amount in %s', 'formipay' ),
|
||||
formipay_get_flag_by_currency($currency['currency']),
|
||||
$currency_symbol
|
||||
),
|
||||
'step' => $step,
|
||||
'min' => 0,
|
||||
'placeholder' => __( 'Enter Max Amount...', 'formipay' )
|
||||
);
|
||||
|
||||
}
|
||||
$last_rules_group_2 = array_key_last($rules_group_2);
|
||||
$rules_group_2[$last_rules_group_2]['group'] = 'ended';
|
||||
|
||||
$last_rules_group_max = array_key_last($rules_group_max);
|
||||
$rules_group_max[$last_rules_group_max]['group'] = 'ended';
|
||||
|
||||
$rules_group_3 = array(
|
||||
'rules_group' => array(
|
||||
'type' => 'group_title',
|
||||
'label' => __( 'Rules', 'formipay' ),
|
||||
@@ -209,19 +307,6 @@ class Coupon {
|
||||
- <b>save10</b> is invalid<br>
|
||||
- <b>Save10</b> is invalid.', 'formipay' )
|
||||
),
|
||||
'type' => array(
|
||||
'type' => 'radio',
|
||||
'label' => __( 'Type', 'formipay' ),
|
||||
'options' => array(
|
||||
'fixed' => __( 'Fixed', 'formipay' ),
|
||||
'percentage' => __( 'Percentage', 'formipay' )
|
||||
)
|
||||
),
|
||||
'amount' => array(
|
||||
'type' => 'number',
|
||||
'label' => __( 'Amount', 'formipay' ),
|
||||
'description' => sprintf('<span style="color: red;">' . __( 'Be carefully, this amount is not regarding the currency.', 'formipay') . '</span>' )
|
||||
),
|
||||
'free_shipping' => array(
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Free Shipping', 'formipay' ),
|
||||
@@ -236,13 +321,15 @@ class Coupon {
|
||||
'value' => 'fixed'
|
||||
)
|
||||
),
|
||||
'max_discount' => array(
|
||||
'type' => 'number',
|
||||
'label' => __( 'Max Discount Amount', 'formipay' ),
|
||||
'description' => __( 'Leave it empty to not limit the max discount amount.', 'formipay' )
|
||||
),
|
||||
// 'max_discount' => array(
|
||||
// 'type' => 'number',
|
||||
// 'label' => __( 'Max Discount Amount', 'formipay' ),
|
||||
// 'description' => __( 'Leave it empty to not limit the max discount amount.', 'formipay' )
|
||||
// ),
|
||||
);
|
||||
|
||||
$rules_group = $rules_group_1 + $rules_group_2 + $rules_group_max + $rules_group_3;
|
||||
|
||||
$rules_group = apply_filters( 'formipay/coupon-settings/tab:rules/group:rules', $rules_group );
|
||||
|
||||
$last_rules_group = array_key_last($rules_group);
|
||||
@@ -290,8 +377,19 @@ class Coupon {
|
||||
'forms' => array(
|
||||
'type' => 'autocomplete',
|
||||
'post_type' => array('formipay-form'),
|
||||
'label' => __( 'These forms can use the coupon', 'formipay' ),
|
||||
'description' => __( 'Leave it empty to enable all forms to use this coupon. <span style="color: red;">Please be carefully, this coupon amount is not regarding the currency of the selected form.</span>', 'formipay' )
|
||||
'label' => __( 'Forms', 'formipay' ),
|
||||
'description' => __( 'Only selected form(s) can use the coupon. Leave empty to apply to all forms.', 'formipay' )
|
||||
),
|
||||
'products' => array(
|
||||
'type' => 'autocomplete',
|
||||
'post_type' => array('formipay-product'),
|
||||
'label' => __( 'Products', 'formipay' ),
|
||||
'description' => __( 'Only selected product(s) can use the coupon. Leave empty to apply to all products.', 'formipay' )
|
||||
),
|
||||
'customers' => array(
|
||||
'type' => 'autocomplete',
|
||||
'label' => __( 'Customers', 'formipay' ),
|
||||
'description' => __( 'Only selected customer(s) can use the coupon. Leave empty to apply to all customers.', 'formipay' )
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ class Customer {
|
||||
add_filter( 'formipay/global-settings/tab:general', [$this, 'global_settings'], 20 );
|
||||
add_filter( 'formipay/form-config', [$this, 'add_menu_on_product_setting'], 100 );
|
||||
|
||||
// For Coupon Autocomplete
|
||||
add_filter( 'stm_wpcfto_autocomplete_customers', [$this, 'autocomplete_options'], 100, 2 );
|
||||
|
||||
// Register new customer by order submitted
|
||||
add_action( 'formipay/order/new', [$this, 'add_customer'] );
|
||||
}
|
||||
@@ -448,4 +451,11 @@ class Customer {
|
||||
|
||||
}
|
||||
|
||||
public function autocomplete_options($r, $args) {
|
||||
|
||||
console.log(print_r($args, true));
|
||||
return $r;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -175,12 +175,11 @@ class Product {
|
||||
wp_enqueue_style( 'product-details', FORMIPAY_URL . 'admin/assets/css/admin-product-editor.css', [], FORMIPAY_VERSION, 'all' );
|
||||
wp_enqueue_script( 'product-details', FORMIPAY_URL . 'admin/assets/js/admin-product-editor.js', ['jquery', 'vue.js'], FORMIPAY_VERSION, true );
|
||||
wp_localize_script( 'product-details', 'product_details', [
|
||||
'multicurrency' => formipay_is_multi_currency_active(),
|
||||
// 'all_currencies' => formipay_currency_as_options(),
|
||||
'global_selected_currencies' => formipay_global_currency_options(),
|
||||
'global_currencies' => formipay_global_currency_options('raw'),
|
||||
'default_currency' => formipay_default_currency(),
|
||||
'default_currency_title' => formipay_default_currency('title'),
|
||||
'default_currency_symbol' => formipay_default_currency('symbol'),
|
||||
'default_currency_decimal_digits' => formipay_default_currency('decimal_digits'),
|
||||
'default_currency_decimal_symbol' => formipay_default_currency('decimal_symbol'),
|
||||
'default_currency_thousand_separator' => formipay_default_currency('thousand_separator'),
|
||||
'product_type' => formipay_get_post_meta($product_id, 'product_type') ?: 'digital',
|
||||
'product_is_physical' => formipay_get_post_meta($product_id, 'product_type') == 'physical',
|
||||
'product_pricing_method' => $pricing_method, // Pass pricing method to JS
|
||||
@@ -192,12 +191,16 @@ class Product {
|
||||
'th_price' => __('Regular Price', 'formipay'),
|
||||
'th_sale' => __('Sale Price', 'formipay'),
|
||||
'th_weight' => __('Weight', 'formipay'),
|
||||
'th_prices_overall' => __('Prices', 'formipay'), // New header for manual mode
|
||||
'manual_price_hint' => __('Prices set manually below', 'formipay'), // New hint for manual mode cell
|
||||
'child_th_currency' => __('Currency', 'formipay'), // Child table header
|
||||
'child_th_regular' => __('Regular Price', 'formipay'), // Child table header
|
||||
'child_th_sale' => __('Sale Price', 'formipay'), // Child table header
|
||||
'no_variations' => __( 'No variations available', 'formipay' )
|
||||
'th_prices_overall' => __('Prices', 'formipay'),
|
||||
'manual_price_hint' => __('Prices set manually below', 'formipay'),
|
||||
'child_th_currency' => __('Currency', 'formipay'),
|
||||
'child_th_regular' => __('Regular Price', 'formipay'),
|
||||
'child_th_sale' => __('Sale Price', 'formipay'),
|
||||
'no_currencies' => __( 'No currencies available', 'formipay' ),
|
||||
'no_variations' => __( 'No variations available', 'formipay' ),
|
||||
'child_placeholder_regular' => __( 'Enter Regular Price', 'formipay' ),
|
||||
'child_placeholder_sale' => __( 'Enter Sale Price', 'formipay' ),
|
||||
'error_missing_default_price' => __( 'Please fill Regular Price for default currency (%1$s) in variation "%2$s".', 'formipay' ),
|
||||
]
|
||||
] );
|
||||
}
|
||||
@@ -279,103 +282,157 @@ class Product {
|
||||
$product_details_group[$last_product_details_group]['group'] = 'ended';
|
||||
|
||||
// Product Currency Group
|
||||
$product_currency_group = array(
|
||||
'setting_product_pricing' => array(
|
||||
// $product_currency_group = array(
|
||||
// 'setting_product_pricing' => array(
|
||||
// 'type' => 'group_title',
|
||||
// 'label' => __( 'Pricing', 'formipay' ),
|
||||
// 'description' => __( 'Carefully set these options below.', 'formipay' ),
|
||||
// 'group' => 'started',
|
||||
// ),
|
||||
// 'product_pricing_method' => array(
|
||||
// 'type' => 'radio',
|
||||
// 'label' => __('Product Pricing Method', 'formipay'),
|
||||
// 'options' => array(
|
||||
// 'manual' => 'Manual Price Set',
|
||||
// 'auto' => 'Auto via Currency Exchange API'
|
||||
// ),
|
||||
// 'value' => 'manual',
|
||||
// 'required' => true
|
||||
// ),
|
||||
// 'product_regular_price' => array(
|
||||
// 'type' => 'number',
|
||||
// 'label' => sprintf( __('Regular Price (%s)', 'formipay'), formipay_default_currency('symbol') ),
|
||||
// 'value' => 0,
|
||||
// 'step' => 0.01,
|
||||
// 'required' => true,
|
||||
// 'dependency' => [
|
||||
// 'key' => 'product_pricing_method',
|
||||
// 'value' => 'auto'
|
||||
// ]
|
||||
// ),
|
||||
// 'product_sale_price' => array(
|
||||
// 'type' => 'number',
|
||||
// 'label' => sprintf( __('Sale Price (%s)', 'formipay'), formipay_default_currency('symbol') ),
|
||||
// 'value' => 0,
|
||||
// 'step' => 0.01,
|
||||
// 'dependency' => [
|
||||
// 'key' => 'product_pricing_method',
|
||||
// 'value' => 'auto'
|
||||
// ]
|
||||
// ),
|
||||
// 'product_prices' => [
|
||||
// 'type' => 'repeater',
|
||||
// 'label' => __( 'Prices', 'formipay' ),
|
||||
// 'description' => __( 'You can set price with multiple currency', 'formipay' ),
|
||||
// 'fields' => [
|
||||
// 'regular_price' => array(
|
||||
// 'type' => 'number',
|
||||
// 'label' => __('Regular Price', 'formipay'),
|
||||
// 'value' => 0,
|
||||
// 'step' => 0.01,
|
||||
// 'required' => true
|
||||
// ),
|
||||
// 'sale_price' => array(
|
||||
// 'type' => 'number',
|
||||
// 'label' => __('Sale Price', 'formipay'),
|
||||
// 'value' => 0,
|
||||
// 'step' => 0.01
|
||||
// ),
|
||||
// 'currency' => array(
|
||||
// 'type' => 'select',
|
||||
// 'label' => __('Currency', 'formipay'),
|
||||
// 'value' => 'IDR:::Indonesian rupiah:::Rp',
|
||||
// 'options' => formipay_currency_as_options(),
|
||||
// 'required' => true,
|
||||
// 'searchable' => true,
|
||||
// 'is_group_title' => true
|
||||
// ),
|
||||
// 'currency_decimal_digits' => array(
|
||||
// 'type' => 'number',
|
||||
// 'label' => __('Decimal Digits', 'formipay'),
|
||||
// 'value' => '2',
|
||||
// 'required' => true
|
||||
// ),
|
||||
// 'currency_decimal_symbol' => array(
|
||||
// 'type' => 'text',
|
||||
// 'label' => __('Decimal Symbol', 'formipay'),
|
||||
// 'value' => '.',
|
||||
// 'required' => true
|
||||
// ),
|
||||
// 'currency_thousand_separator' => array(
|
||||
// 'type' => 'text',
|
||||
// 'label' => __('Thousand Separator Symbol', 'formipay'),
|
||||
// 'value' => ',',
|
||||
// 'required' => true
|
||||
// ),
|
||||
// ],
|
||||
// 'dependency' => [
|
||||
// 'key' => 'product_pricing_method',
|
||||
// 'value' => 'manual'
|
||||
// ]
|
||||
// ],
|
||||
// );
|
||||
|
||||
$global_currencies = get_global_currency_array();
|
||||
$default_currency = formipay_default_currency();
|
||||
|
||||
foreach($global_currencies as $currency){
|
||||
$default_currency_symbol = formipay_get_currency_data_by_value($default_currency, 'symbol');
|
||||
$currency_symbol = formipay_get_currency_data_by_value($currency['currency'], 'symbol');
|
||||
$currency_title = ucwords(formipay_get_currency_data_by_value($currency['currency'], 'title'));
|
||||
$decimal_digits = intval($currency['decimal_digits']);
|
||||
$step = $decimal_digits * 10;
|
||||
$step = $step > 0 ? 1 / $step : 1;
|
||||
$product_currency_group['setting_product_pricing_'.$currency_symbol] = array(
|
||||
'type' => 'group_title',
|
||||
'label' => __( 'Pricing', 'formipay' ),
|
||||
'description' => __( 'Carefully set these options below.', 'formipay' ),
|
||||
'group' => 'started',
|
||||
),
|
||||
'product_pricing_method' => array(
|
||||
'type' => 'radio',
|
||||
'label' => __('Product Pricing Method', 'formipay'),
|
||||
'options' => array(
|
||||
'manual' => 'Manual Price Set',
|
||||
'auto' => 'Auto via Currency Exchange API'
|
||||
'label' => sprintf(
|
||||
__( '<img src="%s" width="18" /> Pricing in %s (%s)', 'formipay' ),
|
||||
formipay_get_flag_by_currency($currency['currency']),
|
||||
$currency_title,
|
||||
$currency_symbol
|
||||
),
|
||||
'value' => 'manual',
|
||||
'required' => true
|
||||
),
|
||||
'product_regular_price' => array(
|
||||
'group' => 'started',
|
||||
);
|
||||
$product_currency_group['setting_product_price_regular_'.$currency_symbol] = array(
|
||||
'type' => 'number',
|
||||
'label' => sprintf( __('Regular Price (%s)', 'formipay'), formipay_default_currency('symbol') ),
|
||||
'value' => 0,
|
||||
'step' => 0.01,
|
||||
'required' => true,
|
||||
'dependency' => [
|
||||
'key' => 'product_pricing_method',
|
||||
'value' => 'auto'
|
||||
]
|
||||
),
|
||||
'product_sale_price' => array(
|
||||
'label' => __( 'Regular Price', 'formipay' ),
|
||||
'step' => $step,
|
||||
'min' => 0,
|
||||
'placeholder' => __( 'Auto', 'formipay' )
|
||||
);
|
||||
$product_currency_group['setting_product_price_sale_'.$currency_symbol] = array(
|
||||
'type' => 'number',
|
||||
'label' => sprintf( __('Sale Price (%s)', 'formipay'), formipay_default_currency('symbol') ),
|
||||
'value' => 0,
|
||||
'step' => 0.01,
|
||||
'dependency' => [
|
||||
'key' => 'product_pricing_method',
|
||||
'value' => 'auto'
|
||||
]
|
||||
),
|
||||
'product_prices' => [
|
||||
'type' => 'repeater',
|
||||
'label' => __( 'Prices', 'formipay' ),
|
||||
'description' => __( 'You can set price with multiple currency', 'formipay' ),
|
||||
'fields' => [
|
||||
'regular_price' => array(
|
||||
'type' => 'number',
|
||||
'label' => __('Regular Price', 'formipay'),
|
||||
'value' => 0,
|
||||
'step' => 0.01,
|
||||
'required' => true
|
||||
),
|
||||
'sale_price' => array(
|
||||
'type' => 'number',
|
||||
'label' => __('Sale Price', 'formipay'),
|
||||
'value' => 0,
|
||||
'step' => 0.01
|
||||
),
|
||||
'currency' => array(
|
||||
'type' => 'select',
|
||||
'label' => __('Currency', 'formipay'),
|
||||
'value' => 'IDR:::Indonesian rupiah:::Rp',
|
||||
'options' => formipay_currency_as_options(),
|
||||
'required' => true,
|
||||
'searchable' => true,
|
||||
'is_group_title' => true
|
||||
),
|
||||
'currency_decimal_digits' => array(
|
||||
'type' => 'number',
|
||||
'label' => __('Decimal Digits', 'formipay'),
|
||||
'value' => '2',
|
||||
'required' => true
|
||||
),
|
||||
'currency_decimal_symbol' => array(
|
||||
'type' => 'text',
|
||||
'label' => __('Decimal Symbol', 'formipay'),
|
||||
'value' => '.',
|
||||
'required' => true
|
||||
),
|
||||
'currency_thousand_separator' => array(
|
||||
'type' => 'text',
|
||||
'label' => __('Thousand Separator Symbol', 'formipay'),
|
||||
'value' => ',',
|
||||
'required' => true
|
||||
),
|
||||
],
|
||||
'dependency' => [
|
||||
'key' => 'product_pricing_method',
|
||||
'value' => 'manual'
|
||||
]
|
||||
],
|
||||
);
|
||||
'label' => __( '🎉 Sale Price', 'formipay' ),
|
||||
'step' => $step,
|
||||
'min' => 0,
|
||||
'placeholder' => __( 'Auto', 'formipay' ),
|
||||
'group' => 'ended'
|
||||
);
|
||||
|
||||
if(count($global_currencies) > 1){
|
||||
if($default_currency_symbol === $currency_symbol){
|
||||
$product_currency_group['setting_product_pricing_'.$currency_symbol]['description'] = sprintf(
|
||||
__( 'This is your default currency. <a href="%s" target="_blank">Change in Settings</a>', 'formipay' ),
|
||||
admin_url('/admin.php?page=formipay-settings')
|
||||
);
|
||||
$product_currency_group['setting_product_price_regular_'.$currency_symbol]['required'] = true;
|
||||
$product_currency_group['setting_product_price_regular_'.$currency_symbol]['placeholder'] = __( 'Enter Regular Price...', 'formipay' );
|
||||
$product_currency_group['setting_product_price_sale_'.$currency_symbol]['placeholder'] = __( 'Enter Sale Price...', 'formipay' );
|
||||
}else{
|
||||
$product_currency_group['setting_product_pricing_'.$currency_symbol]['description'] = sprintf(
|
||||
__( 'System will calculate the price in %s based on exchange rate against %s when you leave these empty.', 'formipay' ),
|
||||
$currency_symbol, $default_currency_symbol
|
||||
);
|
||||
}
|
||||
}else{
|
||||
$product_currency_group['setting_product_pricing_'.$currency_symbol]['label'] = __( 'Product Prices', 'formipay' );
|
||||
$product_currency_group['setting_product_price_regular_'.$currency_symbol]['placeholder'] = __( 'Enter Regular Price...', 'formipay' );
|
||||
$product_currency_group['setting_product_price_sale_'.$currency_symbol]['placeholder'] = __( 'Enter Sale Price...', 'formipay' );
|
||||
}
|
||||
}
|
||||
|
||||
$product_currency_group = apply_filters( 'formipay/product-settings/tab:general/group:product-currency', $product_currency_group );
|
||||
|
||||
$last_product_currency_group = array_key_last($product_currency_group);
|
||||
$product_currency_group[$last_product_currency_group]['group'] = 'ended';
|
||||
|
||||
|
||||
$general_all_fields = array_merge($product_details_group, $product_currency_group);
|
||||
|
||||
$general_all_fields = apply_filters( 'formipay/product-settings/tab:general', $general_all_fields );
|
||||
@@ -420,47 +477,16 @@ class Product {
|
||||
'variation_label' => [
|
||||
'type' => 'text',
|
||||
'label' => __( 'Title', 'formipay' ),
|
||||
'description' => __( 'e.g. Color, Size, etc', 'formipay' ),
|
||||
'description' => __( 'e.g. Red, XL, etc', 'formipay' ),
|
||||
'required' => true,
|
||||
'is_group_title' => true
|
||||
],
|
||||
'variation_value_type' => [
|
||||
'type' => 'select',
|
||||
'label' => __( 'Value Type', 'formipay' ),
|
||||
'options' => [
|
||||
'text' => __( 'Text', 'formipay' ),
|
||||
'number' => __( 'Number', 'formipay' ),
|
||||
'color' => __( 'Color', 'formipay' ),
|
||||
],
|
||||
'value' => 'text'
|
||||
],
|
||||
'variation_value_text' => [
|
||||
'variation_value' => [
|
||||
'type' => 'text',
|
||||
'label' => __( 'Value', 'formipay' ),
|
||||
'required' => true,
|
||||
'dependency' => array(
|
||||
'key' => 'variation_value_type',
|
||||
'value' => 'text'
|
||||
),
|
||||
],
|
||||
'variation_value_number' => [
|
||||
'type' => 'number',
|
||||
'label' => __( 'Value', 'formipay' ),
|
||||
'required' => true,
|
||||
'dependency' => array(
|
||||
'key' => 'variation_value_type',
|
||||
'value' => 'number'
|
||||
),
|
||||
],
|
||||
'variation_value_color' => [
|
||||
'type' => 'color',
|
||||
'label' => __( 'Value', 'formipay' ),
|
||||
'required' => true,
|
||||
'dependency' => array(
|
||||
'key' => 'variation_value_type',
|
||||
'value' => 'color'
|
||||
),
|
||||
],
|
||||
'description' => __( 'e.g. red, xl, etc', 'formipay' ),
|
||||
'required' => true
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user