I wanted to add my own button in the Shopping Cart as I tried to show you in the screenshot.
But I didn't find a tutorial that worked for me. Do you have any idea how I can do this? (I want to make my own extension)
(EDIT) This is what I have done so far:
In the registration.php file:
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Vendor_ModuleName',
__DIR__
);
In the module.xml file:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Vendor_ModuleName" setup_version="1.0.0"></module>
</config>
In the Button.php file:
<?php
namespace Vendor\ModuleName\Block;
class Button extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Backend\Block\Template\Context $context,
array $data = []
) {
parent::__construct($context, $data);
}
}
In the checkout_cart_index.xml file:
<?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="cart.summary">
<block class="Vendor\Module\Block\Button" after="-" name="custom_button" template="Vendor_ModuleName::button.phtml" />
</referenceContainer>
</page>
In the button.phtml file:
<button>Your Button</button>
I also ran all commands you have told me.
checkout_cart_index
addModuleName
instead ofModule
in block class