WooCommerce结帐页面上的数组错误

时间:2013-02-21 13:03:22

标签: php wordpress wordpress-plugin woocommerce

当我尝试在WooCommerce中使用PayPal结帐时出错。我不知道是什么导致了它。

我也有一个SagePay插件,但无论如何都会在任一选项上发生。

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/beggar/public_html/development/wp-includes/post.php on line 2996
{"result":"success","redirect":"https:\/\/www.sandbox.paypal.com\/webscr?test_ipn=1&cmd=_cart&business=michael%40thelondonbranch.com&no_note=1¤cy_code=GBP&charset=UTF-8&rm=1&upload=1&return=http%3A%2F%2Fexample.com%2Fdevelopment%2Fthank-you%2F%3Futm_nooverride%3D1&cancel_return=http%3A%2F%2Fexample.com%2Fdevelopment%2F%3Fcancel_order%3Dtrue%26_n%3Dc479c487a6&page_style=&invoice=WC-¬ify_url=http%3A%2F%2Fexample.com%2Fdevelopment%2F%3FpaypalListener%3Dpaypal_standard_IPN&no_shipping=1&discount_amount_cart=0.00&item_name_1=Order+%23+-+&quantity_1=1&amount_1=0.00"}

这不仅仅是一个警告,因为管理员或发送的电子邮件中没有订单。

我对此非常感到困惑,这非常关键。

任何帮助都非常感谢,因为这是我第一次使用WooCommerce。

1 个答案:

答案 0 :(得分:0)

最简单的解决方案可能是使用不同的PayPal付款插件。我使用过Denon的Stripe和Authorize.net插件,它们运行良好;这是PayPal的链接:PayPal Payments Pro。我与Denon没有关系。

或者,你可以用一点PHP来压缩错误。您获得的警告消息通常是因为数组只有一个值,所以它实际上不是一个数组。

if (is_array($array)) {
    // Do array merge
} else {
    // Don't try to merge, just use value.
}