Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

How to display woo product description via block element?

  • Hey there,

    I’m currently building a custom WooCommerce single product layout using a Block Element hooked to before_single_product for all product pages. Inside the Block Element, I’m adding GenerateBlocks text blocks with Dynamic Data. I have disabled the default Woo product template, works well so far, product title, price and other meta will be displayed correctly.

    {{post_excerpt}} works correctly and outputs the product short description in the frontend. However, when I try to use {{post_content}}, nothing is rendered. Alternatively, if I use the [woocommerce_product_description] shortcode inside a Shortcode block, the shortcode itself is displayed as plain text instead of rendering the product description.

    Is this expected behavior because of the before_single_product hook being outside the normal the_content() execution? What would be the recommended way to output the main product description within a Block Element hooked into WooCommerce without enabling PHP execution?

    Thanks in advance for your help
    Sascha

  • Hello.

    Try adding, a Dynamic Content block instead and choose Post Content as Type.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.