From cc002695b932fddf8ffa7da315a77e95084ea742 Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Mon, 30 Sep 2024 11:59:31 +0200 Subject: [PATCH 1/5] Update upgrade-the-price-module.md fix layout --- .../upgrade-the-price-module.md | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md index fbf4aa5155f..2ee845fd0f6 100644 --- a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md +++ b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md @@ -36,23 +36,26 @@ Due to this change of the Price module responsibility, all related modules have If you have overwritten any of the classes from the `Price` module, you have to change namespace part with `Price` to `PriceProduct`, for example if you used `PriceFacade`, now should use `PriceProductFacade`. Same for `Factories`, `QueryContainer`, `DependencyProvider`. Check that all `Price` plugins registered in `ProductDependencyProvider` have been moved to `PriceProduct` namespace. - `use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin;` - `use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin;` - `use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin;` - `use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin;` - `use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin;` - `use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin;` - +```php + use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin; + use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin; + use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin; + use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin; + use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin; + use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin; +``` Should be renamed to: - `use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin;` - `use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin;` - `use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin;` - `use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin;` - `use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin;` - `use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin;` +```php + use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin; + use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin; + use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin; + use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin; + use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin; + use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin; +``` -2. Update `StorageProductMapper` with the new price resolving logic +3. Update `StorageProductMapper` with the new price resolving logic ```php namespace Pyz\Yves\Product\Mapper; From 7e7461803d3669fe517abfea3574cb857c1a7ebe Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Mon, 30 Sep 2024 17:35:46 +0300 Subject: [PATCH 2/5] Update edit-marketplace-concrete-products.md --- .../concrete-products/edit-marketplace-concrete-products.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pbc/all/product-information-management/202404.0/marketplace/manage-in-the-merchant-portal/concrete-products/edit-marketplace-concrete-products.md b/docs/pbc/all/product-information-management/202404.0/marketplace/manage-in-the-merchant-portal/concrete-products/edit-marketplace-concrete-products.md index 78b6a9a9625..d63207b4e16 100644 --- a/docs/pbc/all/product-information-management/202404.0/marketplace/manage-in-the-merchant-portal/concrete-products/edit-marketplace-concrete-products.md +++ b/docs/pbc/all/product-information-management/202404.0/marketplace/manage-in-the-merchant-portal/concrete-products/edit-marketplace-concrete-products.md @@ -4,7 +4,7 @@ last_updated: Sep 24, 2024 description: Learn how to edit concrete products in the Merchant Portal. template: back-office-user-guide-template redirect_from: - - /docs/pbc/all/product-information-management/202404.0/marketplace/manage-in-the-merchant-portal/concrete-products/edit-marketplace-concrete-products.html + - /docs/pbc/all/product-information-management/202404.0/marketplace/manage-in-the-merchant-portal/concrete-products/managing-marketplace-concrete-products.html related: - title: Marketplace Product feature overview link: docs/pbc/all/product-information-management/page.version/marketplace/marketplace-product-feature-overview.html From b3d74d5972a105d42f67d392aa8d33d8fc9ba7bc Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Mon, 30 Sep 2024 17:37:01 +0300 Subject: [PATCH 3/5] Update upgrade-the-price-module.md --- _includes/pbc/all/upgrade-modules/upgrade-the-price-module.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md index 2ee845fd0f6..c103a1e2bd9 100644 --- a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md +++ b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md @@ -55,7 +55,7 @@ Due to this change of the Price module responsibility, all related modules have use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin; ``` -3. Update `StorageProductMapper` with the new price resolving logic +3. Update `StorageProductMapper` with the new price resolving logic: ```php namespace Pyz\Yves\Product\Mapper; From 3995ee464b030edfcfe2ef7ad361b94a5241c73d Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Wed, 22 Jan 2025 17:18:30 +0800 Subject: [PATCH 4/5] Update upgrade-the-price-module.md --- .../pbc/all/upgrade-modules/upgrade-the-price-module.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md index 108373d5157..042269f3d32 100644 --- a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md +++ b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md @@ -2,11 +2,11 @@ ## Upgrading from version 4.* to version 5.* -From version 5 we have changed price module responsibilities: previously it was responsible for handling product price related functionality. This responsibility has now been moved to the new PriceProduct module which handles product prices, while Price module is responsible for generic spryker core related functionality. +From version 5 we have changed price module responsibilities: previously it was responsible for handling product price related functionality. This responsibility has now been moved to the new PriceProduct module which handles product prices, while the Price module handles generic Spryker core related functionality. -Because of this change of the Price module responsibility, all related modules have also be updated to work with the `PriceProduct` module. +Because of the changes in the Price module, all related modules have to be updated to work with the `PriceProduct` module. -1. First you have to install the new `PriceProduct` module. +1. First you have to install the `PriceProduct` module. * run `composer require spryker/price-product`. * run SQL queries to create a new table and alter the existing one. From 1cb748080b6cbcccf9019b6912f59496d5102f8a Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Thu, 23 Jan 2025 11:45:55 +0800 Subject: [PATCH 5/5] Update upgrade-the-price-module.md --- .../upgrade-the-price-module.md | 98 +++++++++++-------- 1 file changed, 56 insertions(+), 42 deletions(-) diff --git a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md index 108373d5157..40ed7b9d243 100644 --- a/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md +++ b/_includes/pbc/all/upgrade-modules/upgrade-the-price-module.md @@ -2,60 +2,74 @@ ## Upgrading from version 4.* to version 5.* -From version 5 we have changed price module responsibilities: previously it was responsible for handling product price related functionality. This responsibility has now been moved to the new PriceProduct module which handles product prices, while Price module is responsible for generic spryker core related functionality. +In this version, we've shifted the handling of product price related functionality from Price to the new PriceProduct module. The Price module is now responsible for generic Spryker core related functionality. -Because of this change of the Price module responsibility, all related modules have also be updated to work with the `PriceProduct` module. +Update all related modules to to work with the `PriceProduct` module: -1. First you have to install the new `PriceProduct` module. +1. Install the `PriceProduct` module: +```bash +composer require spryker/price-product +``` + +2. Create a new table and update the existing one: + +```sql +CREATE SEQUENCE "spy_price_product_store_pk_seq"; + +CREATE TABLE "spy_price_product_store" +( + "id_price_product_store" INTEGER NOT NULL, + "fk_price_product" INTEGER NOT NULL, + "fk_currency" INTEGER NOT NULL, + "fk_store" INTEGER, + "net_price" INTEGER, + "gross_price" INTEGER, + PRIMARY KEY ("id_price_product_store"), + CONSTRAINT "spy_price_product_store-unique-price_product" UNIQUE ("fk_currency","fk_price_product","fk_store") +); + +ALTER TABLE "spy_price_type" +ADD "price_mode_configuration" INT2; +``` - * run `composer require spryker/price-product`. - * run SQL queries to create a new table and alter the existing one. +`spy_price_product_store` is the table for price per store / currency. `price_mode_configuration` field is added to indicate to which mode price type assigned GROSS, NET, BOTH. - ```sql - CREATE SEQUENCE "spy_price_product_store_pk_seq"; +3. Build propel models +```bash +vendor/bin/console propel:model:build +``` - CREATE TABLE "spy_price_product_store" - ( - "id_price_product_store" INTEGER NOT NULL, - "fk_price_product" INTEGER NOT NULL, - "fk_currency" INTEGER NOT NULL, - "fk_store" INTEGER, - "net_price" INTEGER, - "gross_price" INTEGER, - PRIMARY KEY ("id_price_product_store"), - CONSTRAINT "spy_price_product_store-unique-price_product" UNIQUE ("fk_currency","fk_price_product","fk_store") - ); +4. Generate new transfer objects +```bash +vendor/bin/console transfer:generate +``` - ALTER TABLE "spy_price_type" - ADD "price_mode_configuration" INT2; - ``` +5. If you overwrote any of the classes from the `Price` module, change the namespace part with `Price` to `PriceProduct`. For example, `PriceFacade` should be renamed to `PriceProductFacade`. Same for `Factories`, `QueryContainer`, `DependencyProvider`. - `spy_price_product_store` is the table for price per store / currency. `price_mode_configuration` field is added to indicate to which mode price type assigned GROSS, NET, BOTH. - * Build propel models `vendor/bin/console propel:model:build`. - * Generate new transfer objects `vendor/bin/console transfer:generate`. +6. Check that all `Price` plugins registered in `ProductDependencyProvider` have been moved to the `PriceProduct` namespace: - If you have overwritten any of the classes from the `Price` module, you have to change namespace part with `Price` to `PriceProduct`, for example if you used `PriceFacade`, now should use `PriceProductFacade`. Same for `Factories`, `QueryContainer`, `DependencyProvider`. - Check that all `Price` plugins registered in `ProductDependencyProvider` have been moved to `PriceProduct` namespace. +Original: ```php - use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin; - use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin; - use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin; - use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin; - use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin; - use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin; +use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin; +use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin; +use Spryker\Zed\Price\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin; +use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin; +use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin; +use Spryker\Zed\Price\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin; ``` - Should be renamed to: +Expected: ```php - use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin; - use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin; - use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin; - use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin; - use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin; - use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin; +use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterCreatePlugin; +use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractAfterUpdatePlugin; +use Spryker\Zed\PriceProduct\Communication\Plugin\ProductAbstract\PriceProductAbstractReadPlugin; +use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterCreatePlugin; +use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteAfterUpdatePlugin; +use Spryker\Zed\PriceProduct\Communication\Plugin\ProductConcrete\PriceProductConcreteReadPlugin; ``` -3. Update `StorageProductMapper` with the new price resolving logic: + +7. Update `StorageProductMapper` with the new price resolving logic: ```php namespace Pyz\Yves\Product\Mapper; @@ -100,7 +114,7 @@ class StorageProductMapper implements StorageProductMapperInterface } ``` -3. Inject `PriceProduct` client dependency and pass it to mapper class. +7. Inject the `PriceProduct` client dependency and pass it to a mapper class. ```php namespace Pyz\Yves\Product; @@ -152,7 +166,7 @@ class ProductFactory extends AbstractFactory } ``` -4. Collectors have changed the way price is collected. Change `ProductAbstractCollector` and `ProductConcreteCollector` to reflect that. Both are now using `PriceProductFacade` instead of `PriceFacade`. +8. Update `ProductAbstractCollector` and `ProductConcreteCollector` to use `PriceProductFacade` instead of `PriceFacade`. ```php namespace Pyz\Zed\Collector\Business\Storage;