File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -205,11 +205,17 @@ public function modifyData(array $data)
205
205
206
206
foreach ($ this ->getDataScopes () as $ dataScope ) {
207
207
$ data [$ productId ]['links ' ][$ dataScope ] = [];
208
+ $ linkItems = [];
208
209
foreach ($ this ->productLinkRepository ->getList ($ product ) as $ linkItem ) {
209
210
if ($ linkItem ->getLinkType () !== $ dataScope ) {
210
211
continue ;
211
212
}
212
-
213
+ $ linkItems [] = $ linkItem ;
214
+ }
215
+ usort ($ linkItems , function ($ a , $ b ) {
216
+ return $ a ->getPosition () <=> $ b ->getPosition ();
217
+ });
218
+ foreach ($ linkItems as $ linkItem ) {
213
219
/** @var \Magento\Catalog\Model\Product $linkedProduct */
214
220
$ linkedProduct = $ this ->productRepository ->get (
215
221
$ linkItem ->getLinkedProductSku (),
You can’t perform that action at this time.
0 commit comments