首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Woocommerce签出内部服务器在“如果添加custome字段”签出时出错

Woocommerce签出内部服务器在“如果添加custome字段”签出时出错
EN

Stack Overflow用户
提问于 2017-06-09 17:23:34
回答 1查看 727关注 0票数 1

Internal Server Error说:我正试图在电子商务中增加一个服装领域,作为一种税收,事实上,它正在如预期的那样出现在购物车中,也出现在结账中,但当我开始付款或结账时,它就会出现。

2017年6月17日:44:07 UTC PHP致命错误:调用第615行/home/xxxxx/xxxx/xxxx.com/test/wp-content/plug‌​ins/woocommerce-pdf-‌​invoices/includes/ab‌​stracts/abstract-inv‌​oice.php中数组中的成员函数get_id()

我的代码:

代码语言:javascript
复制
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, '' );

}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-09 17:50:49

调用数组上的成员函数get_id()来自woocommerce-pdf-‌​发票插件。禁用它将解决此错误。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44463553

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档