New Landing How can we help? Atelier Allow HTML description of products in List View

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Atelier
  • #266692
    CallidusPro
    Member
    Post count: 13

    Hi,

    I need to know how to allow HTML in the product description when i enable the LIST VIEW in the products list page, and then cut the lenght of the text to maximum of words or letters if it is too long

    See attached image,

    Thanks

    #266697
    CallidusPro
    Member
    Post count: 13

    Solved!

    I edit the line 352 in woocommerce/content-product.php from

    <?php echo $product_description;?>

    to

    <?php echo do_shortcode( sf_add_formatting( $product_description ) ); ?>

    maybe you can add this modification to your next realease

    ciao

    #266721
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Brilliant! I am glad that you managed to resolve the issue.
    Thanks
    Mohammad

    #266841
    CallidusPro
    Member
    Post count: 13

    I need only to add a length to the text formated, for example use the first 50 words of the description only.

    I try using “wp_trim_words”, cuts the text but the formating is not working if I use this first

    There is some parameter to use with the sf_add_formatting code?

    Thanks

    #266845
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please refer this article http://alanwhipple.com/2011/05/25/php-truncate-string-preserving-html-tags-words/. It will help you.
    Thanks
    Mohammad

    #266846
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please refer this article http://alanwhipple.com/2011/05/25/php-truncate-string-preserving-html-tags-words/. It will help you.
    Thanks
    Mohammad

    #266940
    CallidusPro
    Member
    Post count: 13

    Thanks,

    I figured out using this code

    $product_description = preg_replace('/\s+?(\S+)?$/', '', substr($product_description, 0, 251));
    

    and then

    echo do_shortcode( sf_add_formatting( $product_description . '... ' ) );

    #266942
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Glad it’s sorted.

    -Rui

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register