I want to get quote item through the item id on the guest page.
Got the null value
<?php
namespace Codism\Csr\Block\Index;
class Approveitem extends \Magento\Framework\View\Element\Template {
protected $_coreRegistry;
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\Registry $coreRegistry,
\Magento\Quote\Model\Quote\ItemFactory $quoteItemFactory,
\Magento\Quote\Model\ResourceModel\Quote\Item $itemResourceModel
)
{
$this->_coreRegistry = $coreRegistry;
$this->quoteItemFactory = $quoteItemFactory;
$this->itemResourceModel = $itemResourceModel;
parent::__construct($context);
}
public function getCustomerCartDetails(){
$itemId = $this->_coreRegistry->registry('itemId');
$quoteItem = $this->quoteItemFactory->create();
$item = $this->itemResourceModel->load($quoteItem, $itemId);
return $item;
}
}