Skip to content

Commit

Permalink
Merge branch 'trunk' into press4-353
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyakrishnai committed Sep 13, 2023
2 parents 87ac40d + 9a6fa36 commit 12542cf
Show file tree
Hide file tree
Showing 5 changed files with 1,964 additions and 6,497 deletions.
34 changes: 34 additions & 0 deletions includes/ECommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class ECommerce {
'woocommerce_calc_taxes',
'woocommerce_currency',
'woocommerce_email_from_address',
'woocommerce_bacs_settings',
'woocommerce_cod_settings',
'woocommerce_cheque_settings',
);

/**
Expand Down Expand Up @@ -157,6 +160,37 @@ public function register_settings() {
'description' => __( 'NFD eCommerce Options', 'wp-module-ecommerce' ),
)
);
$payments = array(
'woocommerce_bacs_settings',
'woocommerce_cod_settings',
'woocommerce_cheque_settings'
);
$schema_for_offline_payments = array(
'show_in_rest' => array(
'schema' => array(
'type' => 'object',
'properties' => array(
'gateway_id' => array(
'type' => 'string',
),
'enabled' => array(
'type' => 'string',
),
'action' => array(
'type' => 'string',
),
'security' => array(
'type' => 'string',
),
),
),
),
'type' => 'object',
'description' => __( 'NFD eCommerce Options', 'wp-module-ecommerce' ),
);
foreach ( $payments as $payment ) {
\register_setting( 'general', $payment, $schema_for_offline_payments);
}
}

/**
Expand Down
Loading

0 comments on commit 12542cf

Please sign in to comment.