无法在woocommerce中获得购物车总数 [英] Unable to get cart total in woocommerce
本文介绍了无法在woocommerce中获得购物车总数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在 WooCommerce WordPress 插件中做一些自定义工作.我无法获得购物车总数.我该怎么做.
I am doing some custom work in WooCommerce WordPress plugin. I am unable to get cart total. How can I do this.
$total = $woocommerce->cart->get_total();
推荐答案
global $woocommerce;
$amount = $woocommerce->cart->cart_contents_total+$woocommerce->cart->tax_total;
这篇关于无法在woocommerce中获得购物车总数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文