Developer notes
Technical reference for developers who customize US Retail Delivery Fees & All-in Pricing.
Add-on identity
Section titled “Add-on identity”| Item | Value |
|---|---|
| Add-on id | kv_us_fees_allin |
| Function prefix | fn_kv_us_fees_allin_ |
| Language variables | kv_us_fees_allin.* |
| CSS scope | .kv-usf-* |
| PHP namespace | Tygh\Addons\KvUsFeesAllin |
Hooks used
Section titled “Hooks used”PHP: calculate_cart_post (adds the fee lines to $cart['kv_usf_fees'] and to $cart['total']), place_order (stores the lines), change_order_status (strikes or restores fees on cancellation), get_order_info (adds kv_usf_fees to the order), delete_order.
Templates: checkout:checkout_totals (post), checkout:summary (post), orders:order_total (pre), products:prices_block (post), backend orders:totals_content (pre), and the mail hook orders:invoice_shipping (pre). The document variable kvf (label, amount) is added through schemas/documents/order.post.php.
Hooks provided
Section titled “Hooks provided”None.
Database tables
Section titled “Database tables”| Table | Content |
|---|---|
?:kv_usf_rates |
Rate rows: state, label, amount, minimum taxable goods, effective dates, exemptable, strike on cancel, status. |
?:kv_usf_states |
All-in switch and start date per state. |
?:kv_usf_order_fees |
One row per fee line of an order: state, label, amount, taxable base, month, status (C charged, R struck by cancellation), vendor. |
Storefront endpoint
Section titled “Storefront endpoint”index.php?dispatch=kv_us_fees_allin.estimate&ids=1,2&state=CO&cart=1 returns JSON with the all-in amounts for the listed products and the cart. It is never cached (Cache-Control: no-store); the page markup holds only empty placeholders.
Template overrides
Section titled “Template overrides”Storefront templates live in design/themes/<theme>/templates/addons/kv_us_fees_allin/. To customize one, copy it to your own theme’s folder; do not edit the add-on’s files, they are replaced on update.
License
Section titled “License”The add-on carries the Kavio Labs license client (Tygh\Addons\KvUsFeesAllin\License\Client). Engine::isActive() is the single gate: without a valid license no fee line or all-in label is added; stored order fee records, the report and the admin pages keep working. Files: License/Client.php, License/Ed25519.php, controllers/backend/kv_us_fees_allin_license.php, design/backend/templates/addons/kv_us_fees_allin/license/.