@@ -21,6 +21,18 @@ class Supplier
21
21
extends \Aimeos \MShop \Service \Provider \Decorator \Base
22
22
implements \Aimeos \MShop \Service \Provider \Decorator \Iface
23
23
{
24
+ private $ beConfig = array (
25
+ 'supplier.addressformat ' => array (
26
+ 'code ' => 'supplier.addressformat ' ,
27
+ 'internalcode ' => 'supplier.addressformat ' ,
28
+ 'label ' => 'Change how supplier address display. ' ,
29
+ 'type ' => 'string ' ,
30
+ 'internaltype ' => 'string ' ,
31
+ 'default ' => 'short ' ,
32
+ 'required ' => false ,
33
+ ),
34
+ );
35
+
24
36
private $ feConfig = array (
25
37
'supplier.code ' => array (
26
38
'code ' => 'supplier.code ' ,
@@ -64,12 +76,7 @@ public function __construct( \Aimeos\MShop\Service\Provider\Iface $provider,
64
76
{
65
77
$ addrId = ( count ( $ addresses ) > 1 ) ? $ item ->getCode () . '- ' . $ id : $ item ->getCode ();
66
78
67
- $ this ->feConfig ['supplier.code ' ]['default ' ][$ addrId ] = trim ( preg_replace ( "/ \n+/m " , "\n" , sprintf (
68
- /// Supplier address format with label (%1$s), company (%2$s),
69
- /// address part one (%3$s, e.g street), address part two (%4$s, e.g house number), address part three (%5$s, e.g additional information),
70
- /// postal/zip code (%6$s), city (%7$s), state (%8$s), country ID (%9$s),
71
- /// e-mail (%10$s), phone (%11$s), facsimile/telefax (%12$s), web site (%13$s)
72
- $ context ->getI18n ()->dt ( 'mshop ' , '%1$s
79
+ $ format = $ this ->getConfigValue ( 'supplier.addressformat ' , '%1$s
73
80
%2$s
74
81
%3$s %4$s
75
82
%5$s
@@ -79,7 +86,14 @@ public function __construct( \Aimeos\MShop\Service\Provider\Iface $provider,
79
86
%11$s
80
87
%12$s
81
88
%13$s '
82
- ),
89
+ );
90
+
91
+ $ this ->feConfig ['supplier.code ' ]['default ' ][$ addrId ] = trim ( preg_replace ( "/ \n+/m " , "\n" , sprintf (
92
+ /// Supplier address format with label (%1$s), company (%2$s),
93
+ /// address part one (%3$s, e.g street), address part two (%4$s, e.g house number), address part three (%5$s, e.g additional information),
94
+ /// postal/zip code (%6$s), city (%7$s), state (%8$s), country ID (%9$s),
95
+ /// e-mail (%10$s), phone (%11$s), facsimile/telefax (%12$s), web site (%13$s)
96
+ $ context ->getI18n ()->dt ( 'mshop ' , $ format ),
83
97
$ item ->getLabel (),
84
98
$ addr ->getCompany (),
85
99
$ addr ->getAddress1 (),
@@ -179,7 +193,7 @@ public function setConfigFE( \Aimeos\MShop\Order\Item\Base\Service\Iface $orderS
179
193
if ( ( $ code = $ attributes ['supplier.code ' ] ) != '' )
180
194
{
181
195
// add short address as attribute for summary page / customer email
182
- $ attributes ['supplier.address ' ] = $ this ->feConfig ['supplier.code ' ]['short ' ][$ code ];
196
+ $ attributes ['supplier.address ' ] = $ this ->feConfig ['supplier.code ' ]['default ' ][$ code ];
183
197
184
198
// remove code attribute for summary page / customer email
185
199
$ this ->setAttributes ( $ orderServiceItem , ['supplier.code ' => $ attributes ['supplier.code ' ]], 'hidden ' );
0 commit comments