I recently edited Woocommerce’s Products On-Sale widget making it display random products marked on-sale by changing the line ‘orderby’ => ‘date’, to ‘orderby’ => ‘rand’,. Now I want to edit the Featured Products widget to do the same. However, I can’t seem to get it to work. I have changed to the code to:
$query_args['meta_query'] = array( 'key' => '_featured', 'value' => 'yes', 'orderby' => 'rand' );
but it still does not display random products marked featured. Can anyone please help me out. Thanks in advance!
- The topic ‘Woocommerce Featured Products widget’ is closed to new replies.