fix wpcfto select and repeater related visibility and validation
This commit is contained in:
@@ -1216,7 +1216,11 @@ class Form {
|
||||
'placeholder' => esc_html__( '-- Choose related field', 'formipay' )
|
||||
]
|
||||
],
|
||||
'nonce' => wp_create_nonce('formipay-form-editor')
|
||||
'nonce' => wp_create_nonce('formipay-form-editor'),
|
||||
'multicurrency' => formipay_is_multi_currency_active(),
|
||||
'all_currencies' => formipay_currency_as_options(),
|
||||
'global_selected_currencies' => formipay_global_currency_options(),
|
||||
'default_currency' => formipay_default_currency()
|
||||
] );
|
||||
|
||||
wp_enqueue_media();
|
||||
|
||||
10
includes/Integration/ExchangeRateAPI.php
Normal file
10
includes/Integration/ExchangeRateAPI.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Formipay\Integration;
|
||||
use Formipay\Traits\SingletonTrait;
|
||||
use Formipay\Payment\Payment;
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
class ExchangeRateAPI extends Payment {
|
||||
|
||||
}
|
||||
@@ -59,6 +59,24 @@ abstract class Payment {
|
||||
'submenu' => __( 'General', 'formipay' ),
|
||||
'group' => 'started'
|
||||
),
|
||||
'allowed_currencies' => array(
|
||||
'type' => 'multi_checkbox',
|
||||
'searchable' => true,
|
||||
'required' => true,
|
||||
'label' => __( 'Allowed Currencies', 'formipay' ),
|
||||
'options' => formipay_global_currency_options(),
|
||||
'submenu' => __( 'General', 'formipay' ),
|
||||
'description' => __( 'Activate multicurrency and set more than one currency to enable this option. Default, only default currency is allowed.', 'formipay' )
|
||||
),
|
||||
'default_currencies' => array(
|
||||
'type' => 'select',
|
||||
'searchable' => true,
|
||||
'required' => true,
|
||||
'label' => __( 'Default Currency', 'formipay' ),
|
||||
'options' => formipay_global_currency_options(),
|
||||
'submenu' => __( 'General', 'formipay' ),
|
||||
'description' => __( 'First apply currency before buyer select.', 'formipay' )
|
||||
),
|
||||
'payment_section_title' => array(
|
||||
'type' => 'text',
|
||||
'label' => __( 'Payment Section Title', 'formipay' ),
|
||||
@@ -102,10 +120,10 @@ abstract class Payment {
|
||||
);
|
||||
|
||||
$channels['payment_tablet_columns'] = array(
|
||||
'type' => 'number',
|
||||
'label' => __( 'Tablet View', 'formipay' ),
|
||||
'submenu' => __( 'General', 'formipay' ),
|
||||
'value' => 3
|
||||
'type' => 'number',
|
||||
'label' => __( 'Tablet View', 'formipay' ),
|
||||
'submenu' => __( 'General', 'formipay' ),
|
||||
'value' => 3
|
||||
);
|
||||
|
||||
$channels['payment_mobile_columns'] = array(
|
||||
|
||||
@@ -57,6 +57,30 @@ class Settings {
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Multi Currency', 'formipay' )
|
||||
],
|
||||
'enable_auto_exchangerate' => [
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Enable Auto Exchange Rate', 'formipay' ),
|
||||
'dependency' => [
|
||||
'key' => 'enable_multicurrency',
|
||||
'value' => 'not_empty'
|
||||
]
|
||||
],
|
||||
'enable_auto_exchangerate_apikey' => [
|
||||
'type' => 'text',
|
||||
'label' => __( 'Auto Exchange Rate API Key', 'formipay' ),
|
||||
'required' => true,
|
||||
'dependency' => [
|
||||
[
|
||||
'key' => 'enable_multicurrency',
|
||||
'value' => 'not_empty'
|
||||
],
|
||||
[
|
||||
'key' => 'enable_auto_exchangerate',
|
||||
'value' => 'not_empty'
|
||||
]
|
||||
],
|
||||
'dependencies' => '&&'
|
||||
],
|
||||
'multicurrencies' => [
|
||||
'type' => 'repeater',
|
||||
'label' => __( 'Currencies', 'formipay' ),
|
||||
@@ -94,13 +118,12 @@ class Settings {
|
||||
'options' => $payment_checkboxes,
|
||||
'submenu' => __( 'General', 'formipay' ),
|
||||
),
|
||||
'payment_gateways_select' => array(
|
||||
'type' => 'multiselect',
|
||||
'label' => __( 'Payment Gateways', 'formipay' ),
|
||||
'options' => $payment_checkboxes,
|
||||
'exchange_rate' => array(
|
||||
'type' => 'number',
|
||||
'label' => __( 'Manual Exchange Rate', 'formipay' ),
|
||||
'description' => __( 'This value is the exchange rate of default currency against this currency. If this currency selected, total order will be multiplied to this value. <b>This override the value from ExchangeRatePI if enabled</b>', 'formipay' ),
|
||||
'submenu' => __( 'General', 'formipay' ),
|
||||
'placeholder' => 'Select related Payments'
|
||||
),
|
||||
)
|
||||
],
|
||||
'required' => true,
|
||||
'dependency' => [
|
||||
|
||||
Reference in New Issue
Block a user