Configuration files
Lunar’s core ships several configuration files. The installer publishes them automatically, but they can also be published manually:Regions
A region groups the market-presentation settings a storefront needs into a single record: which channel it belongs to, which currency and language it presents by default, which tax zone prices it against before an address is known, and whether prices are displayed inclusive or exclusive of tax. The installer creates a single default region tying together the default channel, currency, language, and tax zone.- Channel is the sales surface (online store, wholesale portal, POS). Region is the market being served on that surface — a single channel can serve multiple regions (for example, a “UK” and a “US” region on the same webstore channel).
- Currency and language default from the region but can still be overridden individually per request.
- Tax zone on a region is a display zone, used to price the catalogue before a shipping address is known. Once a cart has a shipping address, tax resolution still works from that address, independent of the region.
- Prices inclusive of tax (
prices_inc_tax) controls whether the storefront displays prices inclusive or exclusive of tax for that region. It is nullable — when not set, it falls back to the globallunar.pricing.stored_inclusive_of_taxconfig value. This is a display preference only; it does not change how prices are stored.
Languages
Languages enable translated content across Lunar models such as products and collections. Any model field stored as a translated attribute uses languages to determine which translations are available. The installer creates a single language: English (en). This can be changed or supplemented to support any number of languages.
Each language has a code (a 2-character ISO 639-1 code like en, fr, or de) and a name for display purposes. Exactly one language must be marked as the default, which is used as the fallback when a translation is not available in the requested locale.
Translated fields are stored as JSON with language codes as keys (e.g. {"en": "Leather boots", "fr": "Bottes en cuir"}).
For model fields, relationships, and code examples, see the Languages reference.
Currencies
Currencies define the monetary units available for product pricing. Each currency has an exchange rate relative to the default currency. The installer creates a single currency: US Dollar (USD) with an exchange rate of 1 and 2 decimal places.
Key concepts:
- Code should be a 3-character ISO 4217 code (e.g.
USD,GBP,EUR). - Exchange rate is relative to the default currency. The default currency should always have an exchange rate of
1.0000. For example, if USD is the default and 1 USD = 0.79 GBP, the GBP exchange rate would be0.7900. - Decimal places controls formatting precision (e.g.
2for most currencies,0for JPY). - Enabled controls whether the currency is active. Disabled currencies can be pre-configured without being visible to customers.
- Sync prices, when enabled on a non-default currency, allows Lunar to calculate prices automatically based on the default currency and the exchange rate. This is useful for stores that manage pricing in one currency and want approximate converted prices for others.
Exchange rates do not automatically convert product prices unless price synchronization is enabled. Prices can be set independently per currency.
Channels
Channels represent different sales outlets or storefronts. They control where products, collections, and discounts are published and when they become available. The installer creates a single channel: Webstore (handle:webstore).
Typical channel examples include a main webstore, a mobile app, a wholesale portal, or a marketplace integration. Each channel has a name, a URL-friendly handle (automatically slugified on save), and an optional url.
Products and other models can be scheduled for availability on specific channels, optionally with start and end dates. This makes it possible to launch products on one channel before another, or run time-limited availability windows.
Exactly one channel should be marked as the default.
For model fields, relationships, scheduling examples, and filtering queries, see the Channels reference.
Customer groups
Customer groups segment customers so that different groups can receive different pricing, product visibility, and discount rules. They are commonly used for B2B/B2C scenarios or loyalty tiers. The installer creates a single customer group: Retail (handle:retail).
Typical customer group examples include Retail (standard consumers), Wholesale (B2B buyers with volume pricing), VIP (loyalty members), and Trade (industry-specific pricing).
Customer groups can be associated with:
- Products and collections to control visibility per group
- Discounts to restrict promotions to specific groups
- Tax zones to apply different tax rules per group
- Pricing to define group-specific product prices
Tax
Lunar provides a flexible tax system built around three core concepts: tax classes, tax zones, and tax rates. These work together to calculate the correct tax for each order based on the product type and the customer’s location.Tax classes
Tax classes categorize products by their tax treatment. Different types of products may be taxed at different rates depending on the jurisdiction. The installer creates a single tax class: Default Tax Class. Common additional tax classes include:
Each product variant is assigned a tax class. When tax is calculated, the system looks up the rate that applies to that tax class within the relevant tax zone.
Tax zones
Tax zones define geographic regions where specific tax rates apply. A zone can be scoped by countries, states, or postcodes. The installer creates a single tax zone: Default Tax Zone (type:country), with all countries assigned to it.
Whether prices are displayed inclusive or exclusive of tax is a region setting, not a tax zone setting — see Regions above.
Tax rates
Each tax zone has one or more tax rates. A tax rate has a name, a priority (for ordering when multiple rates apply), and one or more tax rate amounts that define the percentage for each tax class. For example, a UK tax zone might have a single “VAT” rate with 20% for the standard tax class and 5% for a reduced-rate tax class. A US state zone might have separate “State Tax” and “City Tax” rates with different priorities.Tax driver
The tax driver is configured inconfig/lunar/taxes.php. The default system driver uses the tax classes, zones, and rates described above. For complex scenarios (e.g. tax across all US states), a custom driver can integrate with external services like TaxJar.
For model fields, relationships, and code examples, see the Taxation reference.
Attributes
Attributes store custom, translatable data against models like products, collections, brands, product types, and customer groups. They are organized into attribute groups and support translatable values, validation rules, and multiple field types.The installer does not seed any default attribute groups or attributes. A product’s name and description are native translated fields on the model, not attributes — attributes are for additional custom fields.
Lunar\Core\FieldTypes\*) include Text, TranslatedText, Number, Toggle, Dropdown, ListField, File, YouTube, and Vimeo. Custom field types can also be registered against the field type manifest.
For model fields, code examples, and details on adding attributes to custom models, see the Attributes reference.
Setting up for a specific region
The examples below show how to adjust the installer defaults for common regional configurations.United Kingdom (GBP, tax-inclusive)
Europe (EUR, multiple countries)
United States (USD, tax-exclusive, state-level)
US tax is complex and varies by state, county, and city. For production stores selling across multiple US states, consider integrating with a dedicated tax service.