Skip to content

Render the My Cart via Block/Link won't output anything #3821

@ddonnini

Description

@ddonnini

Steps to reproduce

Render the output of a block of class Magento\Checkout\Block\Cart\Link

Expected result

A link with "My Cart" and the number of items

Actual result

Nothing output.

Solution

Add "!" in the _toHtml of the file module-checkout/Block/Cart/Link.php

protected function _toHtml()
{
    if ($this->_moduleManager->isOutputEnabled('Magento_Checkout')) {
        return '';
    }
    return parent::_toHtml();
}

to

protected function _toHtml()
{
    if (!$this->_moduleManager->isOutputEnabled('Magento_Checkout')) {
        return '';
    }
    return parent::_toHtml();
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions