我正在使用此代码在woocommerce发送的电子邮件接收顺序中显示其他信息。
add_action('woocommerce_email_after_order_table', 'add_order_email_instructions', 10, 2);
function add_order_email_instructions($order, $sent_to_admin) {
if (!$sent_to_admin) {
if ( isset( $gateways['cod'] ) == $order->payment_method) {
// cash on delivery method
do_action('woocommerce_thankyou_lieferung', $order->get_id());
} else {
// other methods (ie credit card)
do_action('woocommerce_thankyou_lieferung', $order->get_id());
}
}
}
这给了我错误信息
付款方式调用不正确。订单属性不应直接访问。
在debug.log文件中
我找不到上述代码有什么问题。
答案 0 :(得分:1)
declare
mHalf Number;
l_rec TableA%rowtype;
cntr NUMBER := 1;
CURSOR cur IS Select * From TableA FOR UPDATE OF columnA;
begin
Select round(count(*)/2,0) Into mHalf From TableA;
OPEN cur;
LOOP
FETCH cur INTO l_rec;
EXIT WHEN cur%notfound;
UPDATE
tableA
SET
columnA=CASE WHEN cntr <= mhalf then 1 else 2 end
WHERE
CURRENT OF cur;
cntr := cntr +1;
END LOOP;
Commit;
end;