# etechflow/module-shipping-table-rates

> Flexible shipping table rates for Magento 2 with a visual rule builder, live cart simulator, versioned rate sets, conflict detection, native MSI, and Hyvä support. Designed to be the merchant-friendly alternative to Amasty / MageWorx Shipping Table Rates.

`composer require etechflow/module-shipping-table-rates`

Canonical URL: https://packagento.com/etechflow/module-shipping-table-rates

## At a glance

- **Vendor**: etechflow (https://packagento.com/etechflow.md)
- **Latest version**: 1.3.2 — released 2026-06-22
- **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/etechflow/module-shipping-table-rates 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 etechflow/module-shipping-table-rates:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Flexible shipping table rates for Magento 2 with a visual rule builder, live cart simulator, versioned rate sets, conflict detection, native MSI, and Hyvä support. Designed to be the merchant-friendly alternative to Amasty / MageWorx Shipping Table Rates.

## README

**Flexible shipping table rates without the spreadsheet horror.**

Visual rate management. Live cart simulator. One-click rollback. Conflict detection. Native MSI + Hyvä. Designed as the merchant-friendly alternative to Amasty / MageWorx — matching their feature surface, beating them on day-to-day admin UX.

| | Amasty | MageWorx | **eTechFlow** |
|---|---|---|---|
| Community / Open Source | $229/yr | $149/yr | **$129/yr** |
| Adobe Commerce | $529/yr | +$149/yr | **$299/yr** |
| Magento Cloud | $829/yr | n/a | **$399/yr** |
| Live cart simulator in admin | ❌ | ❌ | ✅ |
| Versioning + one-click rollback | ❌ | ❌ | ✅ |
| Conflict detection on save | ❌ | ❌ | ✅ |
| Human-readable CSV columns | ❌ (PPP/FRPP/FRPUW) | partial | ✅ |
| Native MSI | bolt-on package | partial | ✅ |
| Hyvä Checkout | ✅ | partial | ✅ |
| CLI smoke-test command | ❌ | ❌ | ✅ |

---

### What it does

Adds an unlimited number of shipping methods to your Magento 2 / Adobe Commerce checkout, each driven by table rates with rich conditions:

- **Destination**: country, region, city, postcode range (alphanumeric — UK / Canada / Netherlands work)
- **Cart**: weight range, qty range, subtotal range
- **Customer**: customer group(s)
- **Product**: a `shipping_type` attribute (seeded with Standard / Fragile / Oversized / Hazmat / Cold Chain — extensible)
- **Rate formula**: base + per-product + per-kg + percent of subtotal, combined freely, with method-level min/max clamps and per-multi-type-cart aggregation (sum / min / max)

### Requirements

| | |
|---|---|
| **Magento** | Open Source 2.4.4+ OR Adobe Commerce 2.4.4+ |
| **PHP** | 8.1, 8.2, 8.3, or 8.4 |
| **Compatible themes** | Luma + Hyvä + Hyvä Checkout |
| **MSI** | Supported transparently via standard carrier contract |

### Installation

#### Option A — Composer (recommended)

```bash
composer require etechflow/module-shipping-table-rates:^1.0
bin/magento module:enable ETechFlow_ShippingTableRates
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

#### Option B — Manual (from zip)

1. Unzip `etechflow-module-shipping-table-rates-1.0.0.zip` into:
   ```
   <magento-root>/app/code/ETechFlow/ShippingTableRates/
   ```
   **The directory MUST be named `ETechFlow` (capital E, capital T, capital F) — case-sensitive on Linux servers.**

2. Enable and set up:
   ```bash
   bin/magento module:enable ETechFlow_ShippingTableRates
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

3. Verify:
   ```bash
   bin/magento module:status | grep ShippingTableRates
   ```

### After install — 4-step setup

#### Step 1 — Enter your licence key

Admin → **Stores → Configuration → eTechFlow → Shipping Table Rates → License**

Paste the key from your purchase email.

> **Don't have a key yet?** Free on dev/staging environments — any host matching `localhost`, `*.test`, `*.local`, `staging.*`, `*.magento.cloud`, ngrok, or RFC 1918 IPs runs at full features without a licence. For non-standard dev domains, set **Production Environment = No** instead.

#### Step 2 — Verify the module is active

The "Module Status" banner at the top of the config section will show ✅ **Module is active** (or one of 5 other diagnostic states with what-to-do guidance).

#### Step 3 — Create your first method

Admin → **Sales → Operations → Shipping Table Rates → Add New Method**

Fill in:
- **Code**: stable machine identifier (`uk_standard`, `eu_express`)
- **Name**: customer-facing label at checkout
- **Active**: Yes
- **Sort Order**: 10 (lower = higher up in checkout list)
- **Min / Max Rate**: optional clamps
- **Multi-Type Handling**: `sum` (default) / `min` / `max` — only matters when rates target specific `shipping_type` values

Save. The Rate Rules + Versions + Simulator + CSV panels appear below.

#### Step 4 — Add rate rules

**Option A — Inline editor** (best for a few rules):
Click **Add Rate Rule** on the method edit page. Fill in the conditions you want (leave blank for "any"), the rate components, and Save.

**Option B — CSV import** (best for bulk):
Click **Download CSV** to get the column template, edit in your spreadsheet editor, upload via **Upload + Import**. Choose **Replace** or **Append**.

### Key admin features (all on the method edit page)

| Panel | What it does |
|---|---|
| **Rate Rules** | List + add + edit + delete individual rules. Each row shows conditions in a compact view + the formula + per-row Edit / Delete. |
| **CSV Import / Export** | Bulk-edit via spreadsheet. Round-trips cleanly — export, edit, re-import. Per-row validation with all errors collected before any rows are written. |
| **Live Cart Simulator** | Type a hypothetical cart (country / weight / qty / subtotal / shipping types), click Simulate. See exactly which methods match, the total cost, which rate row contributed, and the formula breakdown. Replaces the "drive a real checkout to debug" workflow. |
| **Version History** | Lists the 25 most recent snapshots with one-click Restore. Every save / import / delete creates a snapshot. Rollback itself snapshots first — undo-the-undo works. |

### CLI verification

```bash
bin/magento etechflow:str:simulate \
    --country=GB \
    --postcode="SW1A 1AA" \
    --weight=5 --qty=3 --subtotal=100 \
    --customer-group=1 \
    --shipping-types=fragile,standard
```

Prints structured output showing which methods matched, total cost, winning rate IDs, formula breakdown. Exit code 0 on match, 1 on no match — drop into CI / monitoring.

### Documentation

| File | Read when |
|---|---|
| `README.md` (this file) | First — overview + install + 4-step setup |
| `docs/USER_GUIDE.md` | Full reference: every field, every condition, every CSV column, troubleshooting |
| `CHANGELOG.md` | What changed in each version |
| `LICENSE.txt` | Licence terms |

### Bundle pricing

_(README truncated for .md surface. Full README on https://packagento.com/etechflow/module-shipping-table-rates.)_

## Changelog

All notable changes to this module. Adheres to [Semantic Versioning](https://semver.org/).

---

### [1.2.0] — 2026-06-04 — Stripe portal licensing + v1.1.1 bug fixes

#### Added

- **Stripe-portal subscription licensing.** Adds the SP-XXXX subscription-key flow to STR — the same pattern shipped with `ETechFlow_BackorderEtaDisplay` v1.3.0 and `ETechFlow_NextDayEligibility` v1.8.0. Three billing-period plans (Weekly $9/wk, Monthly $29/mo, Yearly $290/yr — same shape as `ETechFlow_DeliveryDate`) with in-admin Stripe Checkout, automatic key activation, portal-validated server-IP enforcement, and 48-hour offline grace when the portal is unreachable. HMAC per-module keys and bundle keys (`LICENSING_PROTOCOL.md`) keep working unchanged for offline activation.
- **License gate page** under **eTechFlow → Shipping Table Rates → License & Plans**. Dark plan-cards UI with "Select Plan & Pay" + "Enter License Key" CTAs. On payment success, the SP-XXXX key is saved to `etechflow_shippingtablerates/license/license_key` automatically.
- **Payment settings group** under Stores → Configuration → eTechFlow → Shipping Table Rates → Payment (Stripe). Accepts Stripe `sk_test`/`sk_live` (Encrypted) + `pk_test`/`pk_live` + currency.
- **Bundle License Key field** in the License group — paste a shared eTechFlow bundle key once to activate every installed eTechFlow module.
- **IP-block auto-management.** When the portal returns `ip_blocked:true`, the licence key is auto-cleared and the `ip_blocked` flag is set; when the IP is re-permitted, the next portal round-trip restores the key from `issued_key` so the module unlocks without admin intervention. A *manual* key clear (without the flag) keeps the module locked, distinguishing the two cases.

#### Fixed

- **`Block/Adminhtml/Method/Edit.php`** — was missing the `Registry` injection, causing the admin Method Edit page to fail with `Undefined property: $_coreRegistry`. Added explicit `__construct(Context, Registry, array)` so the admin Method form actually renders.
- **`Block/Adminhtml/Method/Edit/Simulator.php`** — was reading `$this->_formKey` which doesn't exist on parent `\Magento\Backend\Block\Template`. Replaced with explicit `\Magento\Framework\Data\Form\FormKey` injection, so the Live Cart Simulator panel can submit its AJAX request with the form key.
- **`Block/Adminhtml/Rate/Edit.php`** — same Registry-injection bug as Method/Edit.php. Added `__construct(Context, Registry, array)` so the rate-rule Edit/New form opens without `Undefined property: $_coreRegistry`.
- **`Model/Csv/CsvExporter.php`** — `fputcsv()` was called without the `$escape` parameter on lines 56, 58 and 70, which on PHP 8.4 triggers `Deprecated Functionality: the $escape parameter must be provided as its default value will change`, breaking the CSV download with a fatal in developer mode. Added the `','`, `'"'`, `'\\'` triplet to all three calls so the exporter is PHP 8.4-safe and round-trips cleanly through the importer (which was already correct).

#### Changed

- `Model/LicenseValidator.php` constructor extended from 2-arg (`ScopeConfigInterface`, `StoreManagerInterface`) to **5-arg** with `CacheInterface`, `Curl`, and `WriterInterface`. HMAC per-module + bundle paths remain identical. `MODULE_ID`, `SECRET_FRAGMENTS`, and `BUNDLE_SECRET_FRAGMENTS` constants are preserved byte-identical, so existing per-module HMAC keys and bundle keys continue to validate. Cache TTL is 60s for both valid and reject answers so portal IP-block events propagate within ~60s. Tri-state portal validation (`?bool`) means an explicit portal reject locks immediately — the 48h local grace only applies when the portal is unreachable.

#### Migration

```
composer update etechflow/module-shipping-table-rates
bin/magento setup:upgrade
bin/magento cache:flush
```

_(Changelog truncated for .md surface. Full history on https://packagento.com/etechflow/module-shipping-table-rates.)_

## Recent Versions

| Version | Released |
|---|---|
| 1.3.2 | 2026-06-22 |
| 1.3.1 | 2026-06-22 |
| 1.3.0 | 2026-06-22 |
| 1.2.3 | 2026-06-15 |
| 1.2.0 | 2026-06-04 |
| 1.1.1 | 2026-05-22 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | ^103.0\|\|^104.0 |
| magento/module-catalog | ^104.0\|\|^105.0 |
| magento/module-config | ^101.2\|\|^102.0 |
| magento/module-customer | ^103.0\|\|^104.0 |
| magento/module-directory | ^100.4\|\|^101.0 |
| magento/module-eav | ^102.1\|\|^103.0 |
| magento/module-offline-shipping | ^100.4\|\|^101.0 |
| magento/module-quote | ^101.2\|\|^102.0 |
| magento/module-shipping | ^100.4\|\|^101.0 |
| magento/module-store | ^101.1\|\|^102.0 |
| php | ~8.1.0\|\|~8.2.0\|\|~8.3.0\|\|~8.4.0 |

### Suggest

| Package | Constraint |
|---|---|
| etechflow/module-backorder-eta-display | Pair with Backorder ETA Display to tell customers when backorder items will arrive. |
| etechflow/module-next-day-eligibility | Pair with Next Day Eligibility for stock-aware shipping rules layered on top of the table rates. |
| hyva-themes/magento2-default-theme | Hyvä Theme support is built in. |

## Quality

Latest release (1.3.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 | not tested |


### 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 | Fail | 384 | 21 errors, 363 warnings (ruleset: Magento2) — 97 auto-fixable with phpcbf |
| PHPMD | Warning | 122 | 122 rule violations (MissingImport:37, NPathComplexity:20, CyclomaticComplexity:19, UnusedFormalParameter:9, TooManyPublicMethods:8) |
| Cpd | Warning | 1 | 1 duplicated chunk spanning 41 total lines (min-lines=5, min-tokens=70) |
| 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 | 35 | 35 | – | – |
| 2.4.8 | – | 35 | 35 | – |
| 2.4.9 | – | – | 35 | N/A |


### 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=["etechflow/module-shipping-table-rates"],
  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

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

