**已关闭。**此问题不符合Stack Overflow guidelines。目前不接受回答。
这个问题似乎与help center中定义的范围内的编程无关。
22天前关闭
Improve this question
我尝试了许多方案和挂钩,并在年底甚至在子模板文件感谢页面
因此,如果订单没有失败并且全局变量== true切换到pending:
<?php if ($order->has_status('failed')) : ?>
//code
<?php else : ?>
<?php if ($GLOBALS['variable'] == true) : ?>
<?php $order->update_status('pending'); ?>
<?php endif; ?>
字符串
状态正在更改,但问题是它正在从处理状态变为挂起状态。如果condition($GLOBALS <$'variable'])为true,如何防止进入处理状态?
1条答案
按热度按时间8i9zcol21#
您可以尝试以下的货到付款(COD)付款方式,将代码中的
'my_variable'
替换为正确的slug:字符串
代码放在你的子主题的functions.php文件中(或者插件中)。它应该可以工作。