Hi I have got the product collection here but am trying to push $sku value in $item, but seems like its not working, anything wrong am doing, please help
$items = array(); // trying to push sku data in this array
foreach($productCollection as $productCust){
$sku = $productCust->getSku();// this is working fine
array_push($items, $productCust->getSku());
}
Update
$items = [];
$productCollection = $this->collectionFactory->create();
$Test = $productCollection->getItems();
foreach($Test as $productCust){
$sku = $productCust->getSku();// this is working fine
$items[] = $sku;
}