• Resolved reuwan

    (@reuwan)


    Hello again,

    Is there a workaround for the variations to appear on a woocommerce product shortcode?

    ex.
    [products limit=”100″ paginate=”true” columns=”5″ orderby=”popularity”]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter reuwan

    (@reuwan)

    Oh! I just saw a solution on shortcode in one of the threads, great!

    add_filter( ‘woocommerce_shortcode_products_query’, ‘woocommerce_shortcode_products_query_post_type’);
    function woocommerce_shortcode_products_query_post_type($query_args){
    $query_args[‘post_type’] = array(‘product’, ‘product_variation’);
    return $query_args;
    }

    hi @reuwan, this is really great. Thanks for this snippet.
    I can now see product variations as well on e.g. a shortcode block on my homepage.

    However I also see the main (parent) product. Is there a way to hide that just like the “”Hide variable” does on the archive / category page by adjusting this snippet?

    • This reply was modified 2 years, 10 months ago by skyisword.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘woocommerce product shortcode’ is closed to new replies.