Hi,
I am working on Magento 2.2.3. I am trying to get the content of the minicart using Ajax since calling from outside Magento. I can't able to retrieve the minicart due to the knockout js. I am trying in the following way.
$blockHtml = $resultPage->getLayout()
->createBlock('\Magento\Checkout\Block\Cart\Sidebar')
->setTemplate('Magento_Checkout::cart/minicart.phtml')
->toHtml();
how to load the data to knockout js templates? is there any other better way to do it?
Thanks in advance
Even I am facing issue with custom minicart ..how you resolved ? Please share
@Rathinasamy wrote:Hi,
I am working on Magento 2.2.3. I am trying to get the content of the minicart using Ajax since calling from outside Magento. I can't able to retrieve the minicart due to the knockout js. I am trying in the following way.
$blockHtml = $resultPage->getLayout()
->createBlock('\Magento\Checkout\Block\Cart\Sidebar')
->setTemplate('Magento_Checkout::cart/minicart.phtml')
->toHtml();how to load the data to knockout js templates? is there any other better way to do it?
Thanks in advance
@Rathinasamy wrote:Hi,
I am working on Magento 2.2.3. I am trying to get the content of the minicart using Ajax since calling from outside Magento. I can't able to retrieve the minicart due to the knockout js. I am trying in the following way.
$blockHtml = $resultPage->getLayout()
->createBlock('\Magento\Checkout\Block\Cart\Sidebar')
->setTemplate('Magento_Checkout::cart/minicart.phtml')
->toHtml();how to load the data to knockout js templates? is there any other better way to do it?
Thanks in advance
@Rathinasamy wrote:Hi,
I am working on Magento 2.2.3. I am trying to get the content of the minicart using Ajax since calling from outside Magento. I can't able to retrieve the minicart due to the knockout js. I am trying in the following way.
$blockHtml = $resultPage->getLayout()
->createBlock('\Magento\Checkout\Block\Cart\Sidebar')
->setTemplate('Magento_Checkout::cart/minicart.phtml')
->toHtml();how to load the data to knockout js templates? is there any other better way to do it?
Thanks in advance