alpin11 / coreshop-advanced-inventory-bundle
通过实用的模式和工具扩展库存和可用性检查
v1.0.0
2020-05-08 11:38 UTC
Requires
- php: ^7.2
- coreshop/inventory-bundle: ^2.0
This package is auto-updated.
Last update: 2024-09-08 21:09:05 UTC
README
此包向可用性检查器添加了一些简单但有效的更改。它需要coreshop/inventory-bundle存储库,该存储库将自动安装。
待办事项
✅ 将自定义可用性检查器注册为服务
➡️ 添加缓存可用性检查的基本工具包(例如从API获取库存水平)
安装
1. Composer
composer require alpin11/coreshop-advanced-inventory-bundle
2. 激活
在Pimcore扩展管理器或通过CLI中启用该包
bin/console pimcore:bundle:enable CoreShopAdvancedInventoryBundle
3. 设置
添加一个具有接口CoreShop\Bundle\AdvancedInventoryBundle\Checker\AvailabilityCheckerInterface
的自定义可用性检查器类
然后注册您的类作为服务,并使用coreshop.inventory.availability_checker
进行标记
AppBundle\CoreShop\Inventory\Checker\MyAvailabilityChecker: tags: - { name: coreshop.inventory.availability_checker, priority: 200 }
4. 完成
该包自动覆盖了coreshop.inventory.availability_checker.default
,因此您不需要更新任何服务。它还使别名公开,因此您可以直接通过容器访问它。