【发布时间】:2017-03-15 20:35:14
【问题描述】:
我正在使用 WooCommerce,我需要从我的 woocommerce 数据库中获取数据:
我知道,我可以使用此代码获取商品的正常价格:
$regPrice = $_product->get_regular_price();
在数据库中,正常价格的字段如下所示:_regular_price
我知道折扣在数据库中是这样的:_bulkdiscount_discount_1
所以我想,我可以像这样得到 $discount1:
$discount1 = $_product->get_bulkdiscount_discount_1();
但不幸的是,这不起作用。当我尝试使用此代码 echo "<p>Discount One = $discount1 </p>"; 回显 $discount1 时,不会“回显”任何内容。
我做错了什么?
这里有任何 Woocommerce 破解者可以建议我正确的方向吗?
谢谢
【问题讨论】:
标签: php mysql wordpress woocommerce product