We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    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.

    <referenceBlock name="logo">
    <arguments>
    <argument name="logo_src" xsi:type="helper" helper="MagemonkeyCustomModHelperData::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)

    <?php
    namespace MagemonkeyCustomModHelper;
    class Data extends MagentoFrameworkAppHelperAbstractHelper
    {
    protected $_request;
    public function __construct
    (
    MagentoFrameworkAppRequestHttp $request,
    MagentoFrameworkViewAssetRepository $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

    Fill the below form if you need any Magento relate help/advise/consulting.

    With Only Agency that provides a 24/7 emergency support.

      Get a Free Quote