Download the PHP package cdmanager/magento-short-order-number without Composer

On this page you can find all versions of the php package cdmanager/magento-short-order-number. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magento-short-order-number

Magento Short Order Number

Latest Stable Version Total Downloads License

A Magento 2 module that shortens newly generated order numbers by subtracting a fixed offset from the raw order sequence value:

The order sequence table is never touched, so MySQL keeps guaranteeing uniqueness and concurrency safety — only the number that is handed out gets shortened. Existing orders are never renumbered.

Why

Order numbers are reused downstream as job reference / purchase order numbers, where a 9-digit number is cumbersome. The offset is chosen so short numbers land in a range that is free in every consuming system (with the default offset they start with 5).

How it works

Magento asks for an order number in exactly one place — the order sequence returned by Magento\SalesSequence\Model\Manager::getSequence('order', $storeId). The module hooks that single point:

Because every order-creating flow goes through that method, the short number is applied consistently to:

Invoice, shipment and credit memo sequences are not affected — they use different entity types and the plugin ignores them.

Not covered: orders written straight into the database

An external backend that writes sales_order rows directly never calls Magento's sequence manager, so it must shorten the number itself. The ChefsDeal storefront backend (Butterfly) mints its number in Basket::getReservedIncrementId() and applies the same offset via Basket::ORDER_NUMBER_SHORTEN_OFFSET.

⚠️ The two offsets must stay in sync. If you change sales/short_order_number/offset here, change the backend constant in the same release — otherwise the two producers hand out numbers from two different ranges.

Requirements

Installation

1. Get the code

Via Composer (Packagist) — in the Magento root directory:

Via Composer (directly from GitHub) — if Packagist is not available yet:

Manually — if the project does not use Composer for modules:

2. Enable it

The module adds no database schema — setup:upgrade only registers it. setup:di:compile is required in production mode because the plugin and the generated ShortSequenceFactory are compiled artifacts.

3. Set the offset

Pick the offset before the first order is placed (see Choosing the offset) and confirm the default matches your sequence:

4. Verify

Create an order in the admin panel, then check that the stored number is short while the sequence keeps counting in the original range:

Expected: increment_id = MAX(sequence_value) − offset, and the sequence value itself is still 9 digits.

Also verify one order end-to-end after install: order confirmation email, customer account / order lookup, invoice, shipping label and every downstream integration (OMS, ERP, accounting) show the same short number.

Configuration

Stores → Configuration → Sales → Sales → Short Order Numbers

Field Config path Default Meaning
Shorten New Order Numbers sales/short_order_number/enabled 1 Master switch. Set to 0 to hand out raw sequence values again.
Offset sales/short_order_number/offset 99500000 Subtracted from the raw order sequence value.

Both settings are store-scoped, so a multi-store setup can shorten only selected stores.

Choosing the offset

The offset determines where new numbers start: start = current sequence value − offset. With a sequence at 100.043.548 and an offset of 99.500.000, numbers start at 543.548.

Before going live, confirm the target range is unused in all systems that store the order number (Magento, ERP/OMS, accounting, job references):

Short numbers only climb from their starting point, so once the range is verified empty it stays collision-free: reaching the historical 9-digit band again would take ~99M orders. Note that the digit count grows normally — after ~456k orders a 6-digit number starting with 5 becomes a 7-digit number starting with 1.

Safety rules built into the shortening

A sequence value is only shortened when all of these hold; otherwise it is returned untouched:

Rollback

New orders immediately go back to the raw 9-digit sequence value. Orders already created with a short number keep it and stay searchable — nothing else changes. To remove the module entirely:

File map

Tests

Notes

License

GPL-3.0-only — see LICENSE.


All versions of magento-short-order-number with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
magento/framework Version ^102.0 || ^103.0 || ^104.0
magento/module-sales Version ^102.0 || ^103.0 || ^104.0
magento/module-sales-sequence Version ^100.3 || ^100.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cdmanager/magento-short-order-number contains the following files

Loading the files please wait ...