Pipelines Customisation
Making customisations to existing Klevu pipelines.
Before adding attributes to your pipeline YAML, please ensure they have been registered with Klevu.
Note: any customisations made via these methods will override the auto-generated pipeline configuration files found in var/klevu/indexing/pipeline
During development, it may be useful to edit (in a non-production environment) these auto-generated YAML files to test out customisations before copying the YAML to a custom override file.
These files will be regenerated and can be deleted once the customisation override has been created.
Note: All these examples could be combined into one pipelineConfigurationOverrideFilepaths file.
They have been split into multiple files, as we do in the modules, to make them easier to read.
Add meta_description and meta_title to the default (simple, virtual, downloadable product types) product data during the Add action.
First, in your module add or update etc/di.xml. Add a virtual type for Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Add and pass in an array of pipelineConfigurationOverrideFilepaths
If the same changes are required during an Update (almost always the case) then we’d also make the same change to Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Update
Create the YAML file.
And add the 2 referenced file (this code could also be added to the above YAML, but it is more readable when split into multiple files)
Add color and size to configurable variant product data during the sync action.
First, in your module add or update etc/di.xml. Add a virtual type Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Add and pass in an array of pipelineConfigurationOverrideFilepaths
If the same changes are required during an Update then we’d also make this change to Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Update
Create the YAML file.
And add the 2 referenced file (this code could also be added to the above YAML, but it is more readable when split into multiple files)
This works the same as adding a new pipeline stage. In this example, we will append extra data to the description.
First, in your module add or update etc/di.xml. Add a virtual type Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Add and pass in an array of pipelineConfigurationOverrideFilepaths
If the same changes are required during an Update then we’d also make this change to Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Update
Create the YAML file.
Append the product name and sku to the end of the description
In this example, we will remove the rating and rating count from any configurable variant so indexing falls back to using the parent values
First, in your module add or update etc/di.xml. Add a virtual type Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Add and pass in an array of pipelineConfigurationOverrideFilepaths
If the same changes are required during an Update then we’d also make this change to Klevu\IndexingProducts\Service\Provider\PipelineConfigurationOverridesFilepathsProvider\Update
Create the injected customisation YAML file
An example module with YAML files for common attributes that could be useful. Contains examples of how to:
- change data synced for existing attributes
- add stages to pipelines
- add different attributes for different products types.
- add new product types
- remove attributes
- remove attributes from data if some condition is met (in this case if the value is null)
List of attribute YAML files present in the module
- color
- gender
- manufacturer
- meta_description
- meta_keywords
- meta_title
- new
- sale
- size
- weight
This is not a production ready module and is intended as an example only.
Do not install this module in a production environment.