PHPackages                             scriptbaker/magento2-ship-out-of-stock-items - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. scriptbaker/magento2-ship-out-of-stock-items

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

scriptbaker/magento2-ship-out-of-stock-items
============================================

This Magento 2 module allows the creation of shipments for orders containing items that are out of stock. In default Magento, attempting to create a shipment for an order with out-of-stock items results in the error: "Not all of your products are available in the requested quantity." This module remedies that problem by adjusting the stock quantities to ensure the shipment can be processed.

3101PHP

Since May 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/scriptbaker/magento2-ship-out-of-stock-items)[ Packagist](https://packagist.org/packages/scriptbaker/magento2-ship-out-of-stock-items)[ RSS](/packages/scriptbaker-magento2-ship-out-of-stock-items/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Scriptbaker\_ShipOutOfStockItems
================================

[](#scriptbaker_shipoutofstockitems)

Overview
--------

[](#overview)

The `Scriptbaker_ShipOutOfStockItems` module for Magento 2 allows the creation of shipments for orders containing items that are out of stock. In default Magento, attempting to create a shipment for an order with out-of-stock items results in the error: "Not all of your products are available in the requested quantity." This module remedies that problem by adjusting the stock quantities to ensure the shipment can be processed.

Features
--------

[](#features)

- Enables shipment creation for out-of-stock items.
- Automatically adjusts stock quantities to allow for shipment processing.
- Seamlessly integrates with Magento's Multi-Source Inventory (MSI) system.

Installation
------------

[](#installation)

1. **Download the Module:**Download the module package or clone the repository into the `app/code/Scriptbaker/ShipOutOfStockItems` directory.
2. **Enable the Module:**

    ```
    bin/magento module:enable Scriptbaker_ShipOutOfStockItems
    ```
3. **Run Setup Upgrade:**

    ```
    bin/magento setup:upgrade
    ```
4. **Clear Cache:**

    ```
    bin/magento cache:clean
    ```

Usage
-----

[](#usage)

Once the module is installed and enabled, it will automatically adjust stock quantities to allow for the creation of shipments for out-of-stock items. No additional configuration is necessary.

Implementation Details
----------------------

[](#implementation-details)

The module listens to two key events and adjusts the stock quantities accordingly:

1. **`sales_order_shipment_save_before`:**
    - Adjusts stock quantities before the shipment is created to ensure it can be processed without errors.
2. **`sales_order_shipment_save_after`:**
    - Updates stock quantities after the shipment is saved to reflect the accurate inventory levels.

Files Included
--------------

[](#files-included)

- `registration.php`: Registers the module with Magento.
- `etc/module.xml`: Declares the module and its version.
- `etc/events.xml`: Registers the observers for the `sales_order_shipment_save_before` and `sales_order_shipment_save_after` events.
- `Observer/AlwaysShipOrder.php`: Contains the logic for adjusting stock quantities before shipment creation.
- `Observer/UpdateStockAfterShipment.php`: Contains the logic for updating stock quantities after the shipment is saved.

Observer Logic
--------------

[](#observer-logic)

### `AlwaysShipOrder`

[](#alwaysshiporder)

The `AlwaysShipOrder` observer performs the following actions:

1. Retrieves all items in the shipment.
2. For each item, checks the available stock quantity.
3. If the stock quantity is less than the requested shipment quantity, it adjusts the stock quantity to meet the shipment requirement.
4. Saves the updated stock quantity using the `SourceItemsSaveInterface`.

### `UpdateStockAfterShipment`

[](#updatestockaftershipment)

The `UpdateStockAfterShipment` observer performs the following actions:

1. Retrieves all items in the shipment.
2. Updates the stock quantities after the shipment is saved to reflect accurate inventory levels.
3. Ensures that the inventory system is up-to-date with the changes caused by the shipment.

Contributing
------------

[](#contributing)

If you wish to contribute to this module, please fork the repository and submit a pull request with your changes. All contributions are welcome.

Support
-------

[](#support)

If you encounter any issues or have any questions regarding the module, please open an issue on the repository or contact us at \[\].

License
-------

[](#license)

This module is open-source and licensed under the MIT License.

---

Thank you for using `Scriptbaker_ShipOutOfStockItems`. We hope it helps improve your Magento 2 experience.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/43dabc5a5d623c5f5e58448549897da921df672ed4fe9456f7d4827a999ccbb4?d=identicon)[tahiryasin](/maintainers/tahiryasin)

---

Top Contributors

[![tahiryasin](https://avatars.githubusercontent.com/u/2690391?v=4)](https://github.com/tahiryasin "tahiryasin (1 commits)")

### Embed Badge

![Health badge](/badges/scriptbaker-magento2-ship-out-of-stock-items/health.svg)

```
[![Health](https://phpackages.com/badges/scriptbaker-magento2-ship-out-of-stock-items/health.svg)](https://phpackages.com/packages/scriptbaker-magento2-ship-out-of-stock-items)
```

###  Alternatives

[meetanshi/magento-2-defer-parsing-javascript

Magento 2 DeferJS

114.0k](/packages/meetanshi-magento-2-defer-parsing-javascript)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
