我的自定义分类法(WooCommerce属性)已经存在,我使用以下内容将新术语添加到分类法并将其与我的WooCommerce产品相关联:
wp_set_object_terms($product_id, array($omega_jahr), 'pa_years-of-construction');
当我使用以下内容为我的产品调用'pa_years_of_construction'时,我可以看到新条款已保存:
$v = array_values( wc_get_product_terms( $product->id, 'pa_years-of-construction', array( 'fields' => 'names' ) ) );
但是,当我在我的网站的支持和前端检查我的产品属性时,“pa_years_of_construction”属性未显示 .
我在这里想念的是什么?
在此先感谢您的帮助!
1 回答
产品属性是一个复杂的自定义分类,需要的不仅仅是简单的代码行......
以下代码将处理预先存在的产品属性的所有情况:
经过测试和工作 .