Upgrade the ProductLabelSearch module
Edit on GitHubUpgrading from version 1.* to version 2.*
Version 2.* of the ProductLabelSearch
module changes the storage data structure to maintain relations of product labels to stores.
Estimated migration time: 1 hour.
To upgrade to the new version of the module, do the following:
- Upgrade the
ProductLabelSearch
module to the new version:
composer require spryker/product-label-search:"^2.0.0" --update-with-dependencies
- Update the generated classes:
console transfer:generate
- Remove the deprecated plugins from
Pyz\Zed\Event\EventDependencyProvider
:
Spryker\Zed\ProductLabelSearch\Communication\Plugin\Event\Subscriber\ProductLabelSearchEventSubscriber
- Add the new plugins to
Pyz\Zed\Publisher\PublisherDependencyProvider
:
<?php
namespace Pyz\Zed\Publisher;
...
use Spryker\Zed\ProductLabelSearch\Communication\Plugin\Publisher\ProductLabel\ProductLabelWritePublisherPlugin as ProductLabelSearchWritePublisherPlugin;
use Spryker\Zed\ProductLabelSearch\Communication\Plugin\Publisher\ProductLabelProductAbstract\ProductLabelProductAbstractWritePublisherPlugin as ProductLabelProductAbstractSearchWritePublisherPlugin;
use Spryker\Zed\ProductLabelSearch\Communication\Plugin\Publisher\ProductLabelStore\ProductLabelStoreWritePublisherPlugin as ProductLabelStoreSearchWritePublisherPlugin;
...
use Spryker\Zed\Publisher\PublisherDependencyProvider as SprykerPublisherDependencyProvider;
class PublisherDependencyProvider extends SprykerPublisherDependencyProvider
{
/**
* @return \Spryker\Zed\PublisherExtension\Dependency\Plugin\PublisherPluginInterface[]
*/
protected function getPublisherPlugins(): array
{
return array_merge(
$this->getProductLabelSearchPlugins(),
);
}
/**
* @return \Spryker\Zed\PublisherExtension\Dependency\Plugin\PublisherPluginInterface[]
*/
protected function getProductLabelSearchPlugins(): array
{
return [
new ProductLabelSearchWritePublisherPlugin(),
new ProductLabelProductAbstractSearchWritePublisherPlugin(),
new ProductLabelStoreSearchWritePublisherPlugin(),
];
}
}
Upgrading from version 1.2.* to version 1.3.*
Prerequisites
This migration guide is a part of the Search migration effort. Prior to upgrading this module, make sure you have completed all the steps from the Search Migration Guide.
To upgrade to the new version of the module, do the following:
- Update the module using Composer:
composer update spryker/product-label-search
- Remove the usage of the deprecated
Spryker\Zed\ProductLabelSearch\Communication\Plugin\PageMapExpander\ProductLabelMapExpanderPlugin
fromPyz\Zed\ProductPageSearch\ProductPageSearchDependencyProvider
. - Enable the replacement plugin:
<?php
namespace Pyz\Zed\ProductPageSearch;
...
use Spryker\Zed\ProductLabelSearch\Communication\Plugin\ProductPageSearch\Elasticsearch\ProductLabelMapExpanderPlugin;
use Spryker\Zed\ProductPageSearch\ProductPageSearchDependencyProvider as SprykerProductPageSearchDependencyProvider;
class ProductPageSearchDependencyProvider extends SprykerProductPageSearchDependencyProvider
{
...
/**
* @return \Spryker\Zed\ProductPageSearchExtension\Dependency\Plugin\ProductAbstractMapExpanderPluginInterface[]
*/
protected function getProductAbstractMapExpanderPlugins(): array
{
return [
...
new ProductLabelMapExpanderPlugin(),
];
}
}
Thank you!
For submitting the form