在 WooCommerce 中,我注意到 WC_Cart 和 WC_订单 , 两者都有 get_total_discount() 和 get_discount_total() .
这些有什么区别?我应该使用哪个来获取购物车/订单的折扣值(value)?
最佳答案
有趣的。我之前没有注意到。get_total_discount
将返回一个格式化的折扣值(带有货币符号,用 HTML 包裹)。get_discount_total
将只返回值。
关于php - get_discount_total() 和 get_total_discount() 的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59711257/