valantic-spryker/price-product-customer-group

Module containing database schema and required plugins for specific product prices per customer group.

1.0.0 2023-08-01 15:21 UTC

This package is auto-updated.

Last update: 2024-04-09 11:43:38 UTC


README

Minimum PHP Version

Module containing database schema and required plugins for specific product prices per customer group.

Install package

composer req valantic-spryker/price-product-customer-group

Update shared config

config/Shared/config_default.php

$config[KernelConstants::CORE_NAMESPACES] = [
    ...
    'ValanticSpryker',
];

Register plugins

src/Pyz/Zed/PriceProduct/PriceProductDependencyProvider.php

...

use ValanticSpryker\Zed\PriceProductCustomerGroup\Communication\Plugin\PriceProduct\CustomerGroupPriceDimensionAbstractWriterPlugin;
use ValanticSpryker\Zed\PriceProductCustomerGroup\Communication\Plugin\PriceProduct\CustomerGroupPriceDimensionConcreteWriterPlugin;
use ValanticSpryker\Zed\PriceProductCustomerGroup\Communication\Plugin\PriceProduct\CustomerGroupPriceProductDimensionExpanderStrategyPlugin;
use ValanticSpryker\Zed\PriceProductCustomerGroup\Communication\Plugin\PriceProduct\CustomerGroupPriceProductStorePreDeletePlugin;
use ValanticSpryker\Zed\PriceProductCustomerGroup\Communication\Plugin\PriceProduct\CustomerGroupPriceQueryCriteriaPlugin;

...

 protected function getPriceDimensionQueryCriteriaPlugins(): array
 {
    return array_merge(parent::getPriceDimensionQueryCriteriaPlugins(), [
        ...
        new CustomerGroupPriceQueryCriteriaPlugin(),
    ]);
 }

...

protected function getPriceProductStorePreDeletePlugins(): array
{
    return [
        ...
        new CustomerGroupPriceProductStorePreDeletePlugin(),
    ];
}

...

protected function getPriceProductDimensionExpanderStrategyPlugins(): array
{
    return [
        ...
        new CustomerGroupPriceProductDimensionExpanderStrategyPlugin(),
    ];
}

...

protected function getPriceDimensionConcreteSaverPlugins(): array
{
    return [
        ...
        new CustomerGroupPriceDimensionConcreteWriterPlugin(),
    ];
}

...

protected function getPriceDimensionAbstractSaverPlugins(): array
{
    return [
        ...
        new CustomerGroupPriceDimensionAbstractWriterPlugin(),
    ];
}

src/Pyz/Zed/Console/ConsoleDependencyProvider.php

...
use ValanticSpryker\Zed\PriceProductCustomerGroup\Communication\Console\PriceProductCustomerGroupDeleteConsole;
...

protected function getConsoleCommands(Container $container): array
{
    $commands = [
        ...
        new PriceProductCustomerGroupDeleteConsole(),
    ];
}

src/Pyz/Service/PriceProduct/PriceProductDependencyProvider.php

...
use ValanticSpryker\Service\PriceProductCustomerGroup\Plugin\PriceProduct\CustomerGroupPriceProductFilterPlugin;
...

protected function getPriceProductDecisionPlugins(): array
{
    return array_merge([
        ...
        new CustomerGroupPriceProductFilterPlugin(),
    ], parent::getPriceProductDecisionPlugins());
}

See also

Integration of price product customer group connector: https://gitlab.nxs360.com/packages/php/spryker/price-product-customer-group-connector