How can get Woocommerce product single description
I get the description of the shortcode products but they all come as text. Can I make a separate paragraph or list for each?
Following my code: functions.php
add_shortcode( 'product_description', 'display_product_description' );
function display_product_description( $atts ){
$atts = shortcode_atts( array(
'id' = get_the_id(),
), $atts, 'product_description' );
global $product;
if ( ! is_a( $product, 'WC_Product') )
$product = wc_get_product($atts['id']);
return $product-get_description();
}
echo do_shortcode([product_description]);
Then I display with shortcode.
If you ask why it brings the description, I make accordion or add a shortcode in it.
Is it possible to do like in this photo?
Topic description Wordpress
Category Web