0

I am working on Magento ver. 2.4.2

. I want to uncheck My billing and shipping address are the same checkbox in in Create New Order Admin Section.enter image description here

1 Answer 1

0

You need to override the address.phtml File and remove the checked attribute in line no. 79

<?php if ($block->getIsAsBilling()): ?>checked<?php endif; ?> />

To override the vendor/magento/module-sales/view/adminhtml/templates/order/create/form/address.phtml file in Magento 2, you can follow these steps:

  1. Create a new module or use an existing one. Let's assume the module is called MyCompany_MyModule.

  2. Create a new file at app/code/MyCompany/MyModule/view/adminhtml/layout/sales_order_create_index.xml with the following content:

     <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
           <referenceBlock name="order_create_billing_address">
              <action method="setTemplate">
                 <argument name="template" xsi:type="string">MyCompany_MyModule::order/create/form/address.phtml</argument>
              </action>
           </referenceBlock>
           <referenceBlock name="order_create_shipping_address">
              <action method="setTemplate">
                 <argument name="template" xsi:type="string">MyCompany_MyModule::order/create/form/address.phtml</argument>
              </action>
           </referenceBlock>
        </body>
     </page>
    
  3. Create a new file at app/code/MyCompany/MyModule/view/adminhtml/templates/order/create/form/address.phtml and copy the contents of the original address.phtml file there.

  4. Make any changes you want to the copied address.phtml file.

  5. Flush the cache to see the changes in effect.

1
  • Not working if again check the button not working as default May 11, 2023 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.