Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
andriitserkovnyi committed Dec 19, 2023
1 parent 9758200 commit 94ca6a3
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CollectorDependencyProvider extends SprykerCollectorDependencyProvider
}
```

### Data Setup
### Data setup

You should now be able to manage navigation menus from Zed UI, and the collectors should also be able to export the navigation menus to the KV storage. This is a good time to implement an installer in your project to install a selection of frequently used navigation menus. <!--Check out our Demoshop implementation for examples and ideas.-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CollectorDependencyProvider extends SprykerCollectorDependencyProvider
}
```

### Data Setup
### Data setup

You should now be able to manage navigation menus from Zed UI, and the collectors should also be able to export the navigation menus to the KV storage. This is a good time to implement an installer in your project to install a selection of frequently used navigation menus. <!--Check out our Demoshop implementation for examples and ideas.-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CollectorDependencyProvider extends SprykerCollectorDependencyProvider
}
```

### Data Setup
### Data setup

You should now be able to manage navigation menus from Zed UI, and the collectors should also be able to export the navigation menus to the KV storage. This is a good time to implement an installer in your project to install a selection of frequently used navigation menus. <!--Check out our Demoshop implementation for examples and ideas.-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CollectorDependencyProvider extends SprykerCollectorDependencyProvider
}
```

### Data Setup
### Data setup

You should now be able to manage navigation menus from Zed UI, and the collectors should also be able to export the navigation menus to the KV storage. This is a good time to implement an installer in your project to install a selection of frequently used navigation menus. <!--Check out our Demoshop implementation for examples and ideas.-->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The Product Offer Shipment Type subdomain establishes the connection between pro
| ProductOfferShipmentTypeStorage | vendor/spryker/product-offer-shipment-type-storage |
| ProductOfferShipmentTypeStorageExtension | vendor/spryker/product-offer-shipment-type-storage-extension |

## Data Setup
## Data setup

The `ProductOfferShipmentTypeDataImport` module lets you import the relationships between shipment types and product offers.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,45 @@
---
title: Click and Collect feature Service Point Cart subdomain walkthrough
last_updated: Nov 02, 2023
description: Explore the Service Point Cart subdomain in the Click and Collect feature, focusing on the validation of service points and the replacement of line items in a shopping cart. Learn how to install the essential modules and leverage the extension point for implementing custom item replacement strategies during the checkout process.

description: The Service Point Cart subdomain focuses on the validation of service points and the replacement of line items in shopping carts.
template: concept-topic-template
---

# Service Point Cart

The Service Point Cart subdomain enables you to validate service points and replace line items within a shopping cart.

## Installation

[Install the Service Points Cart feature](/docs/pbc/all/install-features/{{page.version}}/install-the-service-points-cart-feature.html)

## 1. Modules
## Modules

| MODULE | EXPECTED DIRECTORY |
|-----------------------------|------------------------------------------------|
| ServicePointCart | vendor/spryker/service-point-cart |
| ServicePointCartExtension | vendor/spryker/service-point-cart-extension |
| ServicePointCartsRestApi | vendor/spryker/service-point-carts-rest-api |

## 2. Extension point that allows for the implementation of item replacement strategies in the cart during the checkout process
## Extension point that allows for the implementation of item replacement strategies in the cart during checkout

Utilize the extension point to implement custom strategies for replacing items in the cart during the checkout process.
The following extension point is used to implement custom strategies for replacing items in the cart during checkout: `\Spryker\Zed\ServicePointCartExtension\Dependency\Plugin\ServicePointQuoteItemReplaceStrategyPluginInterface`.

**\Spryker\Zed\ServicePointCartExtension\Dependency\Plugin\ServicePointQuoteItemReplaceStrategyPluginInterface**
Implementation example: `\Spryker\Zed\ClickAndCollectExample\Communication\Plugin\ServicePointCart\ClickAndCollectExampleServicePointQuoteItemReplaceStrategyPlugin`.

Example Implementation:
This example replacement strategy substitutes a product offer with another one based on updated information about the service point and shipment type in the shopping cart.

**\Spryker\Zed\ClickAndCollectExample\Communication\Plugin\ServicePointCart\ClickAndCollectExampleServicePointQuoteItemReplaceStrategyPlugin**

This example replacement strategy substitutes a product offer with another based on updated information about the Service Point and Shipment Type in the shopping cart.

At the project level, extend this capability to support more intricate scenarios, such as:
At the project level, extend this capability to support more intricate scenarios, such as the following:

1. Receiving information from external systems about the offer intended for replacement.
2. Implementing diverse algorithms for cart item replacement based on information obtained from customers.

## 2.1 How to merge cart line items with different product offers but same SKU and Merchant.
### How to merge cart line items with different product offers but same SKU and merchant.

The demo replacement strategy can guarantee work only if a product in the cart with same SKU and Merchant represented as a single cart line item.
To enable the following behavior, you need to follow the steps below:
The demo replacement strategy works only if a product in the cart with same SKU and merchant are represented as a single cart line item.
To enable this behavior, follow the steps:

1. Disable plugin **\Spryker\Zed\ProductOffer\Communication\Plugin\Cart\ProductOfferGroupKeyItemExpanderPlugin** from the **\Pyz\Zed\Cart\CartDependencyProvider::getExpanderPlugins()**, this plugin groups cart items with the same product offer.
2. Create a new ProductOfferGroupKeyItemExpanderPlugin plugin that implements **\Spryker\Zed\CartExtension\Dependency\Plugin\ItemExpanderPluginInterface** and register it in **\Pyz\Zed\Cart\CartDependencyProvider::getExpanderPlugins()**.
1. From `\Pyz\Zed\Cart\CartDependencyProvider::getExpanderPlugins()`, disable the `\Spryker\Zed\ProductOffer\Communication\Plugin\Cart\ProductOfferGroupKeyItemExpanderPlugin` plugin.
This plugin groups cart items with the same product offer.
2. Create a new `ProductOfferGroupKeyItemExpanderPlugin` plugin that implements `\Spryker\Zed\CartExtension\Dependency\Plugin\ItemExpanderPluginInterface` and register it in `\Pyz\Zed\Cart\CartDependencyProvider::getExpanderPlugins()`.
3. Add the following code to the example plugin:

```php
Expand Down Expand Up @@ -100,8 +96,25 @@ class ProductOfferMerchantGroupKeyItemExpanderPlugin extends AbstractPlugin impl
}
```

1. Prepare several product offers for the merchant's product.
2. Log in to the store as a customer.
3. Add a product to the cart with a quantity of 1 for SKU SKU123 and Merchant MER123 and Offer [Offer1].
4. Select a different offer, for example, Offer2, for the same product with the same Merchant and add it to the cart.
5. The cart line item with a quantity of 1, SKU SKU123 and Merchant MER123 and Offer [Offer1] will be updated to a quantity of 2.

{% info_block warningBox "Verification" %}


1. Prepare several product offers for a merchant's product.
For these steps, assume you are creating offer1 and offer2 for product SKU123 and merchant MER123.
2. On the Storefront, log in as a customer.
3. Add a product to cart with the following configuration:
* Quantity: 1
* SKU: SKU123
* Merchant: MER123
* Offer: offer1

4. Add the following product to cart:
* Quantity: 1
* SKU: SKU123
* Merchant: MER123
* Offer: offer2

Make sure the cart item you've added in step 3 is updated to quantity 2. The number of items in cart remains 1.

{% endinfo_block %}
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
title: Click and Collect feature Service Points domain walkthrough
last_updated: Nov 02, 2023
description: |
Explore the Service Point domain of the Click and Collect feature, exploring the definition and functionality of service points. Learn how to install the Service Points feature and set up essential modules for seamless integration. Understand the significance of data setup and discover the available methods, including the Backend API and Data Import, to configure service points, addresses, stores, service types, and services.
description: Explore the Service Point domain of the Click and Collect feature, exploring the definition and functionality of service points. Learn how to install the Service Points feature and set up essential modules for seamless integration. Understand the significance of data setup and discover the available methods, including the Backend API and Data Import, to configure service points, addresses, stores, service types, and services.
template: concept-topic-template
---

# Service Points

A Service Point represents a physical location, such as a store, post office, or other designated areas, enabling customers to conveniently pick up their orders or access additional services like returns, exchanges, or customer support. Each service point has the capability to offer one or multiple unique services to customers.

## Installation

[Install the Service Points feature](/docs/pbc/all/install-features/{{page.version}}/install-the-service-points-feature.html)

## 1. Modules
## Modules

| MODULE | EXPECTED DIRECTORY |
|---------------------------|------------------------------------------------|
Expand All @@ -32,19 +31,18 @@ A Service Point represents a physical location, such as a store, post office, or
| ServicePointWidget | vendor/spryker-shop/service-point-widget |
| ServicePointCartPage | vendor/spryker-shop/service-point-cart-page |

## 2. Data Setup

Spryker offers two methods for setting up service points, service point addresses, service point stores, service types, and services:
## Data setup

- Backend API (check the `ServicePointsBackendApi` module)
- Data Import (check the `ServicePointDataImport` module)
The following options let you set up shipment types data:

## 3. Address Substitution during Checkout
| MODULE | IMPORT TYPE |
| - | - |
| `ServicePointsBackendApi` | Backend API |
| `ServicePointDataImport` | Data Import |

The `ServicePointWidget` module offers a mechanism to substitute the shipping address with the service point address during the checkout process in Yves.

### Plugins
## Address substitution during checkout

The following plugin handles address substitution when the cart item has a service point selected and the shipment type is set to `pickup`:
The `ServicePointWidget` module offers a mechanism to substitute the shipping address with the service point address during checkout.

- **\SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage\ServicePointAddressCheckoutAddressCollectionFormExpanderPlugin**
The following plugin handles address substitution when the cart item has a service point selected and the shipment type is set to `pickup`: `\SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage\ServicePointAddressCheckoutAddressCollectionFormExpanderPlugin`.
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
---
title: Click and Collect feature Shipment Type Service Point subdomain walkthrough
title: Shipment Type Service Point subdomain
last_updated: Nov 02, 2023
description: |
Explore the Shipment Type Service Point subdomain in the Click and Collect feature, focusing on the connection between shipment types and service points. Learn how to install the Shipment Service Points feature and set up the necessary modules to establish a seamless integration. Understand the data setup process, leveraging the import functionality provided by the `ShipmentTypeServicePointDataImport` module to create a robust connection between service points and shipment types.
description: The Shipment Type Service Point subdomain connects shipment types and service points.
template: concept-topic-template
---

# Shipment Type Service Point

The Shipment Type Service Point subdomain establishes the connection between shipment types and service type.

[Install the Shipment Service Points feature](/docs/pbc/all/install-features/{{page.version}}/install-the-shipment-service-points-feature.html)

## 1. Modules
## Modules

| MODULE | EXPECTED DIRECTORY |
|------------------------------------|---------------------------------------------------------|
Expand All @@ -22,20 +18,20 @@ The Shipment Type Service Point subdomain establishes the connection between shi
| ShipmentTypeServicePointsRestApi | vendor/spryker/shipment-type-service-points-rest-api |
| ShipmentTypeServicePointStorage | vendor/spryker/shipment-type-service-point-storage |

## 2. Data Setup
## Data setup

Spryker provides import functionality through the `ShipmentTypeServicePointDataImport` module to facilitate the setup of the connection between service points and shipment types.

## 3. Address Substitution during Checkout
## Address substitution during checkout

The `ShipmentTypeServicePointsRestApi` module offers a mechanism to substitute the shipping address with the service point address during the checkout process.
The `ShipmentTypeServicePointsRestApi` module offers a mechanism to substitute the shipping address with the service point address during checkout.

### Plugins

The following plugin handles address substitution when the shipment type is set to `pickup` and a service point is selected:

- **\Spryker\Glue\ShipmentTypeServicePointsRestApi\Plugin\CheckoutRestApi\ShipmentTypeServicePointCheckoutRequestExpanderPlugin**
**\Spryker\Glue\ShipmentTypeServicePointsRestApi\Plugin\CheckoutRestApi\ShipmentTypeServicePointCheckoutRequestExpanderPlugin**

Additionally, customization possibilities exist to redefine applicable shipment type keys supporting address substitution through module configuration:
Additionally, you can redefine applicable shipment type keys supporting address substitution through module configuration:

- **\Spryker\Shared\ShipmentTypeServicePointsRestApi\ShipmentTypeServicePointsRestApiConfig::getApplicableShipmentTypeKeysForShippingAddress**
**\Spryker\Shared\ShipmentTypeServicePointsRestApi\ShipmentTypeServicePointsRestApiConfig::getApplicableShipmentTypeKeysForShippingAddress**
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
title: Click and Collect feature Shipment Types domain walkthrough
title: Shipment Types domain walkthrough
last_updated: Nov 02, 2023
description: |
Explore the Shipment Type domain in the Click and Collect feature, understanding the various options available to customers for receiving their orders. This guide provides comprehensive details on installing the Shipment feature, delving into the associated modules, and showcasing different data setup methods. Additionally, discover key extension points for customizing Shipment Types behavior during the checkout process.
description: Discover the key extension points for customizing the behavior of shipment types during checkout.
template: concept-topic-template
---

# Shipment Types
Shipment types offer different options for customers to receive their orders.

Shipment types offer diverse options for customers to receive their orders.
## Installation

[Install the Shipment feature](/docs/pbc/all/install-features/{{page.version}}/install-the-shipment-feature.html)

## 1. Modules
## Modules

| MODULE | EXPECTED DIRECTORY |
|-----------------------------------------------------------|----------------------------------------------------------------------------------|
Expand All @@ -32,45 +30,42 @@ Shipment types offer diverse options for customers to receive their orders.
| ShipmentTypeWidget | vendor/spryker-shop/shipment-type-widget |
| SalesShipmentType | vendor/spryker/sales-shipment-type |

## 2. Data Setup
## Data setup

The following options let you set up shipment types data:

Spryker offers two methods for setting up shipment types:
- Backend API (check `ShipmentTypesBackendApi` module)
- Data import (check `ShipmentTypeDataImport` module)
| MODULE | IMPORT TYPE |
| - | - |
| `ShipmentTypesBackendApi` | Backend API |
| `ShipmentTypeDataImport` | Data import |

## 3. Extension point for filter shipment types for the quote during the checkout process
## Extension point for filter shipment types for the quote during checkout

Filter shipment types for the quote during the checkout process with the following extension point:
Filter shipment types for the quote during checkout with the following extension point:

**\Spryker\Client\ShipmentTypeStorageExtension\Dependency\Plugin\AvailableShipmentTypeFilterPluginInterface**

An example:
Example of a plugin that filters out shipment types without a product offer shipment type relation:

**\Spryker\Client\ClickAndCollectExample\Plugin\ShipmentTypeStorage\ShipmentTypeProductOfferAvailableShipmentTypeFilterPlugin**

This plugin filters out shipment types without a product offer shipment type relation.
## Extension point for expanding Shipment Type data before publishing to the Storage

## 4. Extension point for expanding Shipment Type data before publishing to the Storage

Expands shipment type storage collection with additional data before publishing to the Storage.
Use the expanded data after retrieving Shipment Type data from the Storage.
Expands shipment type storage collection with additional data before publishing to the Storage. Use the expanded data after retrieving Shipment Type data from the Storage.

**\Spryker\Zed\ShipmentTypeStorageExtension\Dependency\Plugin\ShipmentTypeStorageExpanderPluginInterface**

An example:
Example of a plugin that expands shipment types with a service type:

**\Spryker\Zed\ShipmentTypeServicePointStorage\Communication\Plugin\ShipmentTypeStorage\ServiceTypeShipmentTypeStorageExpanderPlugin**

This plugin expands shipment types with a service type.

## 5. Extension point for expanding Shipment Type data after retrieving from the Storage

Expands shipment type storage collection with additional data after retrieving it from the Storage.

**\Spryker\Client\ShipmentTypeStorageExtension\Dependency\Plugin\ShipmentTypeStorageExpanderPluginInterface**

An example:
Example of a plugin that expands shipment types with a service type:

**\Spryker\Client\ShipmentTypeServicePointStorage\Plugin\ShipmentTypeStorage\ServiceTypeShipmentTypeStorageExpanderPlugin**

This plugin expands shipment types with a service type.

0 comments on commit 94ca6a3

Please sign in to comment.