• Resolved unapragmatica

    (@unapragmatica)


    Hello. I’m setting up a new store on a page with a template I haven’t used before (Riverbank) that uses the Gutenberg block system. The problem appears when I create the product in the store, and in the short description it shows an extract of it (excerpt), eliminating the paragraph breaks, the html code, and trimming the text.

    I have another website with Woocommerce (outdated, it is worth clarifying) and the description is shown complete (woocommerce-product-details__short-description), however on the new page it shows the incomplete summary (wp-block-post-excerpt).

    How could I prevent that filter from being applied that crops and eliminates the formatting of the short description?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Mirko P.

    (@rainfallnixfig)

    Hi @unapragmatica ??

    the short description it shows an extract of it (excerpt), eliminating the paragraph breaks, the html code, and trimming the text.

    I understand you’re experiencing issues with the short product description on your new store using the Riverbank template and Gutenberg block system. I’m here to help.

    The issue you’re experiencing appears to be a result of how the new Gutenberg block system handles excerpts. The Gutenberg block system has its own way of handling excerpts, which might be different from how the older WooCommerce system you’re used to handles them.

    To prevent the filter from cropping and eliminating the formatting of the short description, you may need to add custom code to your child theme’s functions.php file. You can use the wp_trim_excerpt filter to modify how WordPress generates excerpts. Here you have a reference: https://developer.www.ads-software.com/reference/functions/wp_trim_excerpt/.

    Just to mention, our scope of support does not cover code customizations, as explained in our Support Policy. If you’re not comfortable with coding, I recommend hiring a developer or contacting the theme’s support for assistance.

    Let us know if you have any other questions ??

    Cheers.

    Thread Starter unapragmatica

    (@unapragmatica)

    Hello @rainfallnixfig! Thanks for the response, I’m going to try this method and I’ll let you know the result. Cheers.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @unapragmatica

    That sounds like a plan. Please, take your time to try it out.

    If the issue persists, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.

    Thanks!

    Hi @(woo-hc)

    Hi – we have just come come across this issue – and have checked it on the 7 sites that use single product FSE templates and in every one the HTML is stripped out and trimmed in the short description.

    Thanks for pointing out the filter and we have fixed the issue by adding this custom code to the Child Theme functions.php file

    add_filter('wp_trim_words', function ($text, $num_words, $more, $original_text) {
        if( is_singular( 'product' ) ){
            $text = wpautop( $original_text );
            return $text;
        }
    }, 10, 4);

    This is obviously a bug that needs a fix. I went to the Git repo thinking I’d find a ticket there. I could not find one – so I thought I’d ask you if you have raised the issue?

    Steve

    Hey there, @a3rev! Thanks for contacting us.

    I just tested and I was able to replicate this issue on my end.

    I was also not able to find a GitHub issue on it.

    We’ll investigate this further and open an issue on GitHub if needed.

    If you need help with anything else, please feel free to reach out.

    Have a wonderful day!

    @carolm29

    Thanks for the update. Could I ask that you @a3rev on the github issue if / when it is opened so that I can keep tabs on the progress – want to remove the custom code if the issue is patched.

    Thank you – Steve

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @a3rev,

    We appreciate your proactive approach to identifying and addressing the issue with the single product FSE templates. Your contribution to our community is invaluable.

    We recommend you create an issue here. This will allow our developer to take a look and provide further insights.

    Thanks again for your cooperation and understanding.

    @shameemreza

    Thanks for following this up. As suggested the issue has been created here.

    Have a great day.

    Steve

    Hey there @a3rev,

    Thank you so much for creating the issue!

    We appreciate you being an active part of the community ??

    Have a wonderful day!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Post full short description in product page’ is closed to new replies.