cancel
Showing results for 
Search instead for 
Did you mean: 

image in product description get broken on front end

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