0

I want to show product details on popup using controller.

So how is it possible?

$htmlCatInfo = $layout->createBlock(
                \Tigren\Ajaxcart\Block\BuildProductInfo::class,
                'ajax.buildproduct-info',
                ['data' => ['itemid' => $itemid]]
            )->setTemplate('Tigren_Ajaxcart::buildpopupcatinfo.phtml')->toHtml();

Any one can tell me how can I manage data .phtml to block

0

In the block class you can load the product using the itemId data from repository https://www.mageplaza.com/devdocs/how-get-product-id-sku-magento-2.html and after that you can create the phtml content according to the output which you want to show..

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.