2.5 KiB
⚙️ Upgrade from Sylius 1.12 with PriceHistoryPlugin to Sylius 1.13
We encourage you to use the upgrade instructions based on Rector as it is more convenient and faster to accomplish. The legacy installation guide is available here.
Upgrade with Rector
-
Remove the PriceHistoryPlugin from composer.json by running:
composer remove sylius/price-history-plugin --no-scripts -
Update your
<project_root>/rector.phpfile:+ use Sylius\SyliusRector\Set\SyliusPriceHistory; return static function (RectorConfig $rectorConfig): void { // ... - $rectorConfig->sets([SyliusPriceHistory::PRICE_HISTORY_PLUGIN]) + $rectorConfig->sets([SyliusPriceHistory::UPGRADE_SYLIUS_1_12_WITH_PRICE_HISTORY_PLUGIN_TO_SYLIUS_1_13]); }; -
Run:
vendor/bin/rector -
Make sure to remove the following config from your
config/packages/sylius_price_history_plugin.yamlfile:- - { resource: "@SyliusPriceHistoryPlugin/config/config.yaml" }And also the route from your
config/routes/sylius_price_history_plugin.yaml:- sylius_price_history_admin: - resource: '@SyliusPriceHistoryPlugin/config/admin_routing.yaml' - prefix: '/%sylius_admin.path_name%' -
Update your resources configuration for
ChannelPricingLogEntryandChannelPriceHistoryConfigif you have changed them in your project:- sylius_price_history: - batch_size: 100 + sylius_core: + price_history: + batch_size: 100 resources: channel_price_history_config: classes: model: App\Entity\ChannelPriceHistoryConfig ... channel_pricing_log_entry: classes: model: App\Entity\ChannelPricingLogEntry ... -
The
Sylius\PriceHistoryPlugin\Application\Calculator\ProductVariantLowestPriceCalculatorclass along with its interface has been removed. If you have used it in your project, you should also remove it from your code.Use
Sylius\Component\Core\Calculator\ProductVariantPriceCalculatorinstead, as it has been extended with thecalculateLowestPricemethod. -
Go through the rest of the Sylius 1.13 upgrade file.