Magento 2 : Add in custom module

by Rohan Hapani   Last Updated September 21, 2018 07:09 AM

I want to add block in my custom module. I see in product view page that custom options render from this block.

So, I need to add this in my module. I tried to using by this code. But, it's not working.

$productData = $layout->createBlock('Magento\Catalog\Block\Product\View', '')->setProduct($product)->setTemplate('Magento_Catalog::product/view/options/wrapper.phtml')->toHtml();

How to implement this and render custom options?


Answers 1

Add in your xml file

          <referenceBlock name="" />
Rutvee Sojitra
Rutvee Sojitra
September 21, 2018 07:03 AM

Related Questions

B2B / Wholesale and Product Options Price

Updated March 02, 2018 12:09 PM

Get options from configurable

Updated March 10, 2018 13:09 PM

Get Attribute option Id by Attribute admin value

Updated July 04, 2018 08:09 AM

Product Image Uploader to Preview Product M2.2.2

Updated May 03, 2018 20:09 PM