From 25eb7baedc5d4be5eb0abf54c2489e75ae875adf Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 19 Jun 2024 10:57:01 +0200 Subject: [PATCH] feat: add style unique field (#6) --- README.md | 3 -- .../ProductPageSearchExpanderConstants.php | 2 + .../StyleUniqueMapExpanderPlugin.php | 42 +++++++++++++++++++ .../StyleUniqueDataExpanderPlugin.php | 40 ++++++++++++++++++ 4 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductAbstractMap/StyleUniqueMapExpanderPlugin.php create mode 100644 src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductPageData/StyleUniqueDataExpanderPlugin.php diff --git a/README.md b/README.md index fe42fca..69fbfab 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # spryker-product-page-search-expander -[![PHP from Travis config](https://img.shields.io/travis/php-v/symfony/symfony.svg)](https://php.net/) -[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://packagist.org/packages/fond-of-spryker/product-page-search-expander) - ## Installation ``` diff --git a/src/FondOfSpryker/Shared/ProductPageSearchExpander/ProductPageSearchExpanderConstants.php b/src/FondOfSpryker/Shared/ProductPageSearchExpander/ProductPageSearchExpanderConstants.php index c53632c..4e6b699 100644 --- a/src/FondOfSpryker/Shared/ProductPageSearchExpander/ProductPageSearchExpanderConstants.php +++ b/src/FondOfSpryker/Shared/ProductPageSearchExpander/ProductPageSearchExpanderConstants.php @@ -14,6 +14,8 @@ interface ProductPageSearchExpanderConstants public const SIZE = 'size'; + public const STYLE_UNIQUE = 'style_unique'; + public const STYLE_KEY = 'style_key'; public const AVAILABLE = 'available'; diff --git a/src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductAbstractMap/StyleUniqueMapExpanderPlugin.php b/src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductAbstractMap/StyleUniqueMapExpanderPlugin.php new file mode 100644 index 0000000..3c4953f --- /dev/null +++ b/src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductAbstractMap/StyleUniqueMapExpanderPlugin.php @@ -0,0 +1,42 @@ +setStyleKey($productData[ProductPageSearchExpanderConstants::STYLE_UNIQUE]); + } + + return $pageMapTransfer; + } +} diff --git a/src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductPageData/StyleUniqueDataExpanderPlugin.php b/src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductPageData/StyleUniqueDataExpanderPlugin.php new file mode 100644 index 0000000..51307ad --- /dev/null +++ b/src/FondOfSpryker/Zed/ProductPageSearchExpander/Communication/Plugin/ProductPageSearch/Elasticsearch/ProductPageData/StyleUniqueDataExpanderPlugin.php @@ -0,0 +1,40 @@ +setStyleKey($productAttributes[ProductPageSearchExpanderConstants::STYLE_UNIQUE]); + } + } +}