LokiCheckout_AccountType

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 2.0.7

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 loki-checkout/magento2-account-type

Next, enable this module:

bin/magento module:enable LokiCheckout_AccountType

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/LokiCheckout_AccountType

Configuration Options

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

Account Type > Hide Company when Account Type is Individual
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
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
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 LokiCheckout_Core Loki_Components Loki_FieldComponents Yireo_IntegrationTestHelper
Composer details
Magento module name
LokiCheckout_AccountType
Composer name
loki-checkout/magento2-account-type
Composer version
2.0.7
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
loki/magento2-field-components: ^2.0
loki/magento2-components: ^2.0
loki/magento2-css-utils: ^1.0
loki-checkout/magento2-core: ^2.0
Releases
dev-main 29 August 2025
2.0.7 29 August 2025
2.0.6 28 August 2025
2.0.5 21 August 2025
2.0.4 18 August 2025
2.0.3 07 August 2025
2.0.2 30 July 2025
2.0.1 24 July 2025
2.0.0 22 July 2025
Changelog

[2.0.7] - 29 August 2025

Fixed

  • Set default account type to "company" if address contains a company value
  • Reset values of VAT ID and company when switching to individual

[2.0.6] - 28 August 2025

Fixed

  • Add CI files
  • Fix PHP check in Gitlab CI/CD

[2.0.5] - 21 August 2025

Fixed

  • Add dependency with loki/magento2-css-utils

[2.0.4] - 18 August 2025

Fixed

  • Lower requirements to PHP 8.1
  • Fix integration tests with ConfigFixture scope

[2.0.3] - 07 August 2025

Fixed

  • Lower PHP requirement to PHP 8.2+

[2.0.2] - 30 July 2025

Fixed

  • Add language pack

[2.0.1] - 24 July 2025

Fixed

  • Bump version of Yireo Integration Testing Helper

[2.0.0] - 22 July 2025

Fixed

  • Bump LokiCheckout_Core to 2.0
  • Rename PHP namespace from Yireo_Loki* to Loki*
  • Rename composer package from yireo/magento2-loki* to loki/magento2*

[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: July 22, 2025