The adjustments field is unused, we can remove it, along with the related methods and interface.

(We initially thought that taxes & promotions would be added directly to the relevant shipment, but they will be added to the order instead).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz created an issue. See original summary.

vasike’s picture

Status: Active » Needs review
FileSize
5.44 KB

here is patch for this.
Are there other changes (related) needed for this issue?

p.s.: btw, isn't a similar issue for Commerce core Order item entity?

bojanz’s picture

Status: Needs review » Needs work

We're missing an update hook (hook_update) that will remove the adjustments field on existing sites.

vasike’s picture

Status: Needs work » Needs review
FileSize
6.11 KB

ofcourse
here is a new patch with the update hook

  • bojanz committed 5d6860e on 8.x-2.x authored by vasike
    Issue #2865542 by vasike: Remove shipping adjustments
    
bojanz’s picture

Status: Needs review » Fixed

Improved the update function and committed. Thanks!

Status: Fixed » Closed (fixed)

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

finne’s picture

Ha! I have a use case where invoices are sent per shipment, and therefor taxes and promotions need to be calculated per shipment. I think I need shipment adjustments :-)

I might want to use the removed code here.

bojanz’s picture

You probably don't.
All you need to do is ensure your taxes and promotions are calculated per order item, and you're good to go. A shipment just bundles order items.

a.dmitriiev’s picture

FileSize
553 bytes

I had really old installation and updating now caused the error because update 8200 doesn't state the name of the field to update. The original patch from #2 and #4 was doing it properly, but commit https://www.drupal.org/commitlog/commit/18412/5d6860ede48a225bf1400882fb... has lost the name.

Attaching the patch here and not in a new issue, because I think nobody else will need such an "old" update.