Product Bundles + Cart feature integration

Edit on GitHub

Install feature core

Prerequisites

To start feature integration, overview and install the necessary features:

MODULE EXPECTED DIRECTORY
Product Bundles 202108.0
Cart 202108.0
Spryker Core 202108.0

1) Set up behavior

PLUGIN SPECIFICATION PREREQUISITES NAMESPACE
ProductBundleItemCountQuantityPlugin Returns combined quantity of all items in cart. None Spryker\Client\ProductBundle\Plugin\Cart

src/Pyz/Client/Cart/CartDependencyProvider.php

<?php

namespace Pyz\Client\Cart;

use Spryker\Client\Cart\CartDependencyProvider as SprykerCartDependencyProvider;
use Spryker\Client\ProductBundle\Plugin\Cart\ProductBundleItemCountQuantityPlugin;

class CartDependencyProvider extends SprykerCartDependencyProvider
{
    /**
     * @return \Spryker\Client\Cart\Dependency\Plugin\ItemCountPluginInterface
     */
    protected function getItemCountPlugin(): ItemCountPluginInterface
    {
        return new ProductBundleItemCountQuantityPlugin();
    }
}
Verification

Add several regular products and product bundles to cart. Make sure that item counter at cart widget shows correct number (bundled items should not be counted as separate items).