WooCommerce:购物车总数和小计之间有什么区别?

Jan*_*ski 5 woocommerce

我无法在文档的任何地方找到解释.我也查看了源代码,但它也没有帮助.非常感谢!

Jan*_*ski 11

好的,我通过以下设置在我的测试商店中找到了它:

  • 购物车中的商品总价(含税):127
  • 运费:12
  • 费用(应税):13
  • 优惠券折扣:10

通过这些设置,我在购物车对象上获得以下内容:

"cart_contents_total":97.4998, "total":144.6, "subtotal":127, "subtotal_ex_tax":105.8333, "tax_total":22.1001, "discount_cart":8.3334, "discount_cart_tax":1.6667, "fee_total":13, "shipping_total":10, "shipping_tax_total":2, "fees":[{"id":"extra-fee", "name":"Extra Fee", "amount":13, "tax_class":"", "taxable":true, "tax":2.6, "tax_data":{"1":2.6}

所以,答案是:

  • 总计=购物车中的产品总价(含税)+运费+费用+费用税 - 折扣
  • 小计=购物车中的商品总价(含税)