- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Get the Mini cart content outside Magento2 using Ajax
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Get the Mini cart content outside Magento2 using Ajax
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