0

I have created a custom module in magento 2 and override sales_order_create_index.xml layout file in custom module and set referenceBlock. But issues that when first time page is loading from magento core module and again refresh page then my custom module file is call. can any one suggest me how can i call my custom module file at the time of first loading ??

layout file sales_order_create_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">
    <body>
        <referenceBlock name="shipping_method">
            <block class="vender\module\Block\Adminhtml\Createorder" name="customblock"
                   template="vender_module::createorder.phtml" after="-"/>
        </referenceBlock>
    </body>
</page>

Block file Createorder.php

<?php
namespace Vender\Module\Block\Adminhtml;
use Magento\Backend\Block\Template;

class Createorder extends Template
{

}

template file createorder.phtml

<div><?php echo "hi";?></div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.