@@ -98,11 +98,12 @@ Make sure the following modules have been installed:
98
98
99
99
Set up the following configuration:
100
100
101
- | CONFIGURATION | SPECIFICATION | NAMESPACE |
102
- | ----------------------------------------------------------------| --------------------------------------------------| ---------------------------|
103
- | CartPageConfig::IS_CART_CART_ITEMS_VIA_AJAX_LOAD_ENABLED | Enables the loading of cart items via AJAX. | SprykerShop\Yves\CartPage |
104
- | CartPageConfig::IS_LOADING_UPSELLING_PRODUCTS_VIA_AJAX_ENABLED | Enables the loading of upselling products via AJAX. | SprykerShop\Yves\CartPage |
105
- | CartPageConfig::IS_CART_ACTIONS_ASYNC_MODE_ENABLED | Enables the performing of cart actions via AJAX. | SprykerShop\Yves\CartPage |
101
+ | CONFIGURATION | SPECIFICATION | NAMESPACE |
102
+ | ----------------------------------------------------------------| ----------------------------------------------------------------------| ------------------------------|
103
+ | CartPageConfig::IS_CART_CART_ITEMS_VIA_AJAX_LOAD_ENABLED | Enables cart items to be loaded via AJAX. | SprykerShop\Yves\CartPage |
104
+ | CartPageConfig::IS_LOADING_UPSELLING_PRODUCTS_VIA_AJAX_ENABLED | Enables upselling products to be loaded via AJAX. | SprykerShop\Yves\CartPage |
105
+ | CartPageConfig::IS_CART_ACTIONS_ASYNC_MODE_ENABLED | Enables cart actions to be performed via AJAX. | SprykerShop\Yves\CartPage |
106
+ | CatalogPageConfig::IS_MINI_CART_ASYNC_MODE_ENABLED | Enables mini cart to be rendered async during the AJAX add to cart action. | SprykerShop\Yves\CatalogPage |
106
107
107
108
** src/Pyz/Yves/CartPage/CartPageConfig.php**
108
109
@@ -130,18 +131,41 @@ class CartPageConfig extends SprykerCartPageConfig
130
131
*/
131
132
protected const IS_CART_ACTIONS_ASYNC_MODE_ENABLED = true;
132
133
}
133
-
134
134
```
135
135
136
136
{% info_block warningBox "Verification" %}
137
137
138
- Make sure the following applies:
138
+ Make sure the following applies on the ** Cart ** page :
139
139
- Cart items are loaded via AJAX.
140
140
- Upselling products are loaded via AJAX.
141
141
- Cart actions, like changing item quantity or removing an item, are performed via AJAX.
142
142
143
143
{% endinfo_block %}
144
144
145
+ ** src/Pyz/Yves/CatalogPage/CatalogPageConfig.php**
146
+
147
+ ``` php
148
+ <?php
149
+
150
+ namespace Pyz\Yves\CatalogPage;
151
+
152
+ use SprykerShop\Yves\CatalogPage\CatalogPageConfig as SprykerCatalogPageConfig;
153
+
154
+ class CatalogPageConfig extends SprykerCatalogPageConfig
155
+ {
156
+ /**
157
+ * @var bool
158
+ */
159
+ protected const IS_MINI_CART_ASYNC_MODE_ENABLED = true;
160
+ }
161
+ ```
162
+
163
+ {% info_block warningBox "Verification" %}
164
+
165
+ Make sure that, on the ** Catalog** page, cart actions, like changing item quantity or removing an item, are performed via AJAX.
166
+
167
+ {% endinfo_block %}
168
+
145
169
### 3) Enable controllers
146
170
147
171
Register the following route providers on the Storefront:
@@ -199,7 +223,66 @@ class RouterDependencyProvider extends SprykerRouterDependencyProvider
199
223
200
224
{% endinfo_block %}
201
225
202
- ### 4) Set up widgets
226
+ ### 4) Set up behavior
227
+
228
+ 1 . Activate the following plugins:
229
+
230
+ | PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
231
+ | --------------------------------------| ------------------------------------------------------------------| ---------------| -------------------------------------------|
232
+ | CartBlockMiniCartViewExpanderPlugin | Expands the provided ` MiniCartView.content ` with a mini cart view. | | SprykerShop\Yves\CartPage\Plugin\CartPage |
233
+
234
+ ** src/Pyz/Yves/Router/RouterDependencyProvider.php**
235
+
236
+ ``` php
237
+ <?php
238
+
239
+ namespace Pyz\Yves\CartPage;
240
+
241
+ use SprykerShop\Yves\CartPage\CartPageDependencyProvider as SprykerCartPageDependencyProvider;
242
+ use SprykerShop\Yves\CartPage\Plugin\CartPage\CartBlockMiniCartViewExpanderPlugin;
243
+
244
+ class CartPageDependencyProvider extends SprykerCartPageDependencyProvider
245
+ {
246
+ /**
247
+ * @return array<\SprykerShop\Yves\CartPageExtension\Dependency\Plugin\MiniCartViewExpanderPluginInterface>
248
+ */
249
+ protected function getMiniCartViewExpanderPlugins(): array
250
+ {
251
+ return [
252
+ new CartBlockMiniCartViewExpanderPlugin(),
253
+ ];
254
+ }
255
+ }
256
+ ```
257
+
258
+
259
+ 2 . B2C Shop: Add the following configuration:
260
+
261
+ ** src/Pyz/Yves/CartPage/CartPageConfig.php**
262
+
263
+ ``` php
264
+ <?php
265
+
266
+ namespace Pyz\Yves\CartPage;
267
+
268
+ use SprykerShop\Yves\CartPage\CartPageConfig as SprykerCartPageConfig;
269
+
270
+ class CartPageConfig extends SprykerCartPageConfig
271
+ {
272
+ /**
273
+ * @var string
274
+ */
275
+ protected const CART_BLOCK_MINI_CART_VIEW_TEMPLATE_PATH = '@ShopUi/components/organisms/navigation-top-async/navigation-top-async.twig';
276
+ }
277
+ ```
278
+
279
+ {% info_block warningBox "Verification" %}
280
+
281
+ Make sure that, on the ** Cart** page, cart actions, like changing item quantity or removing an item, are reflected in the mini cart.
282
+
283
+ {% endinfo_block %}
284
+
285
+ ### 5) Set up widgets
203
286
204
287
1 . Register the following widgets:
205
288
0 commit comments