cancel
Showing results for 
Search instead for 
Did you mean: 

image in product description get broken on front end

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Re: image in product description get broken on front end

The below code will render the image in the product description attribute.

$productDescription = $this->helper('Magento\Catalog\Helper\Output')->productAttribute($_product, $_product->getDescription(), 'description');

echo $productDescription;

This code can be used for any Text Area or Text Editor (WYSIWYG) attribute.

Please replace the $_product->getDescription() and 'description' with the appropriate attribute code.

 

Using the above code you can render the image from Text Area / WYSIWYG product attribute.

 

Thank You

Mohana Krishnan