fond-of-spryker / data-fixer-product
不适用
1.0.7
2020-04-30 06:42 UTC
Requires
- php: >=7.1
- fond-of-spryker/data-fixer: ^1.0.0
- fond-of-spryker/product: ^1.1.0
- spryker/availability-storage: ^1.2.0
- spryker/stock: ^5.0.0
- spryker/store: ^1.0.0
Requires (Dev)
- codeception/codeception: ^2.3
- mikey179/vfsstream: ^1.6
- php-coveralls/php-coveralls: ^2.0
- phpro/grumphp: ^0.14
- phpunit/phpunit: 7.1.0
- sebastian/phpcpd: ^4.0
- spryker/code-sniffer: ^0.11
This package is auto-updated.
Last update: 2024-09-15 17:52:06 UTC
README
安装
composer require fond-of-spryker/data-fixer-product
在 DataFixerDependencyProvider 中注册 ProductAvailabilityAndReservationDataFixerPlugin
在 DataFixerDependencyProvider 中注册 ProductAvailabilityAndReservationQuantityDataFixerPlugin
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return array
*/
public function getDataFixer(Container $container): array
{
return [
new ProductAvailabilityAndReservationDataFixerPlugin(),
new ProductAvailabilityAndReservationQuantityDataFixerPlugin(),
];
}
配置
IDSTORE => ['SKUPREFIX']
// ---------- DataFixerProduct
$config[DataFixerProductConstants::DATA_FIXER_PRODUCT_AVAILABILITY_DATA_SKU_PREFIX] = [
1 => ['AFZ%', 'HAP%'],
4 => ['PP%', 'W-%'],
5 => ['ERG-%'],
6 => ['SAT-%'],
];
用法
删除当前商店所有错误的可用性和产品预订。
vendor/bin/console data-fixer:fix -f ProductAvailabilityAndReservationWrongStoreRelationRemover
APPLICATION_STORE=STORENAME vendor/bin/console data-fixer:fix -f ProductAvailabilityAndReservationWrongStoreRelationRemover
将所有产品预订重置为当前商店的产品库存
vendor/bin/console data-fixer:fix -f ProductAvailabilityAndReservationQuantity
APPLICATION_STORE=STORENAME vendor/bin/console data-fixer:fix -f ProductAvailabilityAndReservationQuantity