mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +08:00
seperate enabled key value for gateways
This commit is contained in:
parent
3fdb3d641d
commit
1fefdee861
1 changed files with 4 additions and 7 deletions
|
@ -60,13 +60,10 @@ class SettingsListener
|
||||||
*/
|
*/
|
||||||
$rawData = (isset($_POST['ppcp'])) ? (array) wp_unslash($_POST['ppcp']) : [];
|
$rawData = (isset($_POST['ppcp'])) ? (array) wp_unslash($_POST['ppcp']) : [];
|
||||||
$settings = $this->retrieveSettingsFromRawData($rawData);
|
$settings = $this->retrieveSettingsFromRawData($rawData);
|
||||||
$settings['enabled'] = (
|
$settings['enabled'] = isset($_POST['woocommerce_ppcp-gateway_enabled'])
|
||||||
isset($_POST['woocommerce_ppcp-gateway_enabled'])
|
&& absint($_POST['woocommerce_ppcp-gateway_enabled']) === 1;
|
||||||
&& absint($_POST['woocommerce_ppcp-gateway_enabled']) === 1
|
$settings['dcc_gateway_enabled'] = isset($_POST['woocommerce_ppcp-credit-card-gateway_enabled'])
|
||||||
) || (
|
&& absint($_POST['woocommerce_ppcp-credit-card-gateway_enabled']) === 1;
|
||||||
isset($_POST['woocommerce_ppcp-credit-card-gateway_enabled'])
|
|
||||||
&& absint($_POST['woocommerce_ppcp-credit-card-gateway_enabled']) === 1
|
|
||||||
);
|
|
||||||
foreach ($settings as $id => $value) {
|
foreach ($settings as $id => $value) {
|
||||||
$this->settings->set($id, $value);
|
$this->settings->set($id, $value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue