Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/empirextech/woocommerce-checkout-architect/archive/refs/heads/main.zipA WooCommerce plugin that keeps shipping, checkout fields, and payment hooks in typed PHP instead of a tangle of functions.php snippets.
Built by SC EMPIRE GLOBAL SOLUTIONS SRL (EMPIREX Tech). This is an original demonstration plugin. It is not a client shop, not a copy of a commercial checkout extension, and not a production dump. The rule model reflects work done on city-level courier qualification, access numbers, delivery windows, and offline invoice payments.
Problem
WooCommerce stores often encode courier exceptions as nested conditionals: this city is cheaper, that postcode is blocked, oversized SKUs add a surcharge, free shipping starts at a cart threshold. Those rules are usually untestable and collide with one-page checkout plugins.
Checkout Architect stores the rules as data, evaluates them in integer money, and exposes the result as a native WC_Shipping_Method.
What it does
- Registers a zone-ready shipping method with JSON rules (
rate,free,deny,surcharge). - Adds a required delivery window and an optional access / gate code on checkout.
- Persists those fields on the order, the admin screen, and customer emails.
- Ships a demonstration invoice gateway with the correct on-hold lifecycle.
- Declares High-Performance Order Storage compatibility.
Architecture
WC package
└─ RuleShippingMethod
└─ RuleEvaluator ─ ShippingRule[] ─ CartSnapshot
CheckoutFields ─ order meta ─ admin + email
InvoiceGateway ─ on-hold + thank-you instructions
| Class | Role |
|---|---|
RuleEvaluator |
Pure PHP. Covered by PHPUnit without booting WordPress. |
RuleShippingMethod |
WooCommerce shipping API + zone instance settings. |
CheckoutFields |
woocommerce_checkout_fields / validate / order meta. |
InvoiceGateway |
WC_Payment_Gateway with sanitised settings. |
Settings |
Capability + nonce protected options page. |
Requirements
- PHP 8.3+
- WordPress 6.4+
- WooCommerce 8.0+
Installation
- Copy this folder to
wp-content/plugins/woocommerce-checkout-architect. - Activate EMPIREX Checkout Architect.
- WooCommerce → Settings → Shipping → open a zone → add EMPIREX Rule Shipping.
- Optionally enable EMPIREX Invoice under Payments.
Developer install:
composer install
composer test
Rule format
Instance setting rules_json:
[
{
"id": "deny-remote",
"label": "Courier unavailable for this postcode",
"priority": 10,
"type": "deny",
"postcode_prefixes": ["07"]
},
{
"id": "free-over-200",
"label": "Free shipping",
"priority": 20,
"type": "free",
"min_subtotal": "200.00"
},
{
"id": "city-cluj",
"label": "Cluj courier",
"priority": 30,
"type": "rate",
"cities": ["Cluj-Napoca"],
"rate": "14.90"
},
{
"id": "oversized",
"label": "Oversized surcharge",
"priority": 80,
"type": "surcharge",
"classes": ["oversized"],
"surcharge": "12.00",
"stop": false
}
]
Lower priority wins first. deny and free stop the chain. surcharge can stack on a matched rate when stop is false.
Checkout fields
| Field | Storage | Validation |
|---|---|---|
| Delivery window | _empirex_delivery_window |
One of 08-12, 12-16, 16-20 |
| Access number | _empirex_access_number |
A–Z, digits, #, -, space, max 40 |
Security
- Direct file access blocked with
ABSPATH. - Admin page:
manage_woocommerce+ nonce. - Checkout input sanitised with
sanitize_text_fieldand allow-lists. - Gateway settings go through WooCommerce's own option API.
- No credentials, no remote payment calls.
Performance
Rate calculation is in-memory over a small JSON document. It does not query the database per rule. Money is integer minor units.
Tests
composer test
The suite covers the evaluator only. Full WooCommerce integration tests need a WP test install; they are intentionally out of scope so CI stays fast.
License
GPL-2.0-or-later (WordPress derivative). EMPIREX Tech / SC EMPIRE GLOBAL SOLUTIONS SRL.