我为woocommerce中的产品创建了一个名为“job\\u orders”的自定义分类法。我想编辑cart页面,然后在cart表中显示job\\u订单的条款。目前,我正在使用下面的脚本,它回应了所有的术语,我只想显示在后端选择的类别。如果有人能在这方面提供帮助,我将不胜感激。
$terms = get_terms(\'job_orders\',\'hide-empty=0&orderby=id\');
//shuffle($terms);   // dlete this line if you don\'t want it random.
$sep = \'\';
foreach ( $terms as $term ) {
    if( ++$count > 60 ) break;   // number of tags here.
    //echo $sep . \'\'.$term->name.\'\';
    echo $sep . $term->name;
    $sep = \', \';  // Put your separator here.
}
上面是购物车中woocommerce循环的下面。php
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
}