标签: woocommerce-product-bundles

如何检查产品是否不是 WooCommerce 中的捆绑产品

我想用这个片段来替换产品的标题。这样可行。

  /** Remove the shop loop title link and replace with brand **/ 
  remove_action( 'woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title', 10 );
  add_action('woocommerce_shop_loop_item_title', 'abChangeProductsTitle', 10 );

  function abChangeProductsTitle() { ?>
      <p class="name product-title custom-brand" style="height: 23px;">
      <?php echo strip_tags ( get_the_term_list( $post->ID, 'product_brand', '', ', ', ''  ) ); ?> 
  </p><?php 
  }
Run Code Online (Sandbox Code Playgroud)

但我试图弄清楚如果产品类型不是捆绑产品(来自https://woocommerce.com/products/product-bundles/ ),如何仅运行此代码片段(替换所有其他产品上的标题) 。

有人可以帮我一点吗?

php wordpress product woocommerce woocommerce-product-bundles

1
推荐指数
1
解决办法
2904
查看次数