Skip to content

Overview

"Entity forms" are the customization API Hyvä Checkout uses for the Shipping and Billing address.
This form abstraction provides the flexibility required to combine customizations from different modules without causing conflicts.

What is a "Hyvä Checkout Form"?

When we talk about forms here, we are not using the term to refer to the HTML <form> element and its associated fields, but rather about a custom abstraction used to collect the data for an entity record in the database.

Hyvä Checkout uses this kind of form to collect address data in the checkout.

Why not use a regular Magewire component?

Thanks to Magentos' flexibility, entities like customers and addresses can have a varying number of attributes.
Those attributes can require different input types and different input constraints.

To render an HTML form for an address, the code needs to iterate over attributes, determine the input type, and render the appropriate HTML element.

In addition to inputs, additional elements like informational labels or images can be part of a form, too.

If all address forms on all Magento instances were identical, there would be no need for a "form abstraction". However, customizations are very common, and that is why a simple Magewire component is not sufficient.