• dramus

    (@dramus)


    Hi all,

    I wanted to modify the WooCommerce shortcode for List of Products by SKU/ID to also include the Short Description of each product. I’ve experimented with a few different things in class-wc-shortcodes.php and I have been able to get it to display what I need… BUT the weird thing is that extra short description is still getting displayed even when the product is out of stock. Product data that’s already shown by the shortcode (price, name, thumbnail) all disappear just fine when the product is out of stock, but for some reason my extra line of code that displays the short description still fires.

    This is what it normally is…
    <?php while ( $products->have_posts() ) : $products->the_post(); ?>

    <?php wc_get_template_part( ‘content’, ‘product’ ); ?>

    <?php endwhile; // end of the loop. ?>

    and I’ve been adding in…
    <?php woocommerce_template_single_excerpt(); ?>
    or
    <?php wc_get_template( ‘single-product/short-description.php’ ); ?>

    Both show the short description no problem but aren’t being hidden when the product is out of stock!

    Thanks for any and all help!

  • The topic ‘Adding Short Description to WooCommerce product shortcode’ is closed to new replies.