# magepsycho/magento2-custom-shipping

> Magento 2 Custom Shipping

`composer require magepsycho/magento2-custom-shipping`

Canonical URL: https://packagento.com/magepsycho/magento2-custom-shipping

## At a glance

- **Vendor**: magepsycho (https://packagento.com/magepsycho.md)
- **Latest version**: 1.0.5 — released 2022-03-02
- **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/magepsycho/magento2-custom-shipping 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 magepsycho/magento2-custom-shipping:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Magento 2 Custom Shipping

## README

<div align="center">

![Magento 2 Custom Shipping](https://i.imgur.com/d8QEHRb.png)
## Magento 2 Custom Shipping

</div>

<div align="center">

[![Packagist Version](https://img.shields.io/github/v/tag/MagePsycho/magento2-custom-shipping?logo=packagist&sort=semver&label=packagist&style=for-the-badge)](https://packagist.org/packages/magepsycho/magento2-custom-shipping)
[![Packagist Downloads](https://img.shields.io/packagist/dt/magepsycho/magento2-custom-shipping.svg?logo=composer&style=for-the-badge)](https://packagist.org/packages/magepsycho/magento2-custom-shipping/stats)
![Supported Magento Versions](https://img.shields.io/badge/magento-%202.2_|2.3_|_2.4-brightgreen.svg?logo=magento&longCache=true&style=for-the-badge)
![License](https://img.shields.io/badge/license-MIT-green?color=%23234&style=for-the-badge)

</div>

Overview
==================

[Magento 2 Custom Shipping](https://www.magepsycho.com/magento-2-custom-shipping.html) is a sample for Shipping module in Magento 2.   
You can use this module as a base for developing any custom shipping modules.

🛠️ Installation
-------------
**Using Composer**

*Run the commands from the root of the Magento installation*
```
composer require magepsycho/magento2-custom-shipping
```

**Using modman**
```
modman init
modman clone git@github.com:MagePsycho/magento2-custom-shipping.git
```

**Using Zip**
* Download the [Zip File](https://github.com/MagePsycho/magento2-custom-shipping/archive/master.zip)
* Extract & upload the files to `/path/to/magento2/app/code/MagePsycho/CustomShipping/`

After installation by either means, enable the extension by running following commands (again from root of Magento2 installation):
```
php bin/magento module:enable MagePsycho_CustomShipping --clear-static-content
php bin/magento setup:upgrade
```


[Click here to read more on module packaging, installation & activation in Magento 2](http://www.blog.magepsycho.com/install-magento-2-module-from-github-or-bitbucket-repository-using-composer/)

🚀 Screenshots
-----------
![Backend Settings](http://www.blog.magepsycho.com/wp-content/uploads/2015/12/magento2-custom-shipping.png "Backend Settings")
1. Screentshot - Backend Settings

![Checkout Steps 1 - Checkout](http://www.blog.magepsycho.com/wp-content/uploads/2015/11/magento2-custom-shipping-checkout.png "Checkout Steps 1 - Checkout")
2. Checkout Steps 1 - Checkout

![Checkout Steps 2 - Summary](http://www.blog.magepsycho.com/wp-content/uploads/2015/11/magento2-custom-shipping-checkout-summary.png "Checkout Steps 2 - Summary")
3. Checkout Steps 2 - Summary

### Contributors

- Raj KB [Maintainer] [![Twitter Follow](https://img.shields.io/twitter/follow/rajkbnp.svg?style=social)](https://twitter.com/rajkbnp)


![Your Repository's Stats](https://contrib.rocks/image?repo=MagePsycho/magento2-custom-shipping)

### To Contribute
Any contribution to the development of `Magento 2 Custom Shipping` is highly welcome.  
The best possibility to provide any code is to open a [pull request on GitHub](https://github.com/MagePsycho/magento2-custom-shipping/pulls).


### Need Support?
If you encounter any problems or bugs, please create an issue on [GitHub](https://github.com/MagePsycho/magento2-custom-shipping/issues).

Please [visit our store](https://www.magepsycho.com/extensions/magento-2.html) for more FREE / paid extensions OR [contact us](https://magepsycho.com/contact) for customization / development services.

## Recent Versions

| Version | Released |
|---|---|
| 1.0.5 | 2022-03-02 |
| 1.0.4 | 2022-02-07 |
| 1.0.3 | 2022-02-06 |

## Quality

Latest release (1.0.5) 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 | 12 | 12 warnings (ruleset: Magento2) — 9 auto-fixable with phpcbf |
| PHPMD | Pass | 0 |  |
| 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 | 3 | 3 | – | – |
| 2.4.8 | – | 3 | 3 | – |
| 2.4.9 | – | – | 3 | 3 |


### 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=["magepsycho/magento2-custom-shipping"],
  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

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

