0

I have tried to upload image in block using wysiwyg editor.

1.click the Insert/Edit image
2.choose a image
3.save

but image not showing in preview.

0

for Custom Product text type Attribute: Inject Magento\Catalog\Helper\Output class in you Block Class.

use Magento\Catalog\Helper\Output as ProductAttribute;
class Planlist extends DataObject
{
/**
 * @var ProductAttribute 
 */
private $_productAttribute;
public function __construct(
...
ProductAttribute $productAttribute,
...
) {
...
$this->_productAttribute = $productAttribute;
...
}

/**
     * Prepare product attribute html output
     *
     * @param ModelProduct $product
     * @param string $attributeHtml
     * @param string $attributeName
     * @return string
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     */
    public function getAdditionalData($product, $attributeHtml, $attributeName)
    {
        return $this->_productAttribute->productAttribute($product, $attributeHtml, $attributeName);
    }
}

Call this Function where the need

$this->getAdditionalData($item,$item->getData('service_packages'),'service_packages'),
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.