• HI, I have the following code in my woocommerce theme:

    <h2>Top Rated Products</h2>
    <?php echo do_shortcode(“[top_rated_products per_page=’4′]”); ?>

    It’s a new store so we have no ratings yet so I want to wrap this code in some conditional code to hide it until a product is rated. My php is poor, is there an easy solution?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Where did you download this theme from?

    Thread Starter bikeman123

    (@bikeman123)

    It is my own theme. I’m just looking for some ‘if then’ code, something like
    <?php
    if echo ($top_rated_products !== nul) {
    <h2>Top rated products</h2>

    }
    wtc

    • This reply was modified 8 years, 5 months ago by bikeman123.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditional content in Woocommerce’ is closed to new replies.