Shipping checkout flow setting is not recognized until first order with shipment is placed

Created on 6 October 2021, about 3 years ago
Updated 5 February 2024, 9 months ago

Problem/Motivation

When spinning up a fresh site with commerce shipping, the shipping checkout flow is not respected until after the first order is placed with a shippment. The default checkout flow is recognized instead. Once an order is placed and a shipment is created then the shipping checkout flow is recognized.

Steps to reproduce

  1. Install Commerce shipping in fresh environment with no orders with shipments.
  2. In the Order type, check Enable shipping for this order type.
  3. In the Order type, set the checkout flow to Shipping. Save.
  4. In the Shipping checkout flow make sure shipping information is enabled. Place it in order information.
  5. In the Default checkout flow make sure shipping information is disabled.
  6. Edit your variation type so that it is shippable. Save.
  7. Create a flat rate method with no restrictions, enabled. Save.
  8. Add a product to the cart, click checkout. You will see no shipping information pane in the order information region. Instead you are seeing the Default checkout flow.
  9. Adjust some things in the default checkout flow to confirm. Even though the checkout flow is set to Shipping, it is using the Default checkout flow.

Complete the order, and now your shipping checkout flow will be recognized on the next order.

Proposed resolution

We should probably fix it.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom fonant

    Don't know if this is related, but a site I migrated from Drupal 7 to Drupal 9 was failing to display shipping panes for orders.

    Turns out I was missing the order shipments field configuration. It seems this is added pragmatically on installing the commerce_shipping module, and I wasn't including it in my site configuration.

    Adding these two configuration files re-instated the field and shipping works!

    field.storage.commerce_order.shipments.yml
    field.field.commerce_order.default.shipments.yml

  • πŸ‡ΊπŸ‡ΈUnited States wheelercreek

    I was having the same problem and #5 fixed it for me. I'm running Drupal 10.2.2, and commerce shipping 8.x-2.7.

    Mine was a fresh install (not an upgrade). If you go to Configuration > Orders > Order Types and then click to fields, there should be a field there for shipments.
    (/admin/commerce/config/order-types/default/edit/fields)

    For some reason my install was missing this field. I had a Drupal 9 site running drupal commerce with almost the same setup, and I was able to export the needed config files and then imported them into my D10 site, and now the shipping information is showing up on my Order Information page on checkout.

  • πŸ‡ΊπŸ‡ΈUnited States wheelercreek

    In case it helps someone else you need to import these two .yml files:

    field.storage.commerce_order.shipments.yml

    langcode: en
    status: true
    dependencies:
      module:
        - commerce_order
        - commerce_shipping
    id: commerce_order.shipments
    field_name: shipments
    entity_type: commerce_order
    type: entity_reference
    settings:
      target_type: commerce_shipment
    module: core
    locked: true
    cardinality: -1
    translatable: false
    indexes: {  }
    persist_with_no_fields: false
    custom_storage: false

    field.field.commerce_order.default.shipments.yml

    langcode: en
    status: true
    dependencies:
      config:
        - commerce_order.commerce_order_type.default
        - field.storage.commerce_order.shipments
    id: commerce_order.default.shipments
    field_name: shipments
    entity_type: commerce_order
    bundle: default
    label: Shipments
    description: ''
    required: false
    translatable: false
    default_value: {  }
    default_value_callback: null
    settings:
      handler: 'default:commerce_shipment'
      handler_settings: {  }
    field_type: entity_reference
    
  • πŸ‡©πŸ‡ͺGermany AlMiesel Berlin

    I am stuck at the same point.
    I have updated from 9 to 10 and now users can`t get past login information.

    How do I import these files and where. Thanks for any help.

Production build 0.71.5 2024