From 698629d7b2b8f9e20f2c3ccd0d9c27d7b5e369e6 Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Tue, 1 Aug 2023 18:20:42 +0300 Subject: [PATCH 1/6] CC-29675 Adjust documentation according to code changes --- ...management-inventory-management-feature.md | 8 +- ...l-the-order-management-shipment-feature.md | 109 ++++++++++++++++++ .../202400.0/install-the-shipment-feature.md | 62 +++++++++- ...l-the-order-management-shipment-feature.md | 8 ++ 4 files changed, 181 insertions(+), 6 deletions(-) create mode 100644 _includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md create mode 100644 docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md diff --git a/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md index 764b35a0451..b314363e08d 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md @@ -1,7 +1,7 @@ -This document describes how to ingrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Inventory Management](/docs/pbc/all/warehouse-management-system/{{page.version}}/base-shop/inventory-management-feature-overview.html) feature into a Spryker project. +This document describes how to integrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Inventory Management](/docs/pbc/all/warehouse-management-system/{{page.version}}/base-shop/inventory-management-feature-overview.html) feature into a Spryker project. {% info_block errorBox %} @@ -22,9 +22,9 @@ Follow the steps below to install the Order Management + Inventory Management fe To start feature integration, integrate the required features: -| NAME | VERSION | INTEGRATION GUIDE | -|--------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------| -| Order Management | {{page.version}} | [Order Management feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/order-management-feature-integration.html) +| NAME | VERSION | INTEGRATION GUIDE | +|----------------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------| +| Order Management | {{page.version}} | [Order Management feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/order-management-feature-integration.html) | | Inventory Management | {{page.version}} | [Inventory Management feature integration](docs/scos/dev/feature-integration-guides/{{page.version}}/install-the-inventory-management-feature.md) | diff --git a/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md new file mode 100644 index 00000000000..1bad068f1cd --- /dev/null +++ b/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md @@ -0,0 +1,109 @@ + + +This document describes how to integrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Shipment](/docs/pbc/all/carrier-management/{{page.version}}/base-shop/shipment-feature-overview.html) feature into a Spryker project. + +{% info_block errorBox %} + +The following features integration guide expects the basic feature to be in place. + +The current feature integration guide adds the following functionality: + +* [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) +* [Shipment](/docs/pbc/all/carrier-management/{{page.version}}/base-shop/shipment-feature-overview.html) + +{% endinfo_block %} + +## Install feature core + +Follow the steps below to install the Order Management + Shipment feature. + +### Prerequisites + +To start feature integration, integrate the required features: + +| NAME | VERSION | INTEGRATION GUIDE | +|------------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Order Management | {{page.version}} | [Order Management feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/order-management-feature-integration.html) | +| Shipment | {{page.version}} | [Shipment feature integration](/docs/pbc/all/carrier-management/{{page.version}}/unified-commerce/enhanced-click-and-collect/install-and-upgrade/install-the-shipment-feature.html) | + + +## 1) Install the required modules using Composer + +```bash +composer require spryker/sales-shipment-type:"^0.1.0" --update-with-dependencies +``` + +{% info_block warningBox "Verification" %} + +Make sure that the following module has been installed: + +| MODULE | EXPECTED DIRECTORY | +|--------------------|------------------------------------| +| SalesShipmentType | vendor/spryker/sales-shipment-type | + +{% endinfo_block %} + +### 2) Set up database schema and transfer objects + +Apply the database changes and generate entity and transfer changes: + +```bash +console propel:install +console transfer:generate +``` + +{% info_block warningBox "Verification" %} + +Make sure that the following changes have been applied by checking your database: + +| DATABASE ENTITY | TYPE | EVENT | +|-------------------------------------|--------|---------| +| spy_sales_shipment_type | table | created | +| spy_sales_shipment.fk_shipment_type | column | created | + +Make sure that the following changes have been triggered in transfer objects: + +| TRANSFER | TYPE | EVENT | PATH | +|-------------------|-------|---------|---------------------------------------------------------| +| SalesShipmentType | class | created | src/Generated/Shared/Transfer/SalesShipmentTypeTransfer | + +{% endinfo_block %} + +### 3) Set up behavior + +Enable the following plugins. + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------| +| ShipmentTypeOrderItemsPostSavePlugin | Persists shipment type data to `spy_sales_shipment_type` table and updates `spy_sales_shipment` with `fk_shipment_type`. | | Spryker\Zed\SalesShipmentType\Communication\Plugin\Sales | + + +**src/Pyz/Zed/Sales/SalesDependencyProvider.php** + +```php + + */ + protected function getOrderItemsPostSavePlugins(): array + { + return [ + new ShipmentTypeOrderItemsPostSavePlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +Make sure that when you place an order selected shipment type is persisted to `spy_sales_shipment_type` and `spy_sales_shipment.fk_sales_shipment_type` is updated. + +{% endinfo_block %} diff --git a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md index 58bd000313f..e1e11ab85aa 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md @@ -979,7 +979,40 @@ Make sure that during checkout on the Shipment step, you can only see shipment m {% endinfo_block %} -6. To enable the Backend API, register these plugins: +6. Configure shipment type validation plugin: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|----------------------------------------|-------------------------------------------------------------------------------------------------------------|---------------|---------------------------------------------------------------------------------------------------| +| ShipmentTypeCheckoutPreConditionPlugin | Validates if selected shipment type have relation to selected shipment method, current store and is active. | | Spryker\Zed\ShipmentTypeCart\Communication\Plugin\Checkout\ShipmentTypeCheckoutPreConditionPlugin | + +**src/Pyz/Zed/Checkout/CheckoutDependencyProvider.php** + +```php + + */ + protected function getCheckoutPreConditions(Container $container): array + { + return [ + new ShipmentTypeCheckoutPreConditionPlugin(), + ]; + } +} +``` + +7. To enable the Backend API, register these plugins: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |------------------------------------|------------------------------------------|---------------|-----------------------------------------------------------------------| @@ -1076,7 +1109,32 @@ Ensure that the following modules have been installed: {% endinfo_block %} -### 2) Set up Behavior +### 2) Add translations + +Add translations as follows: + +1. Append glossary according to your configuration: + +**src/data/import/glossary.csv** + +```csv +shipment_type.checkout.validation.error,Selected delivery type "%name%" is not available,en_US +shipment_type.checkout.validation.error,Die ausgewählte Lieferart "%name%" ist nicht verfügbar,de_DE +``` + +2. Import data: + +```bash +console data:import glossary +``` + +{% info_block warningBox "Verification" %} + +Make sure that in the database the configured data has been added to the `spy_glossary` table. + +{% endinfo_block %} + +### 3) Set up Behavior Enable the following behaviors by registering the plugins: diff --git a/docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md b/docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md new file mode 100644 index 00000000000..5732863ea45 --- /dev/null +++ b/docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md @@ -0,0 +1,8 @@ +--- +title: Install the Order Management + Shipment feature +description: Learn how to integrate the Order Management + Shipment feature in your project +last_updated: Aug 1, 2023 +template: feature-integration-guide-template +--- + +{% include pbc/all/install-features/202204.0/install-the-order-management-shipment-feature.md %} From cce9b4f458c53facd5e41923a9eca98ed0aa323d Mon Sep 17 00:00:00 2001 From: AlexSlawinski Date: Fri, 4 Aug 2023 09:56:51 +0200 Subject: [PATCH 2/6] Apply suggestions from code review --- ...he-order-management-inventory-management-feature.md | 2 +- .../install-the-order-management-shipment-feature.md | 10 +++++----- .../202400.0/install-the-shipment-feature.md | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md index b314363e08d..3e1824cf26b 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-order-management-inventory-management-feature.md @@ -1,7 +1,7 @@ -This document describes how to integrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Inventory Management](/docs/pbc/all/warehouse-management-system/{{page.version}}/base-shop/inventory-management-feature-overview.html) feature into a Spryker project. +This document describes how to integrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Inventory Management](/docs/pbc/all/warehouse-management-system/{{page.version}}/base-shop/inventory-management-feature-overview.html) features into a Spryker project. {% info_block errorBox %} diff --git a/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md index 1bad068f1cd..454ba0c380d 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md @@ -1,12 +1,12 @@ -This document describes how to integrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Shipment](/docs/pbc/all/carrier-management/{{page.version}}/base-shop/shipment-feature-overview.html) feature into a Spryker project. +This document describes how to integrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Shipment](/docs/pbc/all/carrier-management/{{page.version}}/base-shop/shipment-feature-overview.html) features into a Spryker project. {% info_block errorBox %} The following features integration guide expects the basic feature to be in place. -The current feature integration guide adds the following functionality: +The feature integration guide adds the following functionality: * [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) * [Shipment](/docs/pbc/all/carrier-management/{{page.version}}/base-shop/shipment-feature-overview.html) @@ -43,7 +43,7 @@ Make sure that the following module has been installed: {% endinfo_block %} -### 2) Set up database schema and transfer objects +### 2) Set up the database schema and transfer objects Apply the database changes and generate entity and transfer changes: @@ -71,7 +71,7 @@ Make sure that the following changes have been triggered in transfer objects: ### 3) Set up behavior -Enable the following plugins. +Enable the following plugins: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |--------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------| @@ -104,6 +104,6 @@ class SalesDependencyProvider extends SprykerSalesDependencyProvider {% info_block warningBox "Verification" %} -Make sure that when you place an order selected shipment type is persisted to `spy_sales_shipment_type` and `spy_sales_shipment.fk_sales_shipment_type` is updated. +Make sure that when you place an order, the selected shipment type is persisted to `spy_sales_shipment_type` and `spy_sales_shipment.fk_sales_shipment_type` is updated. {% endinfo_block %} diff --git a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md index e1e11ab85aa..f3f2594635f 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md @@ -979,7 +979,7 @@ Make sure that during checkout on the Shipment step, you can only see shipment m {% endinfo_block %} -6. Configure shipment type validation plugin: +6. Configure the shipment type validation plugin: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |----------------------------------------|-------------------------------------------------------------------------------------------------------------|---------------|---------------------------------------------------------------------------------------------------| @@ -1130,7 +1130,7 @@ console data:import glossary {% info_block warningBox "Verification" %} -Make sure that in the database the configured data has been added to the `spy_glossary` table. +Make sure that the configured data has been added to the `spy_glossary` table in the database. {% endinfo_block %} From a61dcc9a9bbeede0a29711b71e399ed59d8d43bb Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Fri, 4 Aug 2023 18:02:59 +0300 Subject: [PATCH 3/6] CC-29675 Fixes after tech review --- .../install-the-shipment-cart-feature.md | 193 ++++++++++++++++++ .../202400.0/install-the-shipment-feature.md | 63 +----- 2 files changed, 195 insertions(+), 61 deletions(-) create mode 100644 _includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md diff --git a/_includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md new file mode 100644 index 00000000000..00500fc6d7f --- /dev/null +++ b/_includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md @@ -0,0 +1,193 @@ + + +## Install feature core + +### Prerequisites + +To start feature integration, overview, and install the necessary features: + +| NAME | VERSION | +|--------------|------------------| +| Shipment | {{page.version}} | +| Cart | {{page.version}} | +| Prices | {{page.version}} | + +### 1) Install the required modules using Composer + +Run the following command(s) to install the required modules: + +```bash +composer require spryker/shipment-cart-connector: "^2.1.0" spryker/shipment-type-cart: "^0.1.0" --update-with-dependencies +``` +{% info_block warningBox "Verification" %} + +Make sure that the following modules have been installed: + +| MODULE | EXPECTED DIRECTORY | +|-----------------------|----------------------------------------| +| ShipmentCartConnector | vendor/spryker/shipment-cart-connector | +| ShipmentTypeCart | vendor/spryker/shipment-type-cart | + +{% endinfo_block %} + +### 2) Set up transfer objects + +Run the following command(s) to apply transfer changes: + +```bash +console transfer:generate +``` +{% info_block warningBox "Verification" %} + +Make sure that the following changes have been applied in transfer objects: + +| TRANSFER | TYPE | EVENT | PATH | +|---------------------------|-------|---------|-----------------------------------------------------------------| +| ShipmentMethods | class | Created | src/Generated/Shared/Transfer/ShipmentMethodsTransfer | +| ShipmentMethod | class | Created | src/Generated/Shared/Transfer/ShipmentMethodTransfer | +| Order | class | Created | src/Generated/Shared/Transfer/OrderTransfer | +| Quote | class | Created | src/Generated/Shared/Transfer/QuoteTransfer | +| Item | class | Created | src/Generated/Shared/Transfer/ItemTransfer | +| Expense | class | Created | src/Generated/Shared/Transfer/ExpenseTransfer | +| MoneyValue | class | Created | src/Generated/Shared/Transfer/MoneyValueTransfer | +| Money | class | Created | src/Generated/Shared/Transfer/MoneyTransfer | +| CartPreCheckResponse | class | Created | src/Generated/Shared/Transfer/CartPreCheckResponseTransfer | +| Message | class | Created | src/Generated/Shared/Transfer/MessageTransfer | +| CartChange | class | Created | src/Generated/Shared/Transfer/CartChangeTransfer | +| Currency | class | Created | src/Generated/Shared/Transfer/CurrencyTransfer | +| ShipmentGroup | class | Created | src/Generated/Shared/Transfer/ShipmentGroupTransfer | +| Shipment | class | Created | src/Generated/Shared/Transfer/ShipmentTransfer` | +| ShipmentMethodsCollection | class | Created | src/Generated/Shared/Transfer/ShipmentMethodsCollectionTransfer | +| ShipmentType | class | Created | src/Generated/Shared/Transfer/ShipmentTypeTransfer | +| ShipmentTypeCollection | class | Created | src/Generated/Shared/Transfer/ShipmentTypeCollectionTransfer | +| ShipmentTypeConditions | class | Created | src/Generated/Shared/Transfer/ShipmentTypeConditionsTransfer | +| ShipmentTypeCriteria | class | Created | src/Generated/Shared/Transfer/ShipmentTypeCriteriaTransfer | +| CheckoutResponse | class | Created | src/Generated/Shared/Transfer/CheckoutResponseTransfer | +| CheckoutError | class | Created | src/Generated/Shared/Transfer/CheckoutErrorTransfer | +| Store | class | Created | src/Generated/Shared/Transfer/StoreTransfer | + +{% endinfo_block %} + +### 3) Set up behavior + +Register the following plugins: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|-----------------------------------------|-------------------------------------------------------------------------------------------------------------|----------------------------------------------|---------------------------------------------------------------------------------------------------| +| CartShipmentCartOperationPostSavePlugin | Recalculates the shipment expenses. | Replacement for `CartShipmentExpanderPlugin` | Spryker\Zed\ShipmentCartConnector\Communication\Plugin\Cart | +| CartShipmentPreCheckPlugin | Validates if current shipment method is still valid in cart shipments. | | Spryker\Zed\ShipmentCartConnector\Communication\Plugin\Cart | +| SanitizeCartShipmentItemExpanderPlugin | Clears quote shipping data if a user modified quote items. | | Spryker\Zed\ShipmentCartConnector\Communication\Plugin\Cart | +| ShipmentTypeCheckoutPreConditionPlugin | Validates if selected shipment type have relation to selected shipment method, current store and is active. | | Spryker\Zed\ShipmentTypeCart\Communication\Plugin\Checkout\ShipmentTypeCheckoutPreConditionPlugin | + +**Pyz\Zed\Cart\CartDependencyProvider** + +```php + + */ + protected function getCheckoutPreConditions(Container $container): array + { + return [ + new ShipmentTypeCheckoutPreConditionPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +* Make sure that if you change items in the cart (add, remove or change quantity) then all the shipping methods are sanitized. +* Make sure that if you deactivate shipment type selected during the checkout, you will receive a validation error on checkout summary page. + +{% endinfo_block %} + + +## Install feature frontend + +Follow the steps below to install the feature frontend. + +### Prerequisites + +To start feature integration, integrate the required features: + +| NAME | VERSION | +|----------|------------------| +| Shipment | {{page.version}} | +| Cart | {{page.version}} | + +### 2) Add translations + +Add translations as follows: + +1. Append glossary according to your configuration: + +**src/data/import/glossary.csv** + +```csv +shipment_type_cart.checkout.validation.error,Selected delivery type "%name%" is not available,en_US +shipment_type_cart.checkout.validation.error,Die ausgewählte Lieferart "%name%" ist nicht verfügbar,de_DE +``` + +2. Import data: + +```bash +console data:import glossary +``` + +{% info_block warningBox "Verification" %} + +Make sure that the configured data has been added to the `spy_glossary` table in the database. + +{% endinfo_block %} \ No newline at end of file diff --git a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md index f3f2594635f..a1f513fdaf5 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md @@ -42,7 +42,6 @@ Make sure that the following modules have been installed: | ShipmentGui | vendor/spryker/shipment-gui | | Shipment | vendor/spryker/shipment | | ShipmentType | vendor/spryker/shipment-type | -| ShipmentTypeCart | vendor/spryker/shipment-type-cart | | ShipmentTypeDataImport | vendor/spryker/shipment-type-data-import | | ShipmentTypeStorage | vendor/spryker/shipment-type-storage | | ShipmentTypesBackendApi | vendor/spryker/shipment-types-backend-api | @@ -979,40 +978,7 @@ Make sure that during checkout on the Shipment step, you can only see shipment m {% endinfo_block %} -6. Configure the shipment type validation plugin: - -| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | -|----------------------------------------|-------------------------------------------------------------------------------------------------------------|---------------|---------------------------------------------------------------------------------------------------| -| ShipmentTypeCheckoutPreConditionPlugin | Validates if selected shipment type have relation to selected shipment method, current store and is active. | | Spryker\Zed\ShipmentTypeCart\Communication\Plugin\Checkout\ShipmentTypeCheckoutPreConditionPlugin | - -**src/Pyz/Zed/Checkout/CheckoutDependencyProvider.php** - -```php - - */ - protected function getCheckoutPreConditions(Container $container): array - { - return [ - new ShipmentTypeCheckoutPreConditionPlugin(), - ]; - } -} -``` - -7. To enable the Backend API, register these plugins: +6. To enable the Backend API, register these plugins: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |------------------------------------|------------------------------------------|---------------|-----------------------------------------------------------------------| @@ -1109,32 +1075,7 @@ Ensure that the following modules have been installed: {% endinfo_block %} -### 2) Add translations - -Add translations as follows: - -1. Append glossary according to your configuration: - -**src/data/import/glossary.csv** - -```csv -shipment_type.checkout.validation.error,Selected delivery type "%name%" is not available,en_US -shipment_type.checkout.validation.error,Die ausgewählte Lieferart "%name%" ist nicht verfügbar,de_DE -``` - -2. Import data: - -```bash -console data:import glossary -``` - -{% info_block warningBox "Verification" %} - -Make sure that the configured data has been added to the `spy_glossary` table in the database. - -{% endinfo_block %} - -### 3) Set up Behavior +### 2) Set up Behavior Enable the following behaviors by registering the plugins: From 6cdfbf15f1b223320364fadb0dfe4f98f75f8a3d Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Mon, 7 Aug 2023 10:33:25 +0300 Subject: [PATCH 4/6] CC-29675 Fixes after tech review --- ...l-the-order-management-shipment-feature.md | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md index 454ba0c380d..93a49395797 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md @@ -73,33 +73,37 @@ Make sure that the following changes have been triggered in transfer objects: Enable the following plugins: -| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | -|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------| -| ShipmentTypeOrderItemsPostSavePlugin | Persists shipment type data to `spy_sales_shipment_type` table and updates `spy_sales_shipment` with `fk_shipment_type`. | | Spryker\Zed\SalesShipmentType\Communication\Plugin\Sales | +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------| +| ShipmentTypeCheckoutDoSaveOrderPlugin | Persists shipment type data to `spy_sales_shipment_type` table and updates `spy_sales_shipment` with `fk_shipment_type`. | Should be executed after the `SalesOrderShipmentSavePlugin` plugin. | Spryker\Zed\SalesShipmentType\Communication\Plugin\Checkout | -**src/Pyz/Zed/Sales/SalesDependencyProvider.php** +**src/Pyz/Zed/Checkout/CheckoutDependencyProvider.php** ```php + * @param \Spryker\Zed\Kernel\Container $container + * + * @return list<\Spryker\Zed\Checkout\Dependency\Plugin\CheckoutSaveOrderInterface>|list<\Spryker\Zed\CheckoutExtension\Dependency\Plugin\CheckoutDoSaveOrderInterface> */ - protected function getOrderItemsPostSavePlugins(): array + protected function getCheckoutOrderSavers(Container $container): array { return [ - new ShipmentTypeOrderItemsPostSavePlugin(), + new ShipmentTypeCheckoutDoSaveOrderPlugin(), ]; } } + ``` {% info_block warningBox "Verification" %} From 185fd6bff45a92f1e0c699e25162b87d60abf26b Mon Sep 17 00:00:00 2001 From: AntonKhabiuk Date: Mon, 7 Aug 2023 10:47:15 +0300 Subject: [PATCH 5/6] CC-29675 Move sales related IG to main Shipment IG --- ...l-the-order-management-shipment-feature.md | 113 ------------------ .../202400.0/install-the-shipment-feature.md | 67 +++++++++-- ...l-the-order-management-shipment-feature.md | 8 -- 3 files changed, 56 insertions(+), 132 deletions(-) delete mode 100644 _includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md delete mode 100644 docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md diff --git a/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md deleted file mode 100644 index 93a49395797..00000000000 --- a/_includes/pbc/all/install-features/202400.0/install-the-order-management-shipment-feature.md +++ /dev/null @@ -1,113 +0,0 @@ - - -This document describes how to integrate the [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) + [Shipment](/docs/pbc/all/carrier-management/{{page.version}}/base-shop/shipment-feature-overview.html) features into a Spryker project. - -{% info_block errorBox %} - -The following features integration guide expects the basic feature to be in place. - -The feature integration guide adds the following functionality: - -* [Order Management](/docs/scos/user/features/{{page.version}}/order-management-feature-overview/order-management-feature-overview.html) -* [Shipment](/docs/pbc/all/carrier-management/{{page.version}}/base-shop/shipment-feature-overview.html) - -{% endinfo_block %} - -## Install feature core - -Follow the steps below to install the Order Management + Shipment feature. - -### Prerequisites - -To start feature integration, integrate the required features: - -| NAME | VERSION | INTEGRATION GUIDE | -|------------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Order Management | {{page.version}} | [Order Management feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/order-management-feature-integration.html) | -| Shipment | {{page.version}} | [Shipment feature integration](/docs/pbc/all/carrier-management/{{page.version}}/unified-commerce/enhanced-click-and-collect/install-and-upgrade/install-the-shipment-feature.html) | - - -## 1) Install the required modules using Composer - -```bash -composer require spryker/sales-shipment-type:"^0.1.0" --update-with-dependencies -``` - -{% info_block warningBox "Verification" %} - -Make sure that the following module has been installed: - -| MODULE | EXPECTED DIRECTORY | -|--------------------|------------------------------------| -| SalesShipmentType | vendor/spryker/sales-shipment-type | - -{% endinfo_block %} - -### 2) Set up the database schema and transfer objects - -Apply the database changes and generate entity and transfer changes: - -```bash -console propel:install -console transfer:generate -``` - -{% info_block warningBox "Verification" %} - -Make sure that the following changes have been applied by checking your database: - -| DATABASE ENTITY | TYPE | EVENT | -|-------------------------------------|--------|---------| -| spy_sales_shipment_type | table | created | -| spy_sales_shipment.fk_shipment_type | column | created | - -Make sure that the following changes have been triggered in transfer objects: - -| TRANSFER | TYPE | EVENT | PATH | -|-------------------|-------|---------|---------------------------------------------------------| -| SalesShipmentType | class | created | src/Generated/Shared/Transfer/SalesShipmentTypeTransfer | - -{% endinfo_block %} - -### 3) Set up behavior - -Enable the following plugins: - -| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | -|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------| -| ShipmentTypeCheckoutDoSaveOrderPlugin | Persists shipment type data to `spy_sales_shipment_type` table and updates `spy_sales_shipment` with `fk_shipment_type`. | Should be executed after the `SalesOrderShipmentSavePlugin` plugin. | Spryker\Zed\SalesShipmentType\Communication\Plugin\Checkout | - - -**src/Pyz/Zed/Checkout/CheckoutDependencyProvider.php** - -```php -|list<\Spryker\Zed\CheckoutExtension\Dependency\Plugin\CheckoutDoSaveOrderInterface> - */ - protected function getCheckoutOrderSavers(Container $container): array - { - return [ - new ShipmentTypeCheckoutDoSaveOrderPlugin(), - ]; - } -} - -``` - -{% info_block warningBox "Verification" %} - -Make sure that when you place an order, the selected shipment type is persisted to `spy_sales_shipment_type` and `spy_sales_shipment.fk_sales_shipment_type` is updated. - -{% endinfo_block %} diff --git a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md index a1f513fdaf5..e25c202870b 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-shipment-feature.md @@ -22,9 +22,10 @@ Follow the steps below to install the Shipment feature core. To start the feature integration, integrate the required features: -| NAME | VERSION | INTEGRATION GUIDE | -|--------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------| -| Spryker Core | {{page.version}} | [Spryker Core feature integration](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | | +| NAME | VERSION | INTEGRATION GUIDE | +|------------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Spryker Core | {{page.version}} | [Spryker Core feature integration](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | +| Order Management | {{page.version}} | [Order Management feature integration](/docs/scos/dev/feature-integration-guides/{{page.version}}/order-management-feature-integration.html) | ### 1) Install the required modules using Composer @@ -38,6 +39,7 @@ Make sure that the following modules have been installed: | MODULE | EXPECTED DIRECTORY | |-------------------------|-------------------------------------------| +| SalesShipmentType | vendor/spryker/sales-shipment-type | | ShipmentDataImport | vendor/spryker/shipment-data-import | | ShipmentGui | vendor/spryker/shipment-gui | | Shipment | vendor/spryker/shipment | @@ -146,13 +148,15 @@ console transfer:generate Make sure that the following changes have been applied by checking your database: -| DATABASE ENTITY | TYPE | EVENT | -|--------------------------------------|--------|---------| -| spy_shipment_method_store | table | created | -| spy_shipment_type | table | created | -| spy_shipment_type_storage | table | created | -| spy_shipment_type_store | table | created | -| spy_shipment_method.fk_shipment_type | column | created | +| DATABASE ENTITY | TYPE | EVENT | +|---------------------------------------|--------|---------| +| spy_sales_shipment_type | table | created | +| spy_shipment_method_store | table | created | +| spy_shipment_type | table | created | +| spy_shipment_type_storage | table | created | +| spy_shipment_type_store | table | created | +| spy_sales_shipment.fk_shipment_type | column | created | +| spy_shipment_method.fk_shipment_type | column | created | Make sure that the following changes have been applied in transfer objects: @@ -174,6 +178,7 @@ Make sure that the following changes have been applied in transfer objects: | ShipmentTypeStorageCriteriaTransfer | class | created | src/Generated/Shared/Transfer/ShipmentTypeStorageCriteriaTransfer | | ShipmentTypeStorageConditionsTransfer | class | created | src/Generated/Shared/Transfer/ShipmentTypeStorageConditionsTransfer | | ShipmentMethodCollectionTransfer | class | created | src/Generated/Shared/Transfer/ShipmentMethodCollectionTransfer | +| SalesShipmentType | class | created | src/Generated/Shared/Transfer/SalesShipmentTypeTransfer | | ShipmentMethodTransfer.shipmentType | property | created | src/Generated/Shared/Transfer/ShipmentMethodTransfer | | ShipmentTransfer.shipmentTypeUuid | property | created | src/Generated/Shared/Transfer/ShipmentTransfer | | ItemTransfer.shipmentType | property | created | src/Generated/Shared/Transfer/ItemTransfer | @@ -978,7 +983,47 @@ Make sure that during checkout on the Shipment step, you can only see shipment m {% endinfo_block %} -6. To enable the Backend API, register these plugins: +6. Configure shipment type order saver plugins: + +| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | +|---------------------------------------|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|-------------------------------------------------------------| +| ShipmentTypeCheckoutDoSaveOrderPlugin | Persists shipment type data to `spy_sales_shipment_type` table and updates `spy_sales_shipment` with `fk_shipment_type`. | Should be executed after the `SalesOrderShipmentSavePlugin` plugin. | Spryker\Zed\SalesShipmentType\Communication\Plugin\Checkout | + + +**src/Pyz/Zed/Checkout/CheckoutDependencyProvider.php** + +```php +|list<\Spryker\Zed\CheckoutExtension\Dependency\Plugin\CheckoutDoSaveOrderInterface> + */ + protected function getCheckoutOrderSavers(Container $container): array + { + return [ + new ShipmentTypeCheckoutDoSaveOrderPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +Make sure that when you place an order, the selected shipment type is persisted to `spy_sales_shipment_type` and `spy_sales_shipment.fk_sales_shipment_type` is updated. + +{% endinfo_block %} + +7. To enable the Backend API, register these plugins: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |------------------------------------|------------------------------------------|---------------|-----------------------------------------------------------------------| diff --git a/docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md b/docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md deleted file mode 100644 index 5732863ea45..00000000000 --- a/docs/pbc/all/carrier-management/202204.0/base-shop/install-and-upgrade/install-features/install-the-order-management-shipment-feature.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Install the Order Management + Shipment feature -description: Learn how to integrate the Order Management + Shipment feature in your project -last_updated: Aug 1, 2023 -template: feature-integration-guide-template ---- - -{% include pbc/all/install-features/202204.0/install-the-order-management-shipment-feature.md %} From 9ee4279ff9a662eb7b4d9ef1298515b2db452f0e Mon Sep 17 00:00:00 2001 From: AlexSlawinski Date: Mon, 7 Aug 2023 11:43:31 +0200 Subject: [PATCH 6/6] Apply suggestions from code review --- .../202400.0/install-the-shipment-cart-feature.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md b/_includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md index 00500fc6d7f..dfe80a3e0a3 100644 --- a/_includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md +++ b/_includes/pbc/all/install-features/202400.0/install-the-shipment-cart-feature.md @@ -12,9 +12,9 @@ To start feature integration, overview, and install the necessary features: | Cart | {{page.version}} | | Prices | {{page.version}} | -### 1) Install the required modules using Composer +### Install the required modules using Composer -Run the following command(s) to install the required modules: +Run the following commands to install the required modules: ```bash composer require spryker/shipment-cart-connector: "^2.1.0" spryker/shipment-type-cart: "^0.1.0" --update-with-dependencies @@ -30,7 +30,7 @@ Make sure that the following modules have been installed: {% endinfo_block %} -### 2) Set up transfer objects +### Set up transfer objects Run the following command(s) to apply transfer changes: @@ -68,7 +68,7 @@ Make sure that the following changes have been applied in transfer objects: {% endinfo_block %} -### 3) Set up behavior +### Set up behavior Register the following plugins: @@ -167,7 +167,7 @@ To start feature integration, integrate the required features: | Shipment | {{page.version}} | | Cart | {{page.version}} | -### 2) Add translations +### Add translations Add translations as follows: