• Resolved softsleepysounds

    (@softsleepysounds)


    Hi there,

    I am trying to add the long product description to the shop page of woocommerce. I have found a snippet of code to add to the functions file to display the short description or excerpt, and changed the function to what I think is the long description function (‘woocommerce_single_product_summary’):

    add_action(‘woocommerce_after_shop_loop_item’,’woocommerce_single_product_summary’, 5);

    but it does not seem to be working. Does anyone have any ideas?

    I want to put two separate pieces of data into this field and upload via CSV import, so I also need to know how to separate them with line breaks and for CSS purposes.

    Thanks in advance.
    Sarah

    https://www.ads-software.com/plugins/woocommerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    Post the code you had. Just changing the name of the function call won’t work – the function needs to exist.

    Thread Starter softsleepysounds

    (@softsleepysounds)

    Okay, here was the code:

    add_action('woocommerce_after_shop_loop_item_title','woocommerce_template_single_excerpt', 10);

    Thanks for your help!

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Instead of woocommerce_template_single_excerpt, use custom_woocommerce_after_shop_loop_item_title

    And add a function like this:

    function custom_woocommerce_after_shop_loop_item_title() {
    $content = get_the_content('Read more');
    print $content;
    }
    Thread Starter softsleepysounds

    (@softsleepysounds)

    Thanks Mike, that worked with a few small modifications.

    Could I trouble you with one more thing? Is there some way of designating a class for the content so that I can style it with CSS? I am trying to make the text bold and red.

    Thanks so much again for your help!

    Kind regards,
    Sarah

    Plugin Contributor Mike Jolley

    (@mikejolley)

    You can wrap it in a div.

    print '<div class="your_class">' . $content . '</div>';
    Thread Starter softsleepysounds

    (@softsleepysounds)

    Thanks that worked beautifully ??

    I really appreciate your help!

    Cheers,
    Sarah

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘long product description on shop page’ is closed to new replies.