From a5345c3a95da474320036f1f9e53fdc1c5bef1e5 Mon Sep 17 00:00:00 2001 From: Dmytro Asieiev Date: Mon, 9 Sep 2024 12:54:44 +0300 Subject: [PATCH 1/3] CC-13685: Updated product quantity and total in Mini Cart Widget from catalog AJAX add-to-cart action. --- .../202407.0/install-the-cart-feature.md | 101 ++++++++++++++++-- 1 file changed, 93 insertions(+), 8 deletions(-) diff --git a/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md b/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md index 2838c2a04bf..26e52f445c4 100644 --- a/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md +++ b/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md @@ -98,11 +98,12 @@ Make sure the following modules have been installed: Set up the following configuration: -| CONFIGURATION | SPECIFICATION | NAMESPACE | -|----------------------------------------------------------------|--------------------------------------------------|---------------------------| -| CartPageConfig::IS_CART_CART_ITEMS_VIA_AJAX_LOAD_ENABLED | Enables the loading of cart items via AJAX. | SprykerShop\Yves\CartPage | -| CartPageConfig::IS_LOADING_UPSELLING_PRODUCTS_VIA_AJAX_ENABLED | Enables the loading of upselling products via AJAX. | SprykerShop\Yves\CartPage | -| CartPageConfig::IS_CART_ACTIONS_ASYNC_MODE_ENABLED | Enables the performing of cart actions via AJAX. | SprykerShop\Yves\CartPage | +| CONFIGURATION | SPECIFICATION | NAMESPACE | +|----------------------------------------------------------------|----------------------------------------------------------------------|------------------------------| +| CartPageConfig::IS_CART_CART_ITEMS_VIA_AJAX_LOAD_ENABLED | Enables the loading of cart items via AJAX. | SprykerShop\Yves\CartPage | +| CartPageConfig::IS_LOADING_UPSELLING_PRODUCTS_VIA_AJAX_ENABLED | Enables the loading of upselling products via AJAX. | SprykerShop\Yves\CartPage | +| CartPageConfig::IS_CART_ACTIONS_ASYNC_MODE_ENABLED | Enables the performing of cart actions via AJAX. | SprykerShop\Yves\CartPage | +| CatalogPageConfig::IS_MINI_CART_ASYNC_MODE_ENABLED | Enables async rendering of mini cart during AJAX add to cart action. | SprykerShop\Yves\CatalogPage | **src/Pyz/Yves/CartPage/CartPageConfig.php** @@ -130,18 +131,42 @@ class CartPageConfig extends SprykerCartPageConfig */ protected const IS_CART_ACTIONS_ASYNC_MODE_ENABLED = true; } - ``` {% info_block warningBox "Verification" %} -Make sure the following applies: +Make sure the following applies (in Cart page): - Cart items are loaded via AJAX. - Upselling products are loaded via AJAX. - Cart actions, like changing item quantity or removing an item, are performed via AJAX. {% endinfo_block %} +**src/Pyz/Yves/CatalogPage/CatalogPageConfig.php** + +```php + + */ + protected function getMiniCartViewExpanderPlugins(): array + { + return [ + new CartBlockMiniCartViewExpanderPlugin(), + ]; + } +} +``` + +{% info_block warningBox "Verification" %} + +It's an optional step. Only B2C Demo Shop uses this plugin due to custom mini cart implementation. +For the B2C setup you should also specify the following configuration: + +**src/Pyz/Yves/CartPage/CartPageConfig.php** + +```php + Date: Tue, 10 Sep 2024 10:56:33 +0300 Subject: [PATCH 2/3] Update install-the-cart-feature.md --- .../202407.0/install-the-cart-feature.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md b/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md index 26e52f445c4..ebc15fb252b 100644 --- a/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md +++ b/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md @@ -100,10 +100,10 @@ Set up the following configuration: | CONFIGURATION | SPECIFICATION | NAMESPACE | |----------------------------------------------------------------|----------------------------------------------------------------------|------------------------------| -| CartPageConfig::IS_CART_CART_ITEMS_VIA_AJAX_LOAD_ENABLED | Enables the loading of cart items via AJAX. | SprykerShop\Yves\CartPage | -| CartPageConfig::IS_LOADING_UPSELLING_PRODUCTS_VIA_AJAX_ENABLED | Enables the loading of upselling products via AJAX. | SprykerShop\Yves\CartPage | -| CartPageConfig::IS_CART_ACTIONS_ASYNC_MODE_ENABLED | Enables the performing of cart actions via AJAX. | SprykerShop\Yves\CartPage | -| CatalogPageConfig::IS_MINI_CART_ASYNC_MODE_ENABLED | Enables async rendering of mini cart during AJAX add to cart action. | SprykerShop\Yves\CatalogPage | +| CartPageConfig::IS_CART_CART_ITEMS_VIA_AJAX_LOAD_ENABLED | Enables cart items to be loaded via AJAX. | SprykerShop\Yves\CartPage | +| CartPageConfig::IS_LOADING_UPSELLING_PRODUCTS_VIA_AJAX_ENABLED | Enables upselling products to be loaded via AJAX. | SprykerShop\Yves\CartPage | +| CartPageConfig::IS_CART_ACTIONS_ASYNC_MODE_ENABLED | Enables cart actions to be performed via AJAX. | SprykerShop\Yves\CartPage | +| CatalogPageConfig::IS_MINI_CART_ASYNC_MODE_ENABLED | Enables mini cart to be rendered async during the AJAX add to cart action. | SprykerShop\Yves\CatalogPage | **src/Pyz/Yves/CartPage/CartPageConfig.php** @@ -135,7 +135,7 @@ class CartPageConfig extends SprykerCartPageConfig {% info_block warningBox "Verification" %} -Make sure the following applies (in Cart page): +Make sure the following applies on the **Cart** page: - Cart items are loaded via AJAX. - Upselling products are loaded via AJAX. - Cart actions, like changing item quantity or removing an item, are performed via AJAX. @@ -162,8 +162,7 @@ class CatalogPageConfig extends SprykerCatalogPageConfig {% info_block warningBox "Verification" %} -Make sure the following applies (in Catalog page): -- Cart actions, like changing item quantity or removing an item, are performed via AJAX. +Make sure that, on the **Catalog** page, cart actions, like changing item quantity or removing an item, are performed via AJAX. {% endinfo_block %} @@ -230,7 +229,7 @@ Activate the following plugins: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |--------------------------------------|------------------------------------------------------------------|---------------|-------------------------------------------| -| CartBlockMiniCartViewExpanderPlugin | Expands the provided `MiniCartView.content` with mini cart view. | None | SprykerShop\Yves\CartPage\Plugin\CartPage | +| CartBlockMiniCartViewExpanderPlugin | Expands the provided `MiniCartView.content` with a mini cart view. | | SprykerShop\Yves\CartPage\Plugin\CartPage | **src/Pyz/Yves/Router/RouterDependencyProvider.php** From ea055b6e169e2f4ec62d57ed8673e9d6d1842b26 Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Tue, 10 Sep 2024 11:13:17 +0300 Subject: [PATCH 3/3] Update install-the-cart-feature.md --- .../202407.0/install-the-cart-feature.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md b/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md index ebc15fb252b..1f3a2b28bce 100644 --- a/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md +++ b/_includes/pbc/all/install-features/202407.0/install-the-cart-feature.md @@ -225,7 +225,7 @@ class RouterDependencyProvider extends SprykerRouterDependencyProvider ### 4) Set up behavior -Activate the following plugins: +1. Activate the following plugins: | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | |--------------------------------------|------------------------------------------------------------------|---------------|-------------------------------------------| @@ -255,10 +255,8 @@ class CartPageDependencyProvider extends SprykerCartPageDependencyProvider } ``` -{% info_block warningBox "Verification" %} -It's an optional step. Only B2C Demo Shop uses this plugin due to custom mini cart implementation. -For the B2C setup you should also specify the following configuration: +2. B2C Shop: Add the following configuration: **src/Pyz/Yves/CartPage/CartPageConfig.php** @@ -278,8 +276,9 @@ class CartPageConfig extends SprykerCartPageConfig } ``` -Make sure the following applies (in Cart page): -- Cart actions, like changing item quantity or removing an item, are reflected in the mini cart. +{% info_block warningBox "Verification" %} + +Make sure that, on the **Cart** page, cart actions, like changing item quantity or removing an item, are reflected in the mini cart. {% endinfo_block %}