• Hi, I’m trying to list the products for one category in my sidebar with just the list of products and their prices. I’ve modified the widget file and removed the pictures. It’s almost what I want except it shows all products. Is there a way to filter out just one category?

    This is what I have so far:

    <?php
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    global $product;
    		?>
    <li>
    	<a href="<?php echo esc_url( get_permalink( $product->id ) ); ?>" title="<?php echo esc_attr( $product->get_title() ); ?>">
    		<?php //echo $product->get_image(); ?>
    		<span class="product-title"><?php echo $product->get_title(); ?></span>
    	</a>
    	<?php echo $product->get_price_html(); ?>
    </li>

    How can I filter global $product to only show products from 1 category. I assume once that’s done, I can create a new widget with the 2nd filter. Is that right?

    If anyone can steer me in the right direction, I would so appreciate it. Trying to learn as much as I can here.

    Thank you,

    https://www.ads-software.com/plugins/woocommerce/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘product list w/price widget’ is closed to new replies.