craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
219 stars 170 forks source link

[5.x]: Inventory overview with multi-site/store and propagated products #3706

Open white-lukas opened 6 days ago

white-lukas commented 6 days ago

What happened?

Description

I have the following site/structure setup

Both sites share the same product type but with a propagation method Save products to other sites in the same site group

When I now go to the Inventory overview (commerce/inventory/levels) I see the Inventory location A as default, but it also tries to show the inventory items of the products from Site B which is empty Image Image When trying to set the stock I can see it's a product from the other site, which doesn't exist on the currently selected site

In the breadcrumbs I can also both switch Sites as Inventory locations event when each site/store only has 1 inventory location.

I would expect to only see the inventory location which is mapped to the selected site and only the inventory items which are available for that selected site

Steps to reproduce

  1. create a site setup like described above
  2. create a product in each site
  3. go to the inventory overview

Expected behavior

  1. In the breadcrumbs only have the inventory locations that are assigned to the store
  2. See only the products that are created in the site instead of all (non) propagated variants

Actual behavior

You can select an inventory location which is not available for the selected site, this might lead to updating stock in the wrong location

Only see the variants that are available in the selected site instead of seeing a lot of blank entries

Craft CMS version

5.4.5

Craft Commerce version

5.1.3

PHP version

8.3.12

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

-

linear[bot] commented 6 days ago

PT-2191 [5.x]: Inventory overview with multi-site/store and propagated products

lukeholder commented 2 days ago

We have fixed the display bug of missing inventory item descriptions and SKU, when you have a site selected where those inventory items are not published.

Inventory management is independent of sites and stores, it is per location only, so the site switcher is only relevant to showing the inventory item's purchasable 'chip' with convenience links to edit the variant in that site.

We are considering removing the site switcher from that screen in the future but will keep it the same for now, and make improvements larger changes in the future.

To get the fix early, change your craftcms/commerce requirement in composer.json to:

"require": {
  "craftcms/commerce": "5.x-dev#41178349862cb6864088b6c0fd90eecd9cd3c349 as 5.1.3",
  "...": "..."
}

Then run composer update.

We will update this ticket once the release is out.