Problem/Motivation

Currently, we have the following code for packing the order into shipments:

if (!$shipments) {
        /** @var \Drupal\commerce_shipping\PackerManagerInterface $packer_manager */
        // @phpstan-ignore-next-line
        $packer_manager = \Drupal::service('commerce_shipping.packer_manager');
        [$shipments] = $packer_manager->packToShipments($order, $this->buildCustomerProfile($order), $shipments);
      }

This should call the ShippingOrderManager instead which should be conditionally injected.

Also, the buildCustomerProfile() shouldn't create a profile that has the UID set to the order customer ID as the profile belongs to the order, not the customer.

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

jsacksick created an issue. See original summary.

  • jsacksick committed 81394b3c on 8.x-1.x
    Issue #3535829 by jsacksick: Rely on the shippingOrderManager to pack...
jsacksick’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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