Problem/Motivation

Shipments currently only store the shipping method id and service id from the rate when the shipment was created/updated. This assumes that shipping methods and services never change. In the real world they at least every couple years. When this happens the record of what service was selected for a shipment is lost as the ids no longer map to anything. If a shipping method plugin is removed, it's services change, or a shipping method deleted the record is lost.

See this issue for a real world example of this in action:
#3569675: Shipping Method Format Fails to Display on Order Summary

Steps to reproduce

Create a shipping method. Create a shipment on an order using a rate generated from that shipping method. Delete the shipping method. The service is now no longer visible.

Proposed resolution

Add a field to the shipment to record the service label from the rate. This will preserve the rate as it was displayed at the time the shipment was created.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rhovland created an issue. See original summary.

jsacksick’s picture

I agree on the pricinciple, but this is a broader issue affecting Commerce in general where references are stored rather than a full record.
The same apply to a product variation being removed after it was purchased, or a promotion for example.

rhovland’s picture

This is true, however this and payment methods are the only places where the site administrator has little control over if that reference stays or goes.

While shipping methods can be disabled, if the underlying plugin vanishes (outdated, obsolete, etc) then it has effectively been deleted.

Product variations can be unpublished and kept. Same with promotions. Profiles don't suffer this problem because a copy is made on the order. Orders copy variations to an order item and that order item stays even if the referenced variation goes away.

tbkot made their first commit to this issue’s fork.

jsacksick’s picture

Status: Active » Reviewed & tested by the community

Looks good to me, wondering if we shouldn't make the view display configurable or is that not needed perhaps?

  • jsacksick committed 99ccd1d7 on 3.x authored by tbkot
    feat: #3570229 Shipments don't store service label
    
    By: rhovland
    By:...
jsacksick’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.