From bfb5e89ee1d51e253865d0d4354c142629c7317a Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <5802616+dhorytskyi@users.noreply.github.com> Date: Wed, 24 Aug 2022 11:40:23 -0500 Subject: [PATCH 1/2] MCLOUD-9134: Cache Warming hits "not visible individually" pages (#20) --- Model/UrlFinder/Product.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Model/UrlFinder/Product.php b/Model/UrlFinder/Product.php index 322bcb7..66fa5f3 100644 --- a/Model/UrlFinder/Product.php +++ b/Model/UrlFinder/Product.php @@ -7,6 +7,7 @@ namespace Magento\CloudComponents\Model\UrlFinder; +use Magento\Catalog\Model\Product\Visibility as ProductVisibility; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\Catalog\Model\ResourceModel\Product\Collection; use Magento\CloudComponents\Model\UrlFinderInterface as CloudUrlFinderInterface; @@ -43,6 +44,11 @@ class Product implements CloudUrlFinderInterface */ private $productCollectionFactory; + /** + * @var ProductVisibility + */ + private $productVisibility; + /** * @var integer */ @@ -51,6 +57,7 @@ class Product implements CloudUrlFinderInterface /** * @param UrlFixer $urlFixer * @param CollectionFactory $productCollectionFactory + * @param ProductVisibility $productVisibility * @param StoreInterface[] $stores * @param array $productSku * @param int $productLimit @@ -58,12 +65,14 @@ class Product implements CloudUrlFinderInterface public function __construct( UrlFixer $urlFixer, CollectionFactory $productCollectionFactory, + ProductVisibility $productVisibility, array $stores, array $productSku = [], int $productLimit = self::PRODUCT_LIMIT ) { $this->urlFixer = $urlFixer; $this->productCollectionFactory = $productCollectionFactory; + $this->productVisibility = $productVisibility; $this->stores = $stores; $this->productSku = $productSku; $this->productLimit = $productLimit; @@ -100,6 +109,7 @@ private function getProducts($storeId): Collection /** @var Collection $collection */ $collection = $this->productCollectionFactory->create(); $collection->addStoreFilter($storeId); + $collection->setVisibility($this->productVisibility->getVisibleInSiteIds()); if (count($this->productSku)) { $collection->addAttributeToFilter('sku', $this->productSku); From 1b96b9c5ec78563b09f2a2ab1f23a9ed907fb7d9 Mon Sep 17 00:00:00 2001 From: Michael Casey <12436335+michaelcasey316@users.noreply.github.com> Date: Wed, 7 Sep 2022 16:53:59 -0500 Subject: [PATCH 2/2] MCLOUD-9275: Cloud Tools Release (#21) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 16be818..f294f5c 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-components", "description": "Cloud Components Module for Magento 2.x", "type": "magento2-module", - "version": "1.0.11", + "version": "1.0.12", "require": { "php": "^7.2 || ^8.0", "ext-json": "*",