Skip to content

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

Open
@tommysvr

Description

@tommysvr

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions