loki-checkout / magento2-quote-address-extended
Store additional quote address data in a separate table and link it to the order address
Package info
github.com/LokiExtensions/Loki_QuoteAddressExtended
Type:magento2-module
pkg:composer/loki-checkout/magento2-quote-address-extended
Requires
- php: >=8.2 <8.6
- loki-checkout/magento2-core: ^2.3
- loki/magento2-components: ^2.2
- loki/magento2-field-components: ^2.2
- magento/framework: ^103.0
- magento/module-cron: ^100.4
- magento/module-quote: ^101.2
- magento/module-sales: ^103.0
- magento/module-store: ^101.1
- psr/log: ^1.0 | ^2.0 | ^3.0
Requires (Dev)
- loki/magento2-functional-tests: @dev
- phpunit/phpunit: ^10.5
- yireo/magento2-integration-test-helper: ~0.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-06 16:27:20 UTC
README
Installation
Install this package via composer:
composer require loki-checkout/magento2-quote-address-extended
Next, enable this module:
bin/magento module:enable Loki_QuoteAddressExtended
Usage
This module adds a table loki_quote_address_extended with one row per quote address (quote_address_id). When the order is placed, each row is linked to the matching order address (order_address_id).
To store a custom value:
- Add a column to
loki_quote_address_extendedvia your ownetc/db_schema.xml(plusdb_schema_whitelist.json). - Add a field block to the Loki Checkout whose name ends with the column name (e.g.
loki-checkout.customer.example_address_field), using the templateLoki_FieldComponents::form/field.phtml. Optionally add the block arguments:address_type:shipping,billingorauto(default; the shipping address, or the billing address for virtual quotes);field_name: the column name, when it differs from the last part of the block name.
- Register the block in your
etc/loki_components.xmlwith the groupquoteAddressExtendedFields.
To display the value:
- Frontend (current quote):
Loki\QuoteAddressExtended\ViewModel\CheckoutQuoteAddressExtendedView::getValue('example_address_field', 'auto') - Admin order and invoice pages:
Loki\QuoteAddressExtended\ViewModel\Adminhtml\OrderAddressExtendedView::getValue('example_address_field', 'auto') - Order and invoice emails:
{{var loki_shipping_address_extended.example_address_field}}and{{var loki_billing_address_extended.example_address_field}}
Rows that are linked to neither a quote address nor an order address are removed by the cron job loki_quote_address_extended_delete_orphaned_rows.
See Loki_QuoteAddressExtendedExample for a complete example.