Skip to content

Add docs for replacing the Umbraco Commerce order number generator #6904

@mattbrailsford

Description

@mattbrailsford

In Umbraco Commerce it's possible to replace the in build order number generator if people don't like the format of the order numbers we generate. This is done by implementing the IOrderNumberGenerator

public interface IOrderNumberGenerator
{
    string GenerateCartNumber(Guid storeId);
    string GenerateOrderNumber(Guid storeId);
}

Once implemented, you replace the built in implementation by following the guide here for how to replace dependencies https://docs.umbraco.com/umbraco-commerce/key-concepts/dependency-injection#replacing-dependencies, using the code

builder.Services.AddUnique<IOrderNumberGenerator, MyOrderNumberGenerator>();

In the docs we should probably copy a bunch of the note logged in this forum issue as there are some very important points people should be aware of

https://our.umbraco.com/packages/website-utilities/vendr/vendr-support/102060-changing-order-number-format

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions