Home Forums WoodMart support forum HTML in product short desc in archive

HTML in product short desc in archive

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #423196

    ondra.toth
    Participant

    Hello,

    my vendors sometimes by mistakes put html tags in product description and it will deformat a donts. I figured how to solve this by this snippet. It works fine in the single product but not in product archive. Can you tell me which hook should I use to target desc at product archive?

    Image in attach. Try to hover over product: https://mintmarket.online/prodejce/everything/

    function stripe_woocommerce_short_description($the_excerpt) {
    
        //wp_strip_all_tags will strip all HTML tags including script and style.
        //return wp_strip_all_tags($the_excerpt);
    
        //pass second parameter true if you want to remove break tag <br/> also.
        //return wp_strip_all_tags( $the_excerpt, true );
    
       //For Keep specific tags
       return strip_tags($the_excerpt,"<img /><table><p><li><ul>");
    
    }
    add_filter('woocommerce_short_description', 'stripe_woocommerce_short_description',10, 1);

    Thank you very much

    • This topic was modified 1 year, 11 months ago by Artem Temos.
    Attachments:
    You must be logged in to view attached files.
    #423380

    Artem Temos
    Keymaster

    Hello,

    Sorry, but we don’t have a working code for this. Such kinds of customizations are out of our theme support scope.

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)