# mageplaza/module-same-order-number

> Magento 2 Same Order Number Extension

`composer require mageplaza/module-same-order-number`

Canonical URL: https://packagento.com/mageplaza/module-same-order-number

## At a glance

- **Vendor**: mageplaza (https://packagento.com/mageplaza.md)
- **Latest version**: 4.0.2 — released 2025-07-15
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/mageplaza/module-same-order-number and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require mageplaza/module-same-order-number:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magento 2 Same Order Number Extension

## README


[Magento 2 Same Order Number Extension](https://www.mageplaza.com/magento-2-same-order-number/) by **Mageplaza** allows store owners to easily create the ID of Invoice, Shipment and Credit Memo the same as the ID of the original Order. This will significantly contribute to a well-managed order information system.

[![Latest Stable Version](https://poser.pugx.org/mageplaza/module-same-order-number/v/stable)](https://packagist.org/packages/mageplaza/module-same-order-number)
[![Total Downloads](https://poser.pugx.org/mageplaza/module-same-order-number/downloads)](https://packagist.org/packages/mageplaza/module-same-order-number)


### 1. Documentation
- [Installation guide](https://www.mageplaza.com/install-magento-2-extension/)
- [User guide](https://docs.mageplaza.com/same-order-number/index.html)
- [Introduction page](http://www.mageplaza.com/magento-2-same-order-number/)
- [Contribute on Github](https://github.com/mageplaza/magento-2-same-order-number)
- [Get Support](https://github.com/mageplaza/magento-2-same-order-number/issues)

### 2. FAQs

### 3. How to install Magento 2 Same Order Number Extension

- Install via composer (recommend)

Run the following command in Magento 2 root folder:

With Marketing Automation (recommend):
```
composer require mageplaza/module-same-order-number mageplaza/module-smtp
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
```

Without Marketing Automation:
```
composer require mageplaza/module-same-order-number
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
```

### 4. Highlight Features

#### Automatically same order ID update for billing documents

**[Magento 2 Same Order Number](https://marketplace.magento.com/mageplaza-module-same-order-number.html) by Mageplaza** helps create the ID number for billing documents, associated with the ID of the original order after customers purchase. Documents that are possible to be set with the same order number are Invoice, Shipment and Credit Memo.

![Magento 2 Same Order Number](https://i.imgur.com/5B3YhmK.png)

#### Automatically add the extra suffix

In case there are more than one Shipments, Invoices or Credit Memos for a single Order, the system will automatically create an extra suffix for the next shipments, start from the second one. For instance, Order ID is #100, the ID of Invoice will accordingly be #100, and from the next one, the ID of the second Invoice will be #100-1, the third will be #100-2, and so on.

![Magento 2 Same Order Number extension](https://i.imgur.com/UaKwdCd.png)

#### Billing documents united pack

The Invoice, Shipment and Credit Memo with the same increment IDs can be well displayed on the frontend. The united pack of billing documents allows both admin and customer to follow and track the order information easily and conveniently.

![Magento 2 Same Order Number module](https://i.imgur.com/1FOyZG1.png)

### 5. Full Magento 2 Same Order Number Features

#### For store owners

- Enable/disable the module
- Select billing documents (Shipment/Invoice/Credit Memo) to set ID according to the Order ID
- Create an extra suffix for multiple billing documents of a single Order
- Be compatible with any payment methods that create automated invoices
- Work well with [Mageplaza PDF Invoice](https://www.mageplaza.com/magento-2-pdf-invoice-extension/)

#### For customers

- Easy to follow and manage the relationships among billing documents
- View the record from the frontend, from the customer's login account.

### 6. Same Order Number User Guide

Login to your Magento Admin Panel, navigate to `Store > Settings > Configuration > Mageplaza Extensions > Same Order Number`.

![same order number4](https://i.imgur.com/J3ypdvW.png)

#### 6.1. Same Order Number General Configuration 

![Magento 2 Same Order Number General Configuration](https://i.imgur.com/Aj5GAKj.png)

- **Enable**: Select `Yes` to activate the extension
- **Apply for**: Choose the billing documents to apply the extension. It is possible to apply to Invoice, Shipment and Credit Memo at the same time. 
  - Apply to **Shipment**: ID increment of **Shipment** will be configured the same as ID of the Order. In case there are more than one Shipments for a single Order, the system will automatically create a following suffix for the next shipments,  start from the second one. For instance, Order ID is #003, the ID of Shipment will accordingly be #003, and from the next one, the ID of Shipment will be in a format as follow: #003-1

![Magento 2 Same Order Number Configuration](https://i.imgur.com/Zrn0m0L.png)

- If you do not enable **Same Order Number** for Shipment ID, the ID of Shipment will be set as default.
    
  - Apply to **Invoice**: The ID of the Invoice will be set according to the Order ID.
  
    - **Same Order Number** is also possible to create Invoice ID automatically when purchasing via Paypal.
    
    - In case there are more than one Invoices for a single Order, ID of every next invoice will be added with an extra suffix. For example, when the ID of Order is Order #003, the Invoice ID will be #003 and the second Invoice will be #003-1.

![Mageplaza Same Order Number](https://i.imgur.com/nrlWXgJ.png)

- If you do not enable **Same Order Number** for Invoice ID, the ID of Invoice will be set as default.

  - Apply for **Credit Memo**: ID of Credit Memo will be set according to the Order ID. For Order that have more than one Credit Memos, ID of every next Credit Memo will be automatically added with a suffix. For example, ID of the Order is #003, ID of the Credit Memo will be #003, and the second Credit Memo ID will be #003-1.

![Mageplaza Same Order Number for Magento 2](https://i.imgur.com/6NCxY5U.png)

- If you do not enable **Same Order Number** for Credit Memo ID, the ID of Credit Memo will be set as default.
    
#### 6.2. Configuration for multi-stores 

- St

_(README truncated for .md surface. Full README on https://packagento.com/mageplaza/module-same-order-number.)_

## Changelog

CHANGELOG: https://www.mageplaza.com/releases/same-order-number

## Recent Versions

| Version | Released |
|---|---|
| 4.0.2 | 2025-07-15 |
| 4.0.1 | 2021-08-22 |
| 1.0.6 | 2021-08-22 |
| 1.0.5 | 2021-04-06 |
| 1.0.4 | 2020-12-31 |
| 1.0.3 | 2020-06-17 |
| 1.0.2 | 2019-07-11 |
| 1.0.1 | 2018-12-18 |
| 1.0.0 | 2018-12-03 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| mageplaza/module-core | ^1.5.13 |

## Quality

Latest release (4.0.2) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 13 | 13 warnings (ruleset: Magento2) — 8 auto-fixable with phpcbf |
| PHPMD | Warning | 2 | 2 rule violations (UnusedFormalParameter:1, IfStatementAssignment:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 58 | 58 | – | – |
| 2.4.8 | – | 58 | 58 | – |
| 2.4.9 | – | – | 56 | 56 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["mageplaza/module-same-order-number"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

mageplaza is a Magento 2 vendor on Packagento. See https://packagento.com/mageplaza.md for their full catalogue.

