File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -362,4 +362,29 @@ private function joinProductsToLinks()
362
362
);
363
363
}
364
364
}
365
+
366
+ /**
367
+ * After the collection has been loaded
368
+ *
369
+ * @SuppressWarnings(PHPMD.CamelCaseMethodName)
370
+ * @return $this
371
+ */
372
+ protected function _afterLoad ()
373
+ {
374
+ if ($ this ->getLinkModel ()) {
375
+ $ attributes = $ this ->getLinkAttributes ();
376
+ foreach ($ this as $ item ) {
377
+ foreach ($ attributes as $ attribute ) {
378
+ $ code = $ attribute ['code ' ];
379
+ $ value = $ item ->getData ($ code );
380
+ if ($ value !== null ) {
381
+ if ($ attribute ['type ' ] == 'decimal ' ) {
382
+ $ item ->setData ($ code , (float )$ value );
383
+ }
384
+ }
385
+ }
386
+ }
387
+ }
388
+ return parent ::_afterLoad ();
389
+ }
365
390
}
You can’t perform that action at this time.
0 commit comments