Allow configuring profile entity bundle per order type

Created on 13 August 2018, over 6 years ago
Updated 6 February 2025, 16 days ago

Problem/Motivation

Currently it is not possible to maintain different profile fields, form, display etc between order types.
The commerce_order module currently provides single 'customer' profile type which is hardcoded for billing, tax and shipping (in commerce_shipping module).
A good example could be a store selling both digital and physical products and collecting different info for both order types.
Also, third party module developers may want to provide their own order types with a full set of settings (including profile type) which shouldn't affect globals/defaults.

Proposed resolution

Provide profile type configuration options to order type entity. Replace hardcoded references to 'customer' profile type with order type configuration value.
The address field name is hardcoded as well; we should either make sure the field instance always exists for profile types used with Commerce (how?) or make it configurable as well.

Remaining tasks

Discuss, find other modules which could be affected by this change, implement code, unit tests and upgrade path.

User interface changes

New configuration field in order type edit screen.

API changes

Any modules relying on 'customer' profile type should now check profile bundle setting from order type.

Data model changes

The order type configuration entity will include a new profile type entry.

✨ Feature request
Status

Active

Version

2.0

Component

Developer experience

Created by

πŸ‡ΊπŸ‡¦Ukraine abramm Lutsk

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.

  • πŸ‡§πŸ‡¬Bulgaria i.koychev Sofia

    We have a similar issue in the current project we are working on. The website is for branding textile products (T-shirts, sweatshirts, hats, textile bags, backpacks, etc.) with DTF transfers, selling DTF and UV DTF transfers (related to advertising companies) and T-shirts with ready-made prints (related to end individual customers/individuals).
    We have created two similar payment methods/gateways
    (in both cases, we start the order after receiving the bank transfer.)
    Payment method/gateways

    • Individual - Bank transfer for Individual (individual_bank_payment/Manual)
    • Company - Bank transfer for Companies (company_bank_transfer/Manual)

    Depending on the payment method, we want to use different customer profiles, which can be restricted in the payment method.
    Individual

    • Name
    • Surname

    Company (with invoice data)

    • Company name (not required)
    • Tax number/VAT number
    • Company ID
    • Company representative
    • Address

    I'm not sure if this is the right solution in our case but if it is, this functionality could do a good job.

Production build 0.71.5 2024