Limit characters on the short description from the woo product block

Posted in: Newspaper
Post count: 121

Unfortunately at this time we see no option for this as the product descriptions throws the design layout off. Can you please add this feature ASAP? For the meantime can we have the css to implement at this time?

Thank you

Sample

Post count: 27744

Hello,

Please try to change the Products bottom space -> https://i.imgur.com/Siz4goD.png

Thank you!

Post count: 121

???

This doesn’t limit the characters on the short description. It only modifies the padding on the product divs.

Post count: 27744

Hello,

Unfortunately, on the Woo Product Block does not have an excerpt limit.

Thank you!

Post count: 121

We know this! Can you please let the developers know for future updates? Can we get a work around for this for the meantime? Like the css?

Post count: 121

Is there not a way to add to the function.php a add_filter like this:

add_filter(‘woocommerce_short_description’, ‘limit_product_short_description’, 10, 1);

function limit_product_short_description($post_excerpt)
{
if (!is_product())
{
$pieces = explode(” “, $post_excerpt);
$post_excerpt = implode(” “, array_splice($pieces, 0, 14));
}
return $post_excerpt;
}

We really want to limit the characters on the product short description

Thanks!

  • This reply was modified 4 years by what-the.
Post count: 21065

Hello!

Sure. I’ve added this feature to our improvement list.

Thank you!

Post count: 121

So we are having an issue.
When adding this filter to the functions.php its not working. Is there another functions file that is created in another nested directory for the newspaper template? We want to add this filter to limit the short product description for the woo product block.

Thank you!

add_filter( ‘woocommerce_short_description’, ‘prefix_filter_woocommerce_short_description’ );
/**
* Limit WooCommerce Short Description Field
*/
function prefix_filter_woocommerce_short_description( $post_post_excerpt ) {
// make filter magic happen here…
if(! is_product() ) { // add in conditionals
$text = $post_post_excerpt;
$words = 10; // change word length
$more = ‘ […]’; // add a more cta

$post_post_excerpt = wp_trim_words( $text, $words, $more );
}
return $post_post_excerpt;
};

Post count: 21065

Hello!

Unfortunately, this will require custom work which is not covered by the support team.
For customization and other services you can contact our custom work team here: https://tagdiv.com/premium-customization-services/

Thank you for understanding!

Post count: 121

???

What the?

Why should we have to pay for it when we originally had it working BUT YOUR UPGRADES MESSED IT UP! NOT COOL AND NOT FAIR. Please check out this link to confirm with what we are saying!

https://forum.tagdiv.com/topic/adding-short-description-as-an-excerpt-to-the-td-composer-woo-product-block/

Post count: 21065

Hello!

It was a misunderstanding. But, it’s great that you found the answer.

Thank you!

Post count: 121

This does not work anymore! The new changes and updates for the newspaper theme is making this code no longer valid! It does not work!

Post count: 21065

Hello!

I’m sorry to hear about that. Please contact our custom work team and they will try to help you.

Thank you!

Viewing 13 posts - 1 through 13 (of 13 total)
The forum ‘Newspaper’ is closed to new topics and replies.