Skip to main content
Tweeted twitter.com/StackMagento/status/1164371733941510144

Magento 2.3: I am trying to get anadd text into the small cart, but it isit's not working

I want to add a Texttext into the cart showed in the picture. But, but unfortunately my code does not work. enter image description here

This is my file structure:

enter image description here

Code in ButtonGet.php:

<?php
namespace MassiveArt\ShoppingCart\Block;
class ButtonGet extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

}

Code in get_cart_index.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="minicart.addons">
                <block class="MassiveArt\ShoppingCart\Block\ButtonGet" after="-" name="custom_button" template="MassiveArt_ShoppingCart::button_getcart.phtml" />
        </referenceContainer>
</page>

Code in button_getcart.phtml:

<h1>Hello</h1>

The Rest of my Module is working proberly, but this Text not. Can you help me?

Magento 2.3: I am trying to get an text into the small cart, but it is not working

I want to add a Text into the cart showed in the picture. But unfortunately my code does not work. enter image description here

This is my file structure:

enter image description here

Code in ButtonGet.php:

<?php
namespace MassiveArt\ShoppingCart\Block;
class ButtonGet extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

}

Code in get_cart_index.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="minicart.addons">
                <block class="MassiveArt\ShoppingCart\Block\ButtonGet" after="-" name="custom_button" template="MassiveArt_ShoppingCart::button_getcart.phtml" />
        </referenceContainer>
</page>

Code in button_getcart.phtml:

<h1>Hello</h1>

The Rest of my Module is working proberly, but this Text not. Can you help me?

Magento 2.3: I am trying to add text into the small cart, but it's not working

I want to add text into the cart showed in the picture, but unfortunately my code does not work. enter image description here

This is my file structure:

enter image description here

Code in ButtonGet.php:

<?php
namespace MassiveArt\ShoppingCart\Block;
class ButtonGet extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

}

Code in get_cart_index.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="minicart.addons">
                <block class="MassiveArt\ShoppingCart\Block\ButtonGet" after="-" name="custom_button" template="MassiveArt_ShoppingCart::button_getcart.phtml" />
        </referenceContainer>
</page>

Code in button_getcart.phtml:

<h1>Hello</h1>

The Rest of my Module is working proberly, but this Text not. Can you help me?

Source Link

Magento 2.3: I am trying to get an text into the small cart, but it is not working

I want to add a Text into the cart showed in the picture. But unfortunately my code does not work. enter image description here

This is my file structure:

enter image description here

Code in ButtonGet.php:

<?php
namespace MassiveArt\ShoppingCart\Block;
class ButtonGet extends \Magento\Framework\View\Element\Template
{
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

}

Code in get_cart_index.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceContainer name="minicart.addons">
                <block class="MassiveArt\ShoppingCart\Block\ButtonGet" after="-" name="custom_button" template="MassiveArt_ShoppingCart::button_getcart.phtml" />
        </referenceContainer>
</page>

Code in button_getcart.phtml:

<h1>Hello</h1>

The Rest of my Module is working proberly, but this Text not. Can you help me?