最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - If no products are on sale - hide ID or class

programmeradmin2浏览0评论

Sorry for the simplicity of this question, but I can't seem to find an answer anywhere. Is there an existing sales hook in woocommerce?

Like:

<?php
   if ( on_sale == 0 ) {
     echo '<style>.specials {display:none;};
     }
?>

That is essentially all I am trying to accomplish. I have a row/column that displays products on sale... I just want to hide that if there are currently no products on sale.

Thanks in advance.

发布评论

评论列表(0)

  1. 暂无评论