Viewing 1 replies (of 1 total)
  • it loads the same templates as the standard products loop. (content-product.php)

    You’d pretty much need to add your own shortcode or use css to hide the price. Here’s the code for that particular shortcode:

    function woocommerce_recent_products( $atts ) {
    
    	global $woocommerce_loop;
    
    	extract(shortcode_atts(array(
    		'per_page' 	=> '12',
    		'columns' 	=> '4',
    		'orderby' => 'date',
    		'order' => 'desc'
    	), $atts));
    
    	$args = array(
    		'post_type'	=> 'product',
    		'post_status' => 'publish',
    		'ignore_sticky_posts'	=> 1,
    		'posts_per_page' => $per_page,
    		'orderby' => $orderby,
    		'order' => $order,
    		'meta_query' => array(
    			array(
    				'key' => '_visibility',
    				'value' => array('catalog', 'visible'),
    				'compare' => 'IN'
    			)
    		)
    	);
    
    	ob_start();
    
    	$products = new WP_Query( $args );
    
    	$woocommerce_loop['columns'] = $columns;
    
    	if ( $products->have_posts() ) : ?>
    
    		<ul class="products">
    
    			<?php while ( $products->have_posts() ) : $products->the_post(); ?>
    
    				<?php woocommerce_get_template_part( 'content', 'product' ); ?>
    
    			<?php endwhile; // end of the loop. ?>
    
    		</ul>
    
    	<?php endif;
    
    	wp_reset_query();
    
    	return ob_get_clean();
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Price Removal shortcode’ is closed to new replies.