From b109886bb224167477eabd8c41bea7a20f4dde0e Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Mon, 31 Oct 2022 14:32:09 +0100 Subject: [PATCH] [Docs] Update inventory source resolving --- docs/book/products/multi_source_inventory.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/book/products/multi_source_inventory.rst b/docs/book/products/multi_source_inventory.rst index 04b8753f29..27a7325d34 100644 --- a/docs/book/products/multi_source_inventory.rst +++ b/docs/book/products/multi_source_inventory.rst @@ -59,15 +59,16 @@ Inventory Source resolving The current implementation provides one main resolver, that can use multiple inventory sources filters. -There are two filters provided by default: +There are three filters provided by default: * *Sufficient*, with ``priority = 0``, that provides all inventory sources able to handle all ordered products; * *EnabledChannel*, with ``priority = 8``, that provides inventory sources enabled for the current channel; +* *Priority*, with ``priority = -256``, that sorts filtered inventory sources based on their priority; Filters always return an array of inventory sources, however resolver picks the first of them or throws an ``UnresolvedInventorySource`` exception if no inventory source can be resolved. -It's possible to add more inventory sources filter, with higher or lower priority. Such a service must implement Sylius\Plus\Inventory\Application\Filter\InventorySourcesFilterInterface and be registered with sylius_plus.inventory.inventory_sources_filter tag, with priority attribute set. +It's possible to add more inventory sources filter, with higher or lower priority. Such a service must implement ``Sylius\Plus\Inventory\Application\Filter\InventorySourcesFilterInterface`` and be registered with ``sylius_plus.inventory.inventory_sources_filter`` tag, with priority attribute set. .. note:: @@ -102,6 +103,7 @@ This fixture creates Inventory Sources without products (empty) enabled in chose hamburg_warehouse: code: 'hamburg_warehouse' name: 'Hamburg Warehouse' + priority: 10 channels: - 'HOME_WEB' - 'FASHION_WEB'