valantic-spryker / price-product-customer-group-storage
This modules is used for saving customer group prices into storage and contains plugins for reading them.
Requires
- php: >=7.3
- spryker/currency: ^3.0.0
- spryker/customer: ^7.10.0
- spryker/customer-group: ^2.6
- spryker/event-behavior: ^1.1.0
- spryker/kernel: ^3.37.0
- spryker/price-product: ^2.11.0 || ^4.0.0
- spryker/price-product-storage-extension: ^1.0.0
- spryker/propel-orm: ^1.0.0
- spryker/publisher-extension: ^1.0.0
- spryker/storage: ^3.0.0
- spryker/store: ^1.0.0
- spryker/synchronization: ^0.2.0 || ^1.0.0
- spryker/synchronization-behavior: ^1.0.0
- spryker/synchronization-extension: ^1.1.0
- spryker/transfer: ^3.25.0
- valantic-spryker/price-product-customer-group: ^0.10.0
- valantic-spryker/price-product-customer-group-storage-extension: ^0.4.0
Requires (Dev)
Suggests
- spryker/event: If you want to use Event plugins, minimum required version: 2.1.0
This package is auto-updated.
Last update: 2025-01-09 13:07:15 UTC
README
This modules is used for saving customer group prices into storage and contains plugins for reading them.
Install package
composer req valantic-spryker/price-product-customer-group-storage
Register plugins
src/Pyz/Zed/Event/EventDependencyProvider.php
use ValanticSpryker\Zed\PriceProductCustomerGroupStorage\Communication\Plugin\Event\Subscriber\PriceProductCustomerGroupStorageEventSubscriber;
...
public function getEventSubscriberCollection()
{
...
$eventSubscriberCollection->add(new PriceProductCustomerGroupStorageEventSubscriber());
...
}
src/Pyz/Zed/Synchronization/SynchronizationDependencyProvider.php
use \ValanticSpryker\Zed\PriceProductCustomerGroupStorage\Communication\Plugin\Synchronization\PriceProductAbstractCustomerGroupSynchronizationDataBulkPlugin
use \ValanticSpryker\Zed\PriceProductCustomerGroupStorage\Communication\Plugin\Synchronization\PriceProductConcreteCustomerGroupSynchronizationDataBulkPlugin
...
protected function getSynchronizationDataPlugins(): array
{
return [
...
new PriceProductAbstractCustomerGroupSynchronizationDataBulkPlugin(),
new PriceProductConcreteCustomerGroupSynchronizationDataBulkPlugin(),
];
}
src/Pyz/Client/PriceProductStorage/PriceProductStorageDependencyProvider.php
use ValanticSpryker\Client\PriceProductCustomerGroupStorage\Plugin\PriceProductStorageExtension\PriceProductCustomerGroupStorageDimensionPlugin;
...
public function getPriceDimensionStorageReaderPlugins(): array
{
return [
...
new PriceProductCustomerGroupStorageDimensionPlugin(),
];
}
src/Pyz/Zed/EventBehavior/EventBehaviorDependencyProvider.php
use ValanticSpryker\Zed\PriceProductCustomerGroupStorage\Communication\Plugin\Event\PriceProductAbstractCustomerGroupEventResourceBulkRepositoryPlugin;
use ValanticSpryker\Zed\PriceProductCustomerGroupStorage\Communication\Plugin\Event\PriceProductConcreteCustomerGroupEventResourceBulkRepositoryPlugin;
...
protected function getEventTriggerResourcePlugins()
{
return [
...
new PriceProductAbstractCustomerGroupEventResourceBulkRepositoryPlugin(),
new PriceProductConcreteCustomerGroupEventResourceBulkRepositoryPlugin(),
];
}
Create project level module config
src/Pyz/Zed/PriceProductCustomerGroupStorage/PriceProductCustomerGroupStorageConfig.php
<?php
declare(strict_types = 1);
namespace Pyz\Zed\PriceProductCustomerGroupStorage;
use Pyz\Zed\Synchronization\SynchronizationConfig;
use ValanticSpryker\Zed\PriceProductCustomerGroupStorage\PriceProductCustomerGroupStorageConfig as VsyPriceProductCustomerGroupStorageConfig;
class PriceProductCustomerGroupStorageConfig extends VsyPriceProductCustomerGroupStorageConfig
{
/**
* @return string|null
*/
public function getPriceProductConcreteCustomerGroupSynchronizationPoolName(): ?string
{
return SynchronizationConfig::DEFAULT_SYNCHRONIZATION_POOL_NAME;
}
/**
* @return string|null
*/
public function getPriceProductAbstractCustomerGroupSynchronizationPoolName(): ?string
{
return SynchronizationConfig::DEFAULT_SYNCHRONIZATION_POOL_NAME;
}
}
Enable event behavior
src/Pyz/Zed/PriceProductCustomerGroup/Persistence/Propel/Schema/vsy_price_product_customer_group.schema.xml
<?xml version="1.0"?>
<database
xmlns="spryker:schema-01"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
name="zed"
xsi:schemaLocation="spryker:schema-01 https://static.spryker.com/schema-01.xsd"
namespace="Orm\Zed\PriceProductCustomerGroup\Persistence"
package="src.Orm.Zed.PriceProductCustomerGroup.Persistence"
>
<table name="vsy_price_product_customer_group">
<behavior name="event">
<parameter name="vsy_price_product_customer_group_all" column="*"/>
</behavior>
</table>
</database>
Migrate database and generate transfers
propel:install
, transfer:generate