Reply 322454 to: Excerpt problem – When Short description missing

Avatar: Rose Tyler
Rose Tyler
Support staff
April 22, 2022 at 06:54

Hello,

Please, check now !
Result – https://prnt.sc/xcabTxSXUtEj
We have added next custom in your child-theme/functions.php (https://prnt.sc/j3HHT2MTUCUm)
Code snippet:


function etheme_custom_make_excerpt_unfiltered($excerpt, $post) {
return $post->post_excerpt;
}
add_filter('woocommerce_product_loop_start', function($ob_get_clean) {
add_filter('get_the_excerpt', 'etheme_custom_make_excerpt_unfiltered', 999, 2);
return $ob_get_clean;
});

add_filter('woocommerce_product_loop_end', function($ob_get_clean) {
remove_filter('get_the_excerpt', 'etheme_custom_make_excerpt_unfiltered', 999, 2);
return $ob_get_clean;
});

Seems like some plugin or somewhere else exists filter that makes full description output instead of empty excerpt so that we overwrite with our custom filters for you to prevent such things (on product loop start ‘woocommerce_product_loop_start’ we added our changes and removing them after end product loop ‘woocommerce_product_loop_end’)

Regards

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.