Internal Server Error说:我正试图在电子商务中增加一个服装领域,作为一种税收,事实上,它正在如预期的那样出现在购物车中,也出现在结账中,但当我开始付款或结账时,它就会出现。
2017年6月17日:44:07 UTC PHP致命错误:调用第615行/home/xxxxx/xxxx/xxxx.com/test/wp-content/plugins/woocommerce-pdf-invoices/includes/abstracts/abstract-invoice.php中数组中的成员函数get_id()
我的代码:
add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' );
function woocommerce_custom_surcharge() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$percentage = 0.03;
$taxes = array_sum($woocommerce->cart->taxes);
$surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total + $taxes ) * $percentage;
// Make sure that you return false here. We can't double tax people!
$woocommerce->cart->add_fee( 'Processing Fee', $surcharge, false, '' );
}发布于 2017-06-09 17:50:49
调用数组上的成员函数get_id()来自woocommerce-pdf-发票插件。禁用它将解决此错误。
https://stackoverflow.com/questions/44463553
复制相似问题