Yireo_LokiCheckoutAccountType

Jump to User Docs

Other
PHP 8.3 | 8.4
Magento 2.4.7 | 2.4.8
Unit Tests 25
Integration Tests 42
Functional Tests 1
Latest Release 1.0.1

This is an add-on package for adding a new field Account Type to the Loki Checkout, allowing a customer to register as either on Individual account or a Company account. When the account type is set to Individual, the company field and the VAT ID field are not rendered.

Installation

Install this package via composer (assuming you have setup the composer.yireo.com repository correctly already):

composer require yireo/magento2-loki-checkout-account-type

Next, enable this module:

bin/magento module:enable Yireo_LokiCheckoutAccountType

Architecture

This module adds a new Loki Component account_type to both the billing and the shipping address. This includes both a ComponentViewModel and a ComponentRepository. To allow for the company field and the VAT ID field not to be rendered, DI plugins are made for the corresponding ComponentViewModels.

Support

For getting support, create an Issue under the following project URL:

https://gitlab.yireo.com/loki-checkout/Yireo_LokiCheckoutAccountType

Configuration Options

The following options of this module can be configured via the Store Configuration:

Account Type > Hide Company when Account Type is Individual
yireo_loki_checkout/account_type/hide_company
With configured to hide, the "Company" field is hidden when the "Account Type" is set to "Individual". Vice versa, if the "Account Type" is set to "Company", the "Company" field is shown.
Account Type > Hide VAT ID when Account Type is Individual
yireo_loki_checkout/account_type/hide_vat_id
With configured to hide, the "VAT ID" field is hidden when the "Account Type" is set to "Individual". Vice versa, if the "Account Type" is set to "VAT ID", the "Company" field is shown.
Account Type > Default value
yireo_loki_checkout/account_type/default
The value to use as default: Either "Company" or "Individual"
Loki Components

The following LokiComponents are created or references in this module:

loki-checkout.shipping.address.account_type loki-checkout.billing.address.account_type
Module Dependencies

The following dependencies are declared in the module its `etc/module.xml` file:

Magento_Backend Magento_Config Magento_Customer Magento_Eav Magento_Store Yireo_LokiCheckout Yireo_LokiComponents Yireo_LokiFieldComponents
Composer details
Magento module name
Yireo_LokiCheckoutAccountType
Composer name
yireo/magento2-loki-checkout-account-type
Composer version
1.0.1
Default branch
main
Requirements
magento/framework: ^103.0
magento/module-config: ^101.0
magento/module-customer: ^103.0
magento/module-eav: ^102.0
magento/module-store: ^101.0
yireo/magento2-loki-field-components: ~0.0 | ^1.0
yireo/magento2-loki-components: ~0.0 | ^1.0
yireo/magento2-loki-checkout: ^1.0.7 | ^1.1
Releases
dev-main 20 June 2025
1.0.1 20 June 2025
1.0.0 24 May 2025
0.0.8 25 April 2025
0.0.7 16 April 2025
0.0.6 08 April 2025
0.0.5 26 March 2025
0.0.4 11 March 2025
0.0.3 22 February 2025
0.0.2 21 February 2025
0.0.1 21 January 2025
Changelog

[1.0.1] - 20 June 2025

Fixed

  • Finalize new grid settings
  • Automatically position new fields
  • Use Loki test-case in Playwright to detect JS errors automatically
  • Rewrite @helpers to @loki in Playwright tests

[1.0.0] - 24 May 2025

Fixed

  • Fix failing tests
  • Generate new MODULE.json with simple test count
  • Allow PHP 8.4 in CI
  • Update composer and module deps

[0.0.8] - 25 April 2025

Fixed

  • Allow upgrading to LokiFieldComponents and LokiCheckout 1.0
  • Change composer keyword loki-misc to loki-other
  • Allow upgrade to LokiComponents 1.0
  • Remove default params
  • Remove gridClass, add colSpan and mdColSpan in grid layouts
  • Remove CheckoutSession from context
  • Remove FieldTemplateLocator from context
  • Remove CartRepository from all contexts
  • Rewrite getCartRepository()->save() to getCheckoutState()->saveQuote()

[0.0.7] - 16 April 2025

Fixed

  • Remove obsolete file

[0.0.6] - 08 April 2025

Fixed

  • Enhance tests
  • Implement LokiCheckoutRepositoryTestCase

[0.0.5] - 25 March 2025

Added

  • Major additions of unit tests and integration tests
  • Add EAV attribute account_type in customer_address to save value into

[0.0.4] - 11 March 2025

Fixed

  • Add module dependencies
  • Huge refactoring to move logic into new LokiFieldComponents

[0.0.3] - 22 February 2025

Fixed

  • Update loki_checkout.xml grid CSS for mobile

[0.0.2] - 21 February 2025

  • Version bump

[0.0.1] - 21 January 2025

  • Add proper deps
  • Initial release
Jump to User Docs

Last modified: April 30, 2025