craftcms/commerce

[5.x]: Product Variant Shipping Category dropdown contains categories from all stores

Closed this issue · 2 comments

What happened?

Description

Product Variant Shipping Category dropdown contains categories from all stores, I assume it should only contain the once that belong to the store currently selected in the CP, as selecting a category from a different store breaks the Purchasable->getShippingCategory() as it will return null in case its being called from a different store compared to the selected shipping category. Also not sure how default shipping category gets applied if now they are configured per store.

Steps to reproduce

  1. Setup two stores
  2. Setup one shipping category in the first store, and one in the second one
  3. Go to New Product -> New Product Variant
  4. Check the Shipping Category dropdown

Expected behavior

Should see only shipping categories that are configured for the currently selected store in CP

Actual behavior

Getting all shipping categories

Craft CMS version

5.2.8

Craft Commerce version

5.0.14

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

Thanks for reporting this. It is fixed for the next release.

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

"require": {
  "craftcms/commerce": "5.x-dev#038cbfcde03caf4b0ec322bf90b3e53aeb8921e5",
  "...": "..."
}

Then run composer update.

We will update this ticket once the release is out.