Order Extension

You can access the employee and sales representative`s information on orders from the new b2bOrderExtension:

Associations to get the data via the API or the DAL.

Associations via DAL

$criteria->addAssociations([
    'b2bOrderExtension.employee',
    'b2bOrderExtension.salesRepresentative'
]);

Associations via API

{
  associations: {
    b2bOrderExtension: {
      associations: {
        employee: {},
        salesRepresentative: {}
      }
    }
  }
}

The data can then be found under the "extensions" as "b2bOrderExtension".

{
  id: "...",
  orderNumber: "...",
  ...,
  extensions: {
    b2bOrderExtension: {
      employeeId: "...",
      salesRepresentativeId: "...",
      employee: {...},
      salesRepresentative: {...},
      ...
    }
  }
}

Last updated