I would like some help with the following issue with woocommerce.
I am using wordpress 3.5.2, woocommerce 2.0.13 and sommerce theme.
I have a product category page, in which I display 5 subcategories.
Under the 5 subcategory images, I would like to have some featured products or random products of these categories. Do you know how I could do that?
I just double checked and WooCommerce runs the product category description through
the_content
filters, which means that it should run shortcodes.WooCommerce has plenty of shortcodes, see their documentation
Including featured products:
The downside to that is that the featured products might not all be from that specific category. You didn’t mention if that was an issue or not.
If so, then you can duplicate the code from the
[featured_products]
(which is really just running a secondary loop withWP_Query
), tweak it a bit and add the output to thewoocommerce_before_shop_loop
hook.This is a bit late but for people who are looking for answers you can download, install and activate https://wordpress.org/plugins/featured-products-by-category/ it uses the latest and standard woocommerce function wc_get_products.
Once activated put the following code in your functions.php
See the full post here -> https://jameshwartlopez.com/plugin/show-featured-products-in-product-category-pages/