Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter newshop

    (@newshop)

    Ok, got it ??
    The shortcode must be something like:

    <?php
    echo get_the_excerpt($item['prod_id']);
    ?>

    instead of

    <?php
    echo get_the_excerpt($product_id);
    ?>

    what I used before.

    Plugin Author YITHEMES

    (@yithemes)

    I newshop,

    I’m glad you worked your problem around!

    If you’re interested in solving the problem without defining a shortcode, you can try to add this code to functions.php file of your theme:

    if( ! function_exists('yith_wcwl_add_excerpt_to_wishlist') ){
        function yith_wcwl_add_excerpt_to_wishlist( $item ){
            $product = wc_get_product( $item['prod_id'] );
    	echo $product->post->post_excerpt;
        }
        add_action( 'yith_wccl_table_after_product_name', 'yith_wcwl_add_excerpt_to_wishlist', 10, 1 );
    }

    Please, note that passing an argument to get_the_exceprt has been deprecated.
    Besides, here we’re using yith_wccl_table_after_product_name hook, but wccl is just a typo, and we will change it to yith_wcwl_table_after_product_name in the next update of the plugin

    I know that you already resolved the problem, but maybe someone will find this code useful ??

    Have a nice day ??

    Hello,

    What if I want to show a single excerpt in place of the unit price?

    I’ve been using this hook in other places:

    <?php woocommerce_template_single_excerpt(); ?>

    How can I make this work for the wishlist view?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add product short description /excerpt to wishlist’ is closed to new replies.