File tree 2 files changed +59
-0
lines changed
2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Magento \Sales \Helper \Invoice ;
4
+
5
+ use Magento \Framework \App \Helper \AbstractHelper ;
6
+ use Magento \Framework \UrlInterface ;
7
+ use Magento \Store \Model \ScopeInterface ;
8
+
9
+ class Logo extends AbstractHelper
10
+ {
11
+ const XML_PATH_SALES_IDENTITY_LOGO_HTML = 'sales/identity/logo_html ' ;
12
+
13
+ protected $ logoBaseDir = 'sales/store/logo_html/ ' ;
14
+
15
+ /**
16
+ * @return string|null
17
+ */
18
+ public function getLogoFile ()
19
+ {
20
+ $ result = null ;
21
+
22
+ $ invoiceLogoPath = $ this ->getIdentityLogoHtml ();
23
+ if ($ invoiceLogoPath ) {
24
+ $ result = $ this ->_urlBuilder ->getBaseUrl (
25
+ ['_type ' => UrlInterface::URL_TYPE_MEDIA ]
26
+ ) . $ this ->getLogoBaseDir () . $ invoiceLogoPath ;
27
+ }
28
+
29
+ return $ result ;
30
+ }
31
+
32
+ /**
33
+ * @return string
34
+ */
35
+ public function getLogoBaseDir ()
36
+ {
37
+ return $ this ->logoBaseDir ;
38
+ }
39
+
40
+ /**
41
+ * @param null|int|string $store
42
+ * @return mixed
43
+ */
44
+ public function getIdentityLogoHtml ($ store = null )
45
+ {
46
+ return $ this ->scopeConfig ->getValue (
47
+ self ::XML_PATH_SALES_IDENTITY_LOGO_HTML ,
48
+ ScopeInterface::SCOPE_STORE ,
49
+ $ store
50
+ );
51
+ }
52
+ }
Original file line number Diff line number Diff line change 11
11
<update handle =" print" />
12
12
<body >
13
13
<attribute name =" class" value =" account" />
14
+ <referenceContainer name =" header-wrapper" >
15
+ <referenceBlock name =" logo" >
16
+ <arguments >
17
+ <argument name =" logo_src" xsi : type =" helper" helper =" Magento\Sales\Helper\Invoice\Logo::getLogoFile" />
18
+ </arguments >
19
+ </referenceBlock >
20
+ </referenceContainer >
14
21
<referenceContainer name =" page.main.title" >
15
22
<block class =" Magento\Sales\Block\Order\PrintOrder\Invoice" name =" order.status" template =" Magento_Sales::order/order_status.phtml" />
16
23
<block class =" Magento\Sales\Block\Order\PrintOrder\Invoice" name =" order.date" template =" Magento_Sales::order/order_date.phtml" />
You can’t perform that action at this time.
0 commit comments