commerce icon indicating copy to clipboard operation
commerce copied to clipboard

[5.x]: Update a purchasable's `shippingCategoryId` when a Shipping Category is saved

Open tommysvr opened this issue 9 months ago • 1 comments

What happened?

Description

When you change the available product types on a shipping category, it doesn't update existing purchasables of that type.

Steps to reproduce

  1. Create 2 Shipping Categories and apply them to a Product Type (one category will be set to the default)
  2. Create a Product of the Type and set the Shipping Category to the non-default one
  3. Now remove that product type from the 'Available Product Types' setting on the Shipping Category
  4. The shippingCategoryId column in the commerce_purchasables_stores table will not be updated

Expected behavior

When you resave the Shipping Category, it should update the data if there is a change

Actual behavior

The data is not change, meaning purchasables are still set shipping categories that are no longer available to it

Craft CMS version

5.7.7

Craft Commerce version

5.3.13

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

tommysvr avatar May 23 '25 02:05 tommysvr

Commerce 5.5 has now been released with this updated included.

Thanks!

nfourtythree avatar Nov 19 '25 08:11 nfourtythree