If you want to change the header logo only on the checkout page using XML, then follow the below instructions:
First, you should override the checkout_index_index.xml file in your theme and add the below code between the body.
1 2 3 4 5 |
<referenceBlock name="logo"> <arguments> <argument name="logo_src" xsi:type="helper" helper="Magemonkey\CustomMod\Helper\Data::getLogo"></argument> </arguments> </referenceBlock> |
Then, you need to create a helper or add the below function in your exiting helper file. (here I have created a new helper file in my module)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?php namespace Magemonkey\CustomMod\Helper; class Data extends \Magento\Framework\App\Helper\AbstractHelper { protected $_request; public function __construct ( \Magento\Framework\App\Request\Http $request, \Magento\Framework\View\Asset\Repository $assetRepo ) { $this->_request = $request; $this->_assetRepo = $assetRepo; } public function getLogo() { return $this->_assetRepo->getUrl('images/checkout-logo.png'); } } |
*Note: I have tried this code in Magento 2.4.2
[crayon-63d3da5cd8289104221885/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.