Hello Magento Folks,

How are you all working? Here comes another article of How To series to guide you all on Magento 2:

Last time we have shared very interesting article about Magento 2: How to Add Front-end Product URL Column to Admin Product Grid. Here given below is the full explanation about How to Add Custom Block in Cart Summary Before Subtotal in Magento 2 including all the required codes. 

Let’s Start Out With Coding

Step 1: First, we need to create a “Registration.php” file inside our extension at the following path,

app\code\Vendor\Extension

Step 2: After that, we need to create a “module.xml” file inside the extension etc folder.

app\code\Vendor\Extension\etc

Step 3: After that, we need to create a “checkout_cart_index.xml” file inside the path folder to add the file in the module.

app\code\Vendor\Extension\view\frontend\layout

Step 4: Lastly, Create the “custom-block.phtml” file inside the below path folder in the module.

app\code\Vendor\Extension\view\frontend\templates

Concluding Words

So, that was all for the day! With the help of these codes, you can successfully achieve the task of Add custom block in cart summary before subtotal in Magento 2. You are free to play around and customize these codes according to your needs for fetching data. If you face any issues while implementing, then contact our Support Team. We will be happy to help you.

If you find the article helpful then kindly share it with your friends and make their task easy and also share your reviews about the article in the comment section below.

Happy Coding.

 

Click to rate this post!
[Total: 5 Average: 4.2]