标签:custom-taxonomy
-
如何在Woocommerce中检查产品是否具有特定的产品属性 - php
我想确定产品是否具有属性。例如: if (product has attribute 'pa_color') { //do something } 我该怎么做? 参考方案 您可以通过以下方式简单地使用WC_Product方法get_attribute(): // (If needed) Get an instance of the WC_ […]
-
在Woocommerce单一产品页面中获取产品类别名称和描述 - php
我一直在使用WooCommerce Codex,但似乎无法显示数据。我只想显示产品类别和说明,以便在自己的自定义布局中显示在单个产品页面上,如下所示。 <?php global $product; echo $product->get_attributes; ?> <?php global $product; echo $produc […]