-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install Service Points + Customer Account Management feature #2062
Merged
VadymSachenko
merged 8 commits into
master
from
feature/cc-26571/install-service-points-customer
Aug 7, 2023
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
665f089
CC-26571: Install Service Points + Customer Account Management feature
dmiseev 5bda7ad
Merge branch 'master' into feature/cc-26571/install-service-points-cu…
c58379b
CC-26571: Moved IG to the correct subfolder.
dmiseev 339ee98
Revert changes + moved IG to correct subfolder.
dmiseev 729b3c2
move docs to proper version, add doc to service points
461f570
Merge branch 'master' into feature/cc-26571/install-service-points-cu…
29c6482
Merge branch 'master' into feature/cc-26571/install-service-points-cu…
1a0c397
move doc
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
249 changes: 249 additions & 0 deletions
249
...ures/202307.0/install-the-service-points-customer-account-management-feature.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
|
||
|
||
|
||
This document describes how to integrate the Service Points + [Customer Account Management](/docs/pbc/all/customer-relationship-management/{{page.version}}/customer-account-management-feature-overview/customer-account-management-feature-overview.html) feature into a Spryker project. | ||
|
||
## Install feature core | ||
|
||
Follow the steps below to install the Service Points + Customer Account Management feature. | ||
|
||
### Prerequisites | ||
|
||
To start feature integration, integrate the required features: | ||
|
||
| NAME | VERSION | INTEGRATION GUIDE | | ||
|-----------------------------|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| Service Points | {{page.version}} | [Install the Service Points feature](/docs/pbc/all/service-points/{{page.version}}/unified-commerce/install-the-service-points-feature.html) | | ||
| Customer Account Management | {{page.version}} | [Install the Customer Account Management feature](/docs/pbc/all/customer-relationship-management/{{page.version}}/install-and-upgrade/install-features/install-the-customer-account-management-feature.html) | | ||
|
||
## 1) Add translations | ||
|
||
1. Append the glossary according to your configuration: | ||
|
||
**data/import/common/common/glossary.csv** | ||
|
||
``` | ||
service_point_widget.validation.error.service_point_not_selected,Please select service point.,en_US | ||
service_point_widget.validation.error.service_point_not_selected,Bitte Servicestelle auswählen.,de_DE | ||
service_point_widget.validation.error.billing_address_not_provided,Please add billing address manually.,en_US | ||
service_point_widget.validation.error.billing_address_not_provided,Bitte fügen Sie die Rechnungsadresse manuell hinzu.,de_DE | ||
service_point_widget.select_location_action,Select a location,en_US | ||
service_point_widget.select_location_action,Wählen Sie einen Standort,de_DE | ||
service_point_widget.change_action,Change,en_US | ||
service_point_widget.change_action,Ändern,de_DE | ||
service_point_widget.location_label,Location:,en_US | ||
service_point_widget.location_label,Standort:,de_DE | ||
service_point_widget.select_your_store_title,Select your store,en_US | ||
service_point_widget.select_your_store_title,Wählen Sie Ihren Store,de_DE | ||
service_point_widget.search,"Search for Store, zip code or city...",en_US | ||
service_point_widget.search,"Suche nach Store, PLZ oder Stadt...",de_DE | ||
service_point_widget.select_store_action,Select store,en_US | ||
service_point_widget.select_store_action,Store auswählen,de_DE | ||
service_point_widget.no_results,"Nothing found...",en_US | ||
service_point_widget.no_results,"Nichts gefunden...",de_DE | ||
``` | ||
|
||
2. Import data: | ||
|
||
```bash | ||
console data:import glossary | ||
``` | ||
|
||
{% info_block warningBox "Verification" %} | ||
|
||
Make sure that the configured data is added to the `spy_glossary_key` and `spy_glossary_translation` tables in the database. | ||
|
||
{% endinfo_block %} | ||
|
||
## 2) Set up behavior | ||
|
||
Enable the following plugins: | ||
|
||
| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | | ||
|--------------------------------------------------------------------------|---------------------------------------------------------------------------|---------------|------------------------------------------------------------| | ||
| ClickCollectServiceTypeCheckoutAddressCollectionFormExpanderPlugin | Expands the `ServicePoint` subform with a pickupable service type. | | SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage | | ||
| ClickCollectServiceTypeCheckoutMultiShippingAddressesFormExpanderPlugin | Expands `ServicePoint` with a pickupable service type. | | SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage | | ||
| ServicePointCheckoutAddressCollectionFormExpanderPlugin | Expands checkout address form with `ServicePoint`. | | SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage | | ||
| ServicePointCheckoutMultiShippingAddressesFormExpanderPlugin | Expands checkout multi-shipping address form with `ServicePoint`. | | SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage | | ||
| ServicePointAddressCheckoutAddressCollectionFormExpanderPlugin | Expands shipments with service point address. | | SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage | | ||
| ClickCollectServicePointAddressFormWidgetCacheKeyGeneratorStrategyPlugin | Skips caching of the `ClickCollectServicePointAddressFormWidget` widget. | | SprykerShop\Yves\ServicePointWidget\Plugin\ShopApplication | | ||
|
||
**src/Pyz/Yves/CustomerPage/CustomerPageDependencyProvider.php** | ||
|
||
```php | ||
<?php | ||
|
||
namespace Pyz\Yves\CustomerPage; | ||
|
||
use SprykerShop\Yves\CustomerPage\CustomerPageDependencyProvider as SprykerShopCustomerPageDependencyProvider; | ||
use SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage\ClickCollectServiceTypeCheckoutAddressCollectionFormExpanderPlugin; | ||
use SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage\ClickCollectServiceTypeCheckoutMultiShippingAddressesFormExpanderPlugin; | ||
use SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage\ServicePointAddressCheckoutAddressCollectionFormExpanderPlugin; | ||
use SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage\ServicePointCheckoutAddressCollectionFormExpanderPlugin; | ||
use SprykerShop\Yves\ServicePointWidget\Plugin\CustomerPage\ServicePointCheckoutMultiShippingAddressesFormExpanderPlugin; | ||
class CustomerPageDependencyProvider extends SprykerShopCustomerPageDependencyProvider | ||
{ | ||
/** | ||
* @return list<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\CheckoutAddressCollectionFormExpanderPluginInterface> | ||
*/ | ||
protected function getCheckoutAddressCollectionFormExpanderPlugins(): array | ||
{ | ||
return [ | ||
new ServicePointCheckoutAddressCollectionFormExpanderPlugin(), | ||
new ServicePointAddressCheckoutAddressCollectionFormExpanderPlugin(), | ||
new ClickCollectServiceTypeCheckoutAddressCollectionFormExpanderPlugin(), | ||
]; | ||
} | ||
|
||
/** | ||
* @return list<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\CheckoutMultiShippingAddressesFormExpanderPluginInterface> | ||
*/ | ||
protected function getCheckoutMultiShippingAddressesFormExpanderPlugins(): array | ||
{ | ||
return [ | ||
new ServicePointCheckoutMultiShippingAddressesFormExpanderPlugin(), | ||
new ClickCollectServiceTypeCheckoutMultiShippingAddressesFormExpanderPlugin(), | ||
]; | ||
} | ||
} | ||
|
||
``` | ||
|
||
**src/Pyz/Yves/ShopApplication/ShopApplicationDependencyProvider.php** | ||
|
||
```php | ||
<?php | ||
|
||
namespace Pyz\Yves\ShopApplication; | ||
|
||
use SprykerShop\Yves\ServicePointWidget\Plugin\ShopApplication\ClickCollectServicePointAddressFormWidgetCacheKeyGeneratorStrategyPlugin; | ||
use SprykerShop\Yves\ShopApplication\ShopApplicationDependencyProvider as SprykerShopApplicationDependencyProvider; | ||
|
||
class ShopApplicationDependencyProvider extends SprykerShopApplicationDependencyProvider | ||
{ | ||
/** | ||
* @return list<\SprykerShop\Yves\ShopApplicationExtension\Dependency\Plugin\WidgetCacheKeyGeneratorStrategyPluginInterface> | ||
*/ | ||
protected function getWidgetCacheKeyGeneratorStrategyPlugins(): array | ||
{ | ||
return [ | ||
new ClickCollectServicePointAddressFormWidgetCacheKeyGeneratorStrategyPlugin(), | ||
]; | ||
} | ||
} | ||
``` | ||
|
||
## 3) Set up widgets | ||
|
||
Register the following plugins to enable widgets: | ||
|
||
| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | | ||
|-------------------------------------------|---------------------------------------------------------------|---------------|--------------------------------------------| | ||
| ClickCollectServicePointAddressFormWidget | Turns on service point selection during the checkout address step. | | SprykerShop\Yves\ServicePointWidget\Widget | | ||
|
||
**src/Pyz/Yves/ShopApplication/ShopApplicationDependencyProvider.php** | ||
|
||
```php | ||
<?php | ||
|
||
namespace Pyz\Yves\ShopApplication; | ||
|
||
use SprykerShop\Yves\ServicePointWidget\Widget\ClickCollectServicePointAddressFormWidget; | ||
use SprykerShop\Yves\ShopApplication\ShopApplicationDependencyProvider as SprykerShopApplicationDependencyProvider; | ||
|
||
class ShopApplicationDependencyProvider extends SprykerShopApplicationDependencyProvider | ||
{ | ||
/** | ||
* @return list<string> | ||
*/ | ||
protected function getGlobalWidgets(): array | ||
{ | ||
return [ | ||
ClickCollectServicePointAddressFormWidget::class, | ||
]; | ||
} | ||
} | ||
``` | ||
|
||
## 4) Set up the FE part | ||
|
||
Adjust TWIG templates to display the service point selector: | ||
|
||
1. To the `page-layout-main` template of the `ShopUi` module, add the `main-overlay` molecule: | ||
|
||
```twig | ||
{% raw %}{% block globalComponents %} | ||
.... | ||
{% include molecule('main-overlay') only %} | ||
{% endblock %}{% endraw %} | ||
``` | ||
|
||
2. In the `ShopUi` module, to the `icon-spite` atom, add the `cross` icon: | ||
|
||
```twig | ||
{% raw %}<symbol id=":cross" viewBox="0 0 24 24"> | ||
<path d="M14.8,12l3.6-3.6c0.8-0.8,0.8-2,0-2.8c-0.8-0.8-2-0.8-2.8,0L12,9.2L8.4,5.6c-0.8-0.8-2-0.8-2.8,0 c-0.8,0.8-0.8,2,0,2.8L9.2,12l-3.6,3.6c-0.8,0.8-0.8,2,0,2.8C6,18.8,6.5,19,7,19s1-0.2,1.4-0.6l3.6-3.6l3.6,3.6 C16,18.8,16.5,19,17,19s1-0.2,1.4-0.6c0.8-0.8,0.8-2,0-2.8L14.8,12z"/> | ||
</symbol>{% endraw %} | ||
``` | ||
|
||
{% info_block infoBox "The cross icon is already defined" %} | ||
|
||
If the `cross` icon is already defined in the project, it's not necessary to add it again. | ||
|
||
{% endinfo_block %} | ||
|
||
3. For `/resources/form/form.twig` of `ShopUi` module, adjust `choice_widget_expanded` and `checkbox_widget` blocks: | ||
|
||
```twig | ||
{% raw %}{% block choice_widget_expanded -%} | ||
... | ||
{{- form_widget(child, { | ||
parent_label_class: label_attr.class|default(''), | ||
choices_attr: choices_attr | default({}), | ||
}) -}} | ||
... | ||
{%- endblock choice_widget_expanded %} | ||
|
||
{%- block checkbox_widget -%} | ||
... | ||
{%- set inputClass = attr.class | default ~ ' ' ~ choices_attr.class | default -%} | ||
|
||
{% define attributes = { | ||
id: id, | ||
name: full_name, | ||
checked: checked | default(false), | ||
required: required | default(false), | ||
disabled: disabled ?: attr.disabled | default(false), | ||
value: value | default(), | ||
} %} | ||
... | ||
{%- endblock -%}{% endraw %} | ||
``` | ||
|
||
4. To the `addres` view of the `CheckoutPage` module, add `ClickCollectServicePointAddressFormWidget`: | ||
|
||
```twig | ||
{% raw %}{% widget 'ClickCollectServicePointAddressFormWidget' args [data.checkoutAddressForm] only %}{% endwidget %}{% endraw %} | ||
``` | ||
|
||
{% info_block infoBox "Adding of ClickCollectServicePointAddressFormWidget is automated" %} | ||
|
||
If using the `ShipmentTypeAddressFormWidget` widget, the `ClickCollectServicePointAddressFormWidget` is added automatically. Therefore, you don't need to add it manually. | ||
|
||
{% endinfo_block %} | ||
|
||
5. Build assets: | ||
|
||
```bash | ||
console frontend:yves:build | ||
``` | ||
|
||
{% info_block warningBox "Verification" %} | ||
|
||
Make sure that the following widgets were registered: | ||
|
||
| MODULE | TEST | | ||
|-------------------------------------------|---------------------------------------------------------------------------------| | ||
| ClickCollectServicePointAddressFormWidget | Go to **Address Checkout Step** and make sure that you can select service point. | | ||
|
||
{% endinfo_block %} |
8 changes: 8 additions & 0 deletions
8
...ides/202307.0/install-the-service-points-customer-account-management-feature.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Install the Service Points + Customer Account Management feature | ||
description: Learn how to integrate the Service Points + Customer Account Management feature into your project | ||
last_updated: July 31, 2023 | ||
template: feature-integration-guide-template | ||
--- | ||
|
||
{% include pbc/all/install-features/{{page.version}}/install-the-service-points-customer-account-management-feature.md %} <!-- To edit, see /_includes/pbc/all/install-features/202307.0/install-the-service-points-customer-account-management-feature.md --> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this IG should be moved to PBC:
docs/pbc/all/customer-relationship-management/202307.0/install-and-upgrade/install-features