diff --git a/Plugin/RemoveCategoriesFromProductUrlRewriteGeneration.php b/Plugin/RemoveCategoriesFromProductUrlRewriteGeneration.php index 8a3e83a..2cb6ebf 100644 --- a/Plugin/RemoveCategoriesFromProductUrlRewriteGeneration.php +++ b/Plugin/RemoveCategoriesFromProductUrlRewriteGeneration.php @@ -41,6 +41,7 @@ public function beforeGenerateForSpecificStoreView( $rootCategoryId = null ): array { if (!$this->config->generateCategoryUrlsForProductRewrites($storeId)) { + // Unset product categories to stop needless category path rewrites being created $productCategories = []; } return [$storeId, $productCategories, $product, $rootCategoryId];