|
7 | 7 |
|
8 | 8 | namespace Magento\Sales\ViewModel\Header;
|
9 | 9 |
|
| 10 | +use Magento\Config\Model\Config\Backend\Image\Logo; |
10 | 11 | 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; |
13 | 13 | use Magento\Framework\View\Element\Block\ArgumentInterface;
|
14 | 14 | 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; |
16 | 17 |
|
17 | 18 | /**
|
18 | 19 | * Class for resolving logo path
|
@@ -50,20 +51,31 @@ public function __construct(
|
50 | 51 | */
|
51 | 52 | public function getPath(): ?string
|
52 | 53 | {
|
53 |
| - $path = null; |
54 | 54 | $storeId = null;
|
55 | 55 | $order = $this->coreRegistry->registry('current_order');
|
56 | 56 | if ($order instanceof Order) {
|
57 | 57 | $storeId = $order->getStoreId();
|
58 | 58 | }
|
59 |
| - $storeLogoPath = $this->scopeConfig->getValue( |
| 59 | + $salesLogoPath = $this->scopeConfig->getValue( |
60 | 60 | 'sales/identity/logo_html',
|
61 | 61 | ScopeInterface::SCOPE_STORE,
|
62 | 62 | $storeId
|
63 | 63 | );
|
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; |
66 | 77 | }
|
67 |
| - return $path; |
| 78 | + |
| 79 | + return null; |
68 | 80 | }
|
69 | 81 | }
|
0 commit comments