Skip to content

Commit

Permalink
Merge pull request #58 from technodelight/fix-breaking-product-collec…
Browse files Browse the repository at this point in the history
…tion

Fix broken product collection
  • Loading branch information
corbinspicer68 committed Dec 14, 2022
2 parents 0f34940 + 295fbe9 commit 49c7d4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Block/Tealium.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ public function init(
// Fetch the current collection from the block and set pagination
if(!empty($categoryProductListBlock)){
$collections = $categoryProductListBlock->getLoadedProductCollection();
$collections->setCurPage(1)->setPageSize(4);

foreach($collections as $product){
$productOnPage[] = $product->getSku();
$productOnPageId[] = $product->getId();
if (count($productOnPage) === 4) {
break;
}
}

}
Expand Down

0 comments on commit 49c7d4f

Please sign in to comment.