On product listing page I have $_productCollection = $block->getLoadedProductCollection();
if I call getData on $_productCollection I get different array than I get in foreach loop. Does anyone have any idea about this.
Before foreach loop data looks like
Array
(
[0] => Array
(
[row_id] => 1026
[entity_id] => 1026
[created_in] => 1
[updated_in] => 2147483647
[attribute_set_id] => 4
[type_id] => simple
[sku] => 47-62-532-11
[has_options] => 0
[required_options] => 0
[created_at] => 2015-08-08 21:43:58
[updated_at] => 2020-05-11 17:37:25
[pim_updated_at] => 2019-11-02 22:29:43
[status] => 1
[price] => 3.5700
[tax_class_id] => 5
[final_price] => 3.5700
[minimal_price] => 3.5700
[min_price] => 3.5700
[max_price] => 3.5700
[tier_price] =>
[most_view] => 9
[is_salable] => 1
)
[1] => Array
(
[row_id] => 1028
[entity_id] => 1028
[created_in] => 1
[updated_in] => 2147483647
[attribute_set_id] => 4
[type_id] => simple
[sku] => 47-62-534-10
[has_options] => 0
[required_options] => 0
[created_at] => 2015-08-08 21:44:08
[updated_at] => 2020-05-11 05:18:23
[pim_updated_at] => 2019-11-02 22:29:43
[status] => 1
[price] => 3.5700
[tax_class_id] => 5
[final_price] => 3.5700
[minimal_price] => 3.5700
[min_price] => 3.5700
[max_price] => 3.5700
[tier_price] =>
[most_view] => 1
[is_salable] => 1
)
[2] => Array
(
[row_id] => 1027
[entity_id] => 1027
[created_in] => 1
[updated_in] => 2147483647
[attribute_set_id] => 4
[type_id] => simple
[sku] => 47-62-532-14
[has_options] => 0
[required_options] => 0
[created_at] => 2015-08-08 09:44:03
[updated_at] => 2020-05-11 06:42:05
[pim_updated_at] => 2019-11-02 22:29:43
[status] => 1
[price] => 3.4400
[tax_class_id] => 5
[final_price] => 3.4400
[minimal_price] => 3.4400
[min_price] => 3.4400
[max_price] => 3.4400
[tier_price] =>
[most_view] => 1
[is_salable] => 1
)
[3] => Array
(
[row_id] => 1025
[entity_id] => 1025
[created_in] => 1
[updated_in] => 2147483647
[attribute_set_id] => 4
[type_id] => simple
[sku] => 47-62-532-10
[has_options] => 0
[required_options] => 0
[created_at] => 2015-08-08 13:43:53
[updated_at] => 2020-05-11 06:11:17
[pim_updated_at] => 2019-11-02 22:29:43
[status] => 1
[price] => 3.5700
[tax_class_id] => 5
[final_price] => 3.5700
[minimal_price] => 3.5700
[min_price] => 3.5700
[max_price] => 3.5700
[tier_price] =>
[most_view] => 1
[is_salable] => 1
)
)
So, inside for each first product should be '47-62-532-11' but I am getting '47-62-534-10' SKU as the first element.