First you need to add this in your function.php
add_action( 'woocommerce_shortcode_before_products_loop', 'roka_before_products_shortcode_loop', 1, 10 );
add_action( 'woocommerce_shortcode_after_products_loop', 'roka_after_products_shortcode_loop', 0, 10 );
function roka_before_products_shortcode_loop( $atts ) {
$GLOBALS[ 'roka_woocommerce_loop_template' ] =
( isset( $atts[ 'class' ] ) ? $atts[ 'class' ] : '' );
}
function roka_after_products_shortcode_loop( $atts ) {
$GLOBALS[ 'roka_woocommerce_loop_template' ] = '';
After that override the file content-product.php
by copying it to your theme's woocommerce
folder.
Lastly, search the line <li <?php post_class(); ?>>
and add following after that:
<?php
if(
isset( $GLOBALS[ 'roka_woocommerce_loop_template' ] ) &&
$GLOBALS[ 'roka_woocommerce_loop_template' ] == 'simple-list'
) {
echo '<a href="' . get_the_permalink() . '">' . get_the_title() . '</a>';
return;
}
?>