Skip to content

Commit

Permalink
changed COD logic
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulwahidsharief committed Dec 19, 2024
1 parent 6b05b40 commit eb425a2
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions woo-razorpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -1477,16 +1477,25 @@ public function generate_razorpay_form($orderId)

public function getDisplayConfig()
{
$config = [];
$config = [
'display' => [
'hide' => [
[
'method' => 'cod'
]
]
]
];

$checkout360_status = get_option('rzp_checkout360_status');
$rzp_cod_intelligence_enable = get_option('rzp_cod_intelligence_enable');

if (isset($checkout360_status) === true and
$checkout360_status === 'yes' and
(empty($rzp_cod_intelligence_enable) === true or
$rzp_cod_intelligence_enable === 'no'))
if ((isset($checkout360_status) === true) and
($checkout360_status === 'yes') and
(empty($rzp_cod_intelligence_enable) === false) and
($rzp_cod_intelligence_enable === 'yes'))
{
$config['display']['hide'][] = ['method' => 'cod'];
unset($config['display']['hide']);
}

return $config;
Expand Down

0 comments on commit eb425a2

Please sign in to comment.