Skip to content

Commit 960d256

Browse files
committed
Fix incorrect logo on order print page
1 parent f6a6289 commit 960d256

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

app/code/Magento/Sales/ViewModel/Header/LogoPathResolver.php

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
namespace Magento\Sales\ViewModel\Header;
99

10+
use Magento\Config\Model\Config\Backend\Image\Logo;
1011
use Magento\Framework\App\Config\ScopeConfigInterface;
11-
use Magento\Store\Model\ScopeInterface;
12-
use Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolverInterface;
12+
use Magento\Framework\Registry;
1313
use Magento\Framework\View\Element\Block\ArgumentInterface;
1414
use Magento\Sales\Model\Order;
15-
use Magento\Framework\Registry;
15+
use Magento\Store\Model\ScopeInterface;
16+
use Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolverInterface;
1617

1718
/**
1819
* Class for resolving logo path
@@ -50,20 +51,31 @@ public function __construct(
5051
*/
5152
public function getPath(): ?string
5253
{
53-
$path = null;
5454
$storeId = null;
5555
$order = $this->coreRegistry->registry('current_order');
5656
if ($order instanceof Order) {
5757
$storeId = $order->getStoreId();
5858
}
59-
$storeLogoPath = $this->scopeConfig->getValue(
59+
$salesLogoPath = $this->scopeConfig->getValue(
6060
'sales/identity/logo_html',
6161
ScopeInterface::SCOPE_STORE,
6262
$storeId
6363
);
64-
if ($storeLogoPath !== null) {
65-
$path = 'sales/store/logo_html/' . $storeLogoPath;
64+
65+
if ($salesLogoPath !== null) {
66+
return 'sales/store/logo_html/' . $salesLogoPath;
67+
}
68+
69+
$headerLogoPath = $this->scopeConfig->getValue(
70+
'design/header/logo_src',
71+
ScopeInterface::SCOPE_STORE,
72+
$storeId
73+
);
74+
75+
if ($headerLogoPath !== null) {
76+
return Logo::UPLOAD_DIR . '/' . $headerLogoPath;
6677
}
67-
return $path;
78+
79+
return null;
6880
}
6981
}

0 commit comments

Comments
 (0)