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