Athenian Admin Order Shipping
Overview
Product overview
Athenian Admin Order Shipping is a WooCommerce operations plugin that gives store teams more control over shipping after an order has been created. It adds a configurable catalog of administrative shipping services, exposes those services only in approved contexts, calculates package-level rates from the WooCommerce order editor, and writes selected shipping methods back to the order with clean package metadata.
The plugin is designed for businesses where real-world fulfillment does not fit neatly into standard checkout rates. Common scenarios include local pickup, store pickup, van delivery, manual freight, CSR-assisted order edits, internal fulfillment routing, customer service adjustments, and orders where staff need to select package-specific shipping after checkout.
Instead of treating shipping as a single flat order-level field, Admin Order Shipping works at the package level. It can compare live WooCommerce rates with configured admin services, preserve the package contents attached to each selected shipping line, hide internal metadata from normal displays, and expose a concise aos_shipping_packages payload through WooCommerce order REST responses.
---
Use cases
- Admin shipping operations
- Order review
- Fulfillment handoff
- Shipping-service coordination
Developer
Developer starting point
This baseline is generated from the reviewed local technical reference and source folder. Deployed-version parity and external-provider effects remain separate verification steps.
5. Admin Workflow
Step 1: Define Services
An admin creates services in WooCommerce > Admin Order Shipping. Each service receives a label, machine-readable code, price, availability mode, context toggles, optional shipping class filters, and pricing behavior.
Example service definitions:
Local Pickup
Code: local_pickup
Price: 0.00
Availability: Admin only
Visible in: Woo admin, CSRVan Delivery
Code: van_delivery
Price: 25.00
Availability: Admin only
Visible in: Woo admin, CSR
Taxable: yes
Apply Woo free shipping rules: yesStore Pickup
Code: store_pickup
Price: 0.00
Availability: Admin + frontend
Visible in: Checkout, Woo admin, CSRStep 2: Calculate Shipping from an Order
On the WooCommerce order editor, an admin uses the Calculate Shipping button in the unified shipping panel. The plugin reads the order items and shipping address, creates a temporary cart context, recalculates WooCommerce packages, and displays available rates.
Step 3: Select Package Rates
For each package, the admin can choose a live WooCommerce rate or one of the eligible admin services. The interface displays the service/rate label, price, package contents, and free-shipping-rule notes where applicable.
Step 4: Apply to the Order
When the admin applies the selected rates, the plugin removes existing shipping lines from the order, creates new WC_Order_Item_Shipping lines for the selected package rates, writes package metadata, recalculates totals, and saves the order.
Step 5: Use Clean Data Downstream
The resulting order shipping lines can be consumed by WooCommerce admin screens, CSR tools, custom dashboards, and REST integrations. Internal metadata is retained for automation/debugging while hidden from ordinary displays.
---
6. Technical Architecture
Plugin Bootstrap
Main file:
athenian-admin-order-shipping.phpThe bootstrap performs several important tasks:
- Defines plugin constants.
- Requires WooCommerce.
- Loads the custom shipping method only after WooCommerce initializes shipping abstractions.
- Prevents early fatal errors when
WC_Shipping_Methodis not available yet. - Loads the service manager, admin UI, REST controller, and main plugin controller on
plugins_loaded.
Version constant:
AOS_VERSION = '1.3.1'Main Classes
| Class | File | Responsibility | | --- | --- | --- | | AOS_Plugin | includes/class-aos-plugin.php | Singleton controller, WooCommerce hooks, shipping method registration, package rate filtering, REST response extension, metadata display cleanup. | | AOS_Services | includes/class-aos-services.php | Service storage, sanitization, default services, context visibility, package eligibility, free shipping logic, package contents helpers. | | AOS_Admin | includes/class-aos-admin.php | Woo admin service manager, order metabox, unified shipping calculator, AJAX calculation/update handlers. | | AOS_REST | includes/class-aos-rest.php | REST endpoints for service lookup and adding CSR-visible order services. | | AOS_Shipping_Method | includes/class-aos-shipping-method.php | WooCommerce shipping method used to surface frontend-eligible services in shipping zones. |
Included Views
| View | Purpose | | --- | --- | | includes/views/services-page.php | WooCommerce admin service manager page. | | includes/views/services-row.php | Editable row template for each shipping service. | | includes/views/order-metabox.php | Legacy/simple order metabox for adding a single admin shipping service. |
Additional Documentation/Preview Assets
| File | Purpose | | --- | --- | | README.md | Version notes and functional summary. | | admin-order-shipping-product-description.html | Marketing/product description layout. | | admin-order-shipping-render-preview-template.html | Rendered preview/template asset for product presentation. |
---
7. Data Model
Service Storage
Services are stored as a WordPress option:
aos_admin_shipping_servicesThe option value is an associative array keyed by service code.
Service Object Shape
Each service is normalized by AOS_Services::sanitize_service() into the following structure:
[
'code' => 'van_delivery',
'label' => 'Van Delivery',
'description' => 'Administrative local van delivery.',
'default_price' => '25.00',
'taxable' => true,
'enabled' => true,
'availability' => 'admin_only',
'show_on_cart' => false,
'show_on_checkout' => false,
'show_in_admin' => true,
'show_in_csr' => true,
'allow_price_override' => true,
'respect_free_shipping_rules' => true,
'shipping_classes' => '',
]Shipping Line Metadata
When selected shipping lines are added to an order, the plugin can store the following metadata:
| Meta Key | Purpose | | --- | --- | | _aos_package_index | Numeric package index selected from the package-rate UI. | | _aos_package_hash | Package hash used to associate selections with package contents/destination. | | _aos_package_id | Optional package ID used by CSR/REST workflows. | | _aos_source | Source of the shipping line, such as woocommerce, admin_service, csr, frontend, or woo_admin_metabox. | | _aos_service_code | Configured service code for admin/CSR services. | | _aos_free_shipping_rule_applied | yes when free-shipping rules caused the rate to become zero. | | _aos_selected_by | WordPress user ID that selected/applied the shipping line. | | _aos_package_contents_summary | Human-readable package contents summary. | | _aos_package_contents_items | JSON-encoded package item payload. | | _aos_shipping_methods_note | Concise note combining service/rate label, price, and package contents. | | Items | Public metadata mirror of package contents summary for REST/order JSON parity. |
The plugin hides the internal _aos_* metadata from normal WooCommerce formatted meta displays while preserving it internally.
REST Response Extension
The plugin adds the following top-level field to WooCommerce order REST responses:
{
"aos_shipping_packages": [
{
"shipping_item_id": 12345,
"method_title": "Package 1 - Van Delivery",
"method_id": "admin_order_shipping",
"total": 25,
"package_index": "0",
"package_hash": "...",
"source": "admin_service",
"service_code": "van_delivery",
"free_shipping_applied": false,
"package_items_summary": "Example Product x 2",
"package_items": [],
"shipping_methods_note": "Van Delivery ($25.00) - Example Product x 2"
}
]
}This is easier for connected systems to read than raw shipping-line metadata.
---
8. WooCommerce Integration Points
Shipping Method Registration
The plugin registers a WooCommerce shipping method:
admin_order_shippingThe method supports:
[ 'shipping-zones', 'instance-settings' ]This allows frontend-eligible Admin Order Shipping services to be enabled within WooCommerce shipping zones.
Package Rate Filtering
The plugin filters package rates through:
woocommerce_package_ratesThis is used to:
- Remove Admin Order Shipping rates that are not visible in the current context.
- Apply free-shipping behavior to eligible admin service rates.
- Inject CSR-visible admin service rates during CSR AJAX workflows.
CSR Context Detection
The plugin treats AJAX actions beginning with aoe_ as CSR context. This is designed to support bespoke CSR order interfaces that calculate, update, rebuild, draft, or refresh pay-order shipping contexts using AJAX.
In CSR context, eligible admin shipping services are injected into package rates so they remain available across cart rebuilds and final order payload generation.
Order Editor Integration
The plugin uses:
woocommerce_admin_order_data_after_shipping_addressThis inserts the unified shipping action panel into the WooCommerce order editor. The panel is powered by two admin AJAX actions:
calculate_shipping_for_order
update_order_shippingLegacy Order Metabox
The plugin also registers a side metabox for adding a single admin shipping service:
Admin Shipping ServicesThis metabox uses the woocommerce_process_shop_order_meta hook to add the selected service as a shipping line.
---
9. REST API Reference
Get All Services
GET /wp-json/admin-order-shipping/v1/servicesReturns the configured service catalog.
Permission: edit_shop_orders or manage_woocommerce
Get CSR-Eligible Services for an Order
GET /wp-json/admin-order-shipping/v1/orders/{id}/servicesReturns services visible in the csr context.
Permission: edit_shop_orders or manage_woocommerce
Add a CSR Shipping Service to an Order
POST /wp-json/admin-order-shipping/v1/orders/{id}/servicesSupported parameters:
| Parameter | Required | Purpose | | --- | --- | --- | | service_code | Yes | Service code to add. Must be visible in CSR context. | | price | No | Optional price override when service allows override. | | package_id | No | Optional package identifier. | | free_rule_applied | No | Applies zero pricing when the service respects free-shipping rules. | | package_contents_summary | No | Human-readable package contents. | | package_contents_items | No | Structured package item array or JSON string. | | shipping_methods_note | No | Optional shipping note. Generated automatically when omitted and package summary is available. |
The endpoint creates a WC_Order_Item_Shipping, writes AOS metadata, recalculates order totals, and saves the order.
---
10. AJAX Workflow
Calculate Shipping for Order
Action:
wp_ajax_calculate_shipping_for_orderHandler:
AOS_Admin::ajax_calculate_shipping_for_order()The calculation flow:
- Verifies the order-specific nonce.
- Checks
edit_shop_ordercapability for the order. - Reads destination fields from the order editor.
- Resets WooCommerce shipping.
- Sets the customer shipping location.
- Empties the current WooCommerce cart.
- Rebuilds the cart from order line items.
- Calculates cart totals.
- Retrieves WooCommerce shipping packages.
- Adds computed package cost, weight, dimensions, and destination data.
- Calculates shipping rates.
- Renders package/rate HTML for admin selection.
- Empties the temporary cart.
Update Order Shipping
Action:
wp_ajax_update_order_shippingHandler:
AOS_Admin::ajax_update_order_shipping()The update flow:
- Verifies the order-specific nonce.
- Checks
edit_shop_ordercapability. - Validates selected shipping data.
- Loads the order.
- Removes existing shipping lines.
- Creates one new
WC_Order_Item_Shippingper selected package/rate. - Writes method, cost, package index, package hash, package contents, source, service code, free-shipping status, and selected user metadata.
- Sets the shipping total.
- Recalculates totals.
- Saves the order.
- Returns the formatted shipping total.
---
12. Security and Permissions
The plugin uses standard WordPress and WooCommerce permission checks throughout the admin, AJAX, and REST layers.
Admin Service Manager
- Requires
manage_woocommerceto render and save the service catalog. - Uses
check_admin_referer( 'aos_save_services' )before saving. - Sanitizes service fields before storage.
Order Editor AJAX
- Uses order-specific nonces:
'aos_order_shipping_' . $order_id- Requires
edit_shop_orderfor the specific order. - Sanitizes destination fields, shipping method values, labels, service codes, package contents summaries, and notes.
REST Endpoints
- Require either
edit_shop_ordersormanage_woocommerce. - Validate order existence.
- Verify that requested service codes exist and are visible in the CSR context.
- Enforce
allow_price_overrideand free-shipping-rule behavior.
Metadata Visibility
Internal metadata is hidden through:
woocommerce_hidden_order_itemmeta
woocommerce_order_item_get_formatted_meta_dataThis protects normal order displays from becoming cluttered with operational _aos_* fields while preserving the data for systems that need it.
---
14. Technical Strengths
Operationally Realistic Shipping Model
The plugin recognizes that many stores need shipping choices after checkout. Admin teams often need to add local delivery, store pickup, freight, or special handling without forcing customers to see every internal option at checkout.
Package-Level Decision Making
By calculating and writing shipping lines per package, the plugin supports more granular fulfillment workflows than a single manual shipping fee.
Context-Safe Service Exposure
The same service catalog can power admin, CSR, cart, and checkout contexts while preventing accidental exposure of internal services.
REST-Friendly Package Payloads
The aos_shipping_packages payload creates a readable integration surface for connected systems without requiring consumers to parse raw WooCommerce line-item metadata.
Defensive WooCommerce Loading
The plugin avoids the common WooCommerce plugin mistake of loading a shipping method too early. This improves stability during activation, plugin scans, and admin initialization.
Cleaner Admin UX
The plugin preserves internal metadata while showing admins a readable package contents summary underneath shipping lines.
---
15. Implementation Considerations
Existing Shipping Lines Are Replaced
The unified update workflow removes existing shipping lines before adding the selected package-level lines. This is appropriate for a shipping recalculation tool, but teams should understand that it is a replacement workflow rather than an additive-only workflow.
Temporary Cart Dependency
The order editor calculator depends on the WooCommerce cart, customer, and shipping session being available in admin AJAX context. If a site heavily modifies WooCommerce sessions or disables cart context in admin, that behavior should be tested.
Variation Handling Review
The calculation workflow rebuilds the temporary cart from order items using the product ID and quantity. Stores with heavy variation-specific shipping behavior should test whether variation IDs, variation attributes, and custom cart item data need to be preserved in a future enhancement.
Tax Calculation Behavior
Admin services support a taxable setting. Selected shipping line totals are set and the order is recalculated, so behavior should be tested with the store's shipping tax configuration, tax-exempt users, CSR order creation flows, and payment capture workflows.
Frontend Services Require Shipping Zone Setup
Frontend-eligible services are surfaced through the custom WooCommerce shipping method, so the Admin Order Shipping method must be enabled in applicable WooCommerce shipping zones.
---
Install
- Reviewed source folder: athenian-admin-order-shipping
- Plugin version reviewed: 1.3.1
- Local source inventory: 15 files (vendor, temporary, test, and Git metadata excluded).
- GitHub baseline: https://github.com/Athenian-Brands/athenian-admin-order-shipping at baseline/devdocs-1.3.1-20261006 / 0bad3cb21c562f7268b194d555f87346a71f32b6.
- WordPress and WooCommerce.
- Carrier, label, rate, and fulfillment outcomes must be verified separately in the target store.
Configuration
- 1. Executive Summary — see the linked technical reference excerpt.
- 2. Marketing Positioning — see the linked technical reference excerpt.
- 3. Best-Fit Use Cases — see the linked technical reference excerpt.
- 4. Core Capabilities — see the linked technical reference excerpt.
- 5. Admin Workflow — see the linked technical reference excerpt.
- 6. Technical Architecture — see the linked technical reference excerpt.
- 7. Data Model — see the linked technical reference excerpt.
- 8. WooCommerce Integration Points — see the linked technical reference excerpt.
- 9. REST API Reference — see the linked technical reference excerpt.
- 10. AJAX Workflow — see the linked technical reference excerpt.
- 11. Free Shipping Logic — see the linked technical reference excerpt.
- 12. Security and Permissions — see the linked technical reference excerpt.
- 13. Compatibility Notes — see the linked technical reference excerpt.
- 14. Technical Strengths — see the linked technical reference excerpt.
Usage
- Shortcodes detected in local PHP source: 0
- Static action/filter hooks detected in local PHP source: 18
- REST route registrations detected in local PHP source: 1
Shortcodes
- No static add_shortcode registrations were detected by the baseline scanner.
REST Endpoints
- admin-order-shipping/v1 — includes/class-aos-rest.php
Hooks
- add_meta_boxes — includes/class-aos-admin.php
- admin_menu — includes/class-aos-admin.php
- admin_notices — athenian-admin-order-shipping.php
- admin_post_aos_save_services — includes/class-aos-admin.php
- plugins_loaded — athenian-admin-order-shipping.php
- rest_api_init — includes/class-aos-rest.php
- woocommerce_admin_order_data_after_shipping_address — includes/class-aos-admin.php
- woocommerce_after_order_itemmeta — includes/class-aos-plugin.php
- woocommerce_hidden_order_itemmeta — includes/class-aos-plugin.php
- woocommerce_order_item_get_formatted_meta_data — includes/class-aos-plugin.php
- woocommerce_package_rates — includes/class-aos-plugin.php
- woocommerce_process_shop_order_meta — includes/class-aos-admin.php
- woocommerce_rest_prepare_shop_order_object — includes/class-aos-plugin.php
- woocommerce_shipping_init — athenian-admin-order-shipping.php
- woocommerce_shipping_methods — includes/class-aos-plugin.php
- woocommerce_update_options_shipping_ — includes/class-aos-shipping-method.php
- wp_ajax_calculate_shipping_for_order — includes/class-aos-admin.php
- wp_ajax_update_order_shipping — includes/class-aos-admin.php
Data Model
- 7. Data Model — described in the local technical reference.
- 8. WooCommerce Integration Points — described in the local technical reference.
API Reference
- Local source digest: 5a9d3f5d9b4cc27002d7118078e4059697b448b1d5f7f12f6864462124fdb71d
- Repository URL: https://github.com/Athenian-Brands/athenian-admin-order-shipping
- Repository reference: baseline/devdocs-1.3.1-20261006
- Repository commit: 0bad3cb21c562f7268b194d555f87346a71f32b6
Source files include: README.md, admin-order-shipping-product-description.html, admin-order-shipping-render-preview-template.html, athenian-admin-order-shipping.php, docs/athenian-platform-marketing.md, docs/athenian-platform-technical.md, docs/technical-marketing.md, includes/class-aos-admin.php, includes/class-aos-plugin.php, includes/class-aos-rest.php, includes/class-aos-services.php, includes/class-aos-shipping-method.php, includes/views/order-metabox.php, includes/views/services-page.php, includes/views/services-row.php
Troubleshooting
- This baseline is generated from the reviewed local technical reference and source folder. Deployed-version parity and external-provider effects remain separate verification steps.
- Confirm the deployed plugin version, active dependencies, and current repository tree before using implementation details as a release contract.
- Treat payment, carrier, vendor, shipment, inventory, account, credential, and external-provider behavior as integration-dependent until exercised in the target environment.
FAQ
What is this page intended to establish?
A versioned, product-linked starting point for iterative developer documentation. It combines the local implementation reference with a compact detected-code inventory and a committed GitHub baseline.
Is the linked repository baseline verified?
Yes. The repository URL, ref, and commit recorded on this page were verified from the clean GitHub baseline prepared for this documentation pass. That does not by itself prove fleet deployment parity.
What remains for release-grade documentation?
Reconcile the recorded source baseline with the deployed plugin version, then exercise the relevant authenticated, store, provider, payment, carrier, or generated-artifact paths in the target environment.