mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +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']) : [];
|
||||
$settings = $this->retrieveSettingsFromRawData($rawData);
|
||||
$settings['enabled'] = (
|
||||
isset($_POST['woocommerce_ppcp-gateway_enabled'])
|
||||
&& absint($_POST['woocommerce_ppcp-gateway_enabled']) === 1
|
||||
) || (
|
||||
isset($_POST['woocommerce_ppcp-credit-card-gateway_enabled'])
|
||||
&& absint($_POST['woocommerce_ppcp-credit-card-gateway_enabled']) === 1
|
||||
);
|
||||
$settings['enabled'] = isset($_POST['woocommerce_ppcp-gateway_enabled'])
|
||||
&& 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;
|
||||
foreach ($settings as $id => $value) {
|
||||
$this->settings->set($id, $value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue