@@ -78,25 +78,30 @@ public function get()
78
78
'scopes ' => [],
79
79
];
80
80
81
- /** @var Group $group */
82
- foreach ($ groups [$ website ->getId ()] as $ group ) {
83
- $ groupScope = [
84
- 'scope ' => ScopeInterface::SCOPE_GROUP ,
85
- 'scope_id ' => $ group ->getId (),
86
- 'scopes ' => [],
87
- ];
88
-
89
- /** @var Store $store */
90
- foreach ($ stores [$ group ->getId ()] as $ store ) {
91
- $ storeScope = [
92
- 'scope ' => ScopeInterface::SCOPE_STORES ,
93
- 'scope_id ' => $ store ->getId (),
81
+ if (!empty ($ groups [$ website ->getId ()])) {
82
+ /** @var Group $group */
83
+ foreach ($ groups [$ website ->getId ()] as $ group ) {
84
+ $ groupScope = [
85
+ 'scope ' => ScopeInterface::SCOPE_GROUP ,
86
+ 'scope_id ' => $ group ->getId (),
94
87
'scopes ' => [],
95
88
];
96
- $ groupScope ['scopes ' ][] = $ storeScope ;
89
+
90
+ if (!empty ($ stores [$ group ->getId ()])) {
91
+ /** @var Store $store */
92
+ foreach ($ stores [$ group ->getId ()] as $ store ) {
93
+ $ storeScope = [
94
+ 'scope ' => ScopeInterface::SCOPE_STORES ,
95
+ 'scope_id ' => $ store ->getId (),
96
+ 'scopes ' => [],
97
+ ];
98
+ $ groupScope ['scopes ' ][] = $ storeScope ;
99
+ }
100
+ }
101
+ $ websiteScope ['scopes ' ][] = $ groupScope ;
97
102
}
98
- $ websiteScope ['scopes ' ][] = $ groupScope ;
99
103
}
104
+
100
105
$ defaultScope ['scopes ' ][] = $ websiteScope ;
101
106
}
102
107
0 commit comments