Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 无法在woocommerce中获取购物车总计_Wordpress - Fatal编程技术网

Wordpress 无法在woocommerce中获取购物车总计

Wordpress 无法在woocommerce中获取购物车总计,wordpress,Wordpress,我在WooCommerce WordPress插件中做一些定制工作。我无法获取购物车总数。我怎样才能做到这一点 $total = $woocommerce->cart->get_total(); global $woocommerce; $amount = $woocommerce->cart->cart_contents_total+$woocommerce->cart->tax_total;

我在WooCommerce WordPress插件中做一些定制工作。我无法获取购物车总数。我怎样才能做到这一点

$total         = $woocommerce->cart->get_total();
global $woocommerce;
$amount = $woocommerce->cart->cart_contents_total+$woocommerce->cart->tax_total;