When creating a new custom theme, if we don't have any assets files under web
folder, your theme may be ignored when executing deploy command.
I've repeated your steps and the override works for me.
Here's what i did:
Added app/code/Vendor/Module/view/adminhtml/layout/sales_order_view.xml
to an existing module
<?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>
<referenceContainer name="left">
<referenceBlock name="order_info">
<action method="setTemplate">
<argument name="template" xsi:type="string">Vendor_Module::info.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
Copied the contents of vendor/magento/module-sales/view/adminhtml/templates/order/view/info.phtml
into a new template app/code/Vendor/Module/view/adminhtml/templates/info.phtml
:
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @var \Magento\Sales\Block\Adminhtml\Order\View\Info $block
*/
// @codingStandardsIgnoreFile
$order = $block->getOrder();
$orderAdminDate = $block->formatDate(
$block->getOrderAdminDate($order->getCreatedAt()),
\IntlDateFormatter::MEDIUM,
true
);
$orderStoreDate = $block->formatDate(
$order->getCreatedAt(),
\IntlDateFormatter::MEDIUM,
true,
$block->getTimezoneForStore($order->getStore())
);
?>
<!-- I added this bit -->
<h1>OVERRIDE</h1>
<h1>OVERRIDE</h1>
<h1>OVERRIDE</h1>
<section class="admin__page-section order-view-account-information">
<div class="admin__page-section-title">
<span class="title"><?= $block->escapeHtml(__('Order & Account Information')) ?></span>
</div>
Ran the setup:upgrade
command to clear all caches:
$ php -f bin/magento setup:upgrade
Visited an order details page in the admin:
http://www.example.test/admin/sales/order/view/order_id/18/key/29acbf64d18925d298b839dae9c432d2090ec92b3b175649bf3a98c69fae6b47/
It would appear that the problem therefore lies with the Temando extension. I would check to see if the above steps work after disabling the Temando extension.
If so, I would get in contact with Temando.
Best Answer
Use this command :
bin/magento setup:static-content:deploy --theme=Vendor/Theme en_US -f
I had problem in admin panel and I ran
bin/magento setup:static-content:deploy --theme=Magento/backend en_US -f
This command created
js-translation.json
in
pub/static/adminhtml/Magento/backend/en_US/js-translation.json