> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fusioncore.us/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Up Store Settings

> Create the Store Settings custom metadata record that every Store component reads, and configure its page URLs, business units, currencies, and guest checkout options.

## Overview

Every Store component reads its configuration from one **Store Settings** (`FS_PORTAL_Store_Settings__mdt`) record. Rather than repeating page paths and business rules on each component, you fill them in once here and each component names the record it should use.

You can keep more than one record — one per storefront — and point different pages at different records.

> [!WARNING]
>
> The package does not ship a Store Settings record. Create one before you place any Store component, or every component reports that it cannot resolve its settings. Components default their **Store Settings** property to `Default`, so naming your first record `Default` means you can leave that property alone.

## Create the Record

**1. Open the custom metadata type**

From **Setup**, go to **Custom Code > Custom Metadata Types**, find **FS Portal Store Settings**, and click **Manage Records**.

**2. Create a new record**

Click **New**. Set **Label** and **FS Portal Store Settings Name** — the name is what a component's **Store Settings** property refers to, so `Default` is the convenient choice for your first record.

**3. Fill in the page URLs**

These five are required, and each has a sensible default. Set them to your real page paths.

| Field | Default | What uses it |
| - | - | - |
| **Store Page URL** (`FS_PORTAL_Store_Page_URL__c`) | `/store` | The "Back to Shop" navigation across every Store component |
| **Product Page URL** (`FS_PORTAL_Product_Page_URL__c`) | `/product` | Product tiles and cart lines linking to a product. `?productId=` is appended for you |
| **Cart Page URL** (`FS_PORTAL_Cart_Page_URL__c`) | `/cart` | The drawer's **Checkout** button, and the Cart Indicator when **Show Cart As** is `Page`. `?orderId=` is appended for members |
| **Checkout Page URL** (`FS_PORTAL_Checkout_Page_URL__c`) | `/checkout` | Where the Cart page sends the shopper to pay. `?orderId=` is appended for you |
| **Login Page URL** (`FS_PORTAL_Login_Page_URL__c`) | `/login` | The **Login / Create an account** choice a guest can make on the Cart page |

> [!NOTE]
>
> Each URL takes either a path beginning with `/` for a page in this portal, or a full `https://` URL for a page outside it. External URLs let a shopper move between the Store and a CMS site.

**4. Choose how the cart opens**

Set **Show Cart As** (`FS_PORTAL_Show_Cart_As__c`):

* `Drawer` — clicking the Cart Indicator slides the cart in over the current page.
* `Page` — clicking the Cart Indicator navigates to the Cart page.

**5. Save**

Click **Save**. Two validation rules run here, so a record that would break at runtime is rejected at save time — see [Validation Rules](#validation-rules) below.

## Which Products the Store Shows

**Product Business Unit Ids** (`FS_PORTAL_Product_Business_Unit_Ids__c`) takes a comma-separated list of Business Unit Ids. Only products belonging to those business units appear in this storefront. Leave it blank to show products from every business unit.

## Which Business Unit the Order Gets

Every cart becomes an Order, and every Order needs a Business Unit. **Cart Business Unit Logic** (`FS_PORTAL_Cart_Business_Unit_Logic__c`) decides which one:

| Value | Behavior |
| - | - |
| `From First Added Product` | Use the Business Unit of the first product added to the cart |
| `Specific Id` | Always use **Cart Business Unit Id** (`FS_PORTAL_Cart_Business_Unit_Id__c`) |
| `Org Default` | Use the org's default Business Unit |

> [!TIP]
>
> `From First Added Product` re-resolves if the shopper empties the cart and starts again — it is not permanently pinned by the very first product they ever added.

## Currency

**Currency ISO Codes** (`FS_PORTAL_Currency_Iso_Codes__c`) is a comma-separated list, for example `USD,EUR,GBP`. The Store shows a currency picker offering exactly these, and the **first** code in the list is the fallback when the shopper's own currency is not among them.

The setting applies only to multi-currency orgs. In a single-currency org the Store uses the org currency and hides the picker.

> [!WARNING]
>
> Prices, and which products appear at all, depend on the selected currency — a product needs a price book entry in that currency to be shown. Switching currency with items already in the cart clears the cart, after warning the shopper.

## Guest Checkout

These fields only matter when you let shoppers buy without an account. See [Guest Checkout](https://docs.fusioncore.us/end-user-guides/portal/store/guest-checkout.md) for the full picture.

| Field | Purpose |
| - | - |
| **Continue as Guest User** (`FS_PORTAL_Continue_As_Guest_User__c`) | Master switch. When off, the Cart page offers only **Login / Create an account** |
| **Placeholder Account Id** / **Placeholder Contact Id** (`FS_PORTAL_Placeholder_Account_Id__c`, `FS_PORTAL_Placeholder_Contact_Id__c`) | The records a guest's Order is parented to until they identify themselves at checkout. Never shown to the shopper |
| **Guest Account Logic** (`FS_PORTAL_Guest_Account_Logic__c`) | `Bucket Account` puts every guest on one shared Account; `Individual Account` creates one per guest. Ignored when Person Accounts are enabled |
| **Guest Bucket Account Id** (`FS_PORTAL_Guest_Bucket_Account_Id__c`) | The shared Account, when logic is `Bucket Account` |
| **Guest Account Name Pattern** (`FS_PORTAL_Guest_Account_Name_Pattern__c`) | Names the new Account when logic is `Individual Account`, for example `{!FirstName} {!LastName}` |
| **Additional Details Field Set** (`FS_PORTAL_Additional_Details_Field_Set__c`) | A Contact field set shown to guests as **Additional Details**. Leave blank to hide that sub-section |
| **Validate reCAPTCHA For Guests** (`FS_PORTAL_Validate_reCAPTCHA_For_Guests__c`) | Challenges a guest with Google reCAPTCHA on the Cart page before checkout |

## Extension Points

Two fields let you replace built-in behavior with your own Apex. Leave both blank for the shipped behavior.

| Field | Interface | Blank means |
| - | - | - |
| **Store Data Provider Class** (`FS_PORTAL_Store_Data_Provider_Class__c`) | `FS_PORTAL_StoreDataProvider` | The default Store product search |
| **Contact Matcher Class** (`FS_PORTAL_Contact_Matcher_Class__c`) | `FS_PORTAL_StoreContactMatcher` | Guests are matched to an existing Contact by email |

## Validation Rules

Three validation rules protect combinations that would otherwise fail silently at runtime.

| Rule | Fires when |
| - | - |
| `FS_PORTAL_Cart_Business_Unit_Id_Required` | **Cart Business Unit Logic** is `Specific Id` and **Cart Business Unit Id** is blank or not 15 or 18 characters |
| `FS_PORTAL_Guest_Bucket_Acc_Id_Required` | **Guest Account Logic** is `Bucket Account` and **Guest Bucket Account Id** is blank |
| `FS_PORTAL_Placeholder_Ids_Required` | **Continue as Guest User** is on and either placeholder Id is blank |

## Pointing a Component at a Record

Every Store component has a **Store Settings** property holding the record's name, defaulting to `Default`. To run two storefronts, create a second Store Settings record and set that name on the components of the second storefront's pages.

> [!WARNING]
>
> A component pointed at a record that does not exist cannot resolve its settings and reports an error instead of rendering. Check for typos in the name, and remember it is the record's **name**, not its label.

## Limitations and Common Pitfalls with Store Settings

* **No record ships with the package.** Create one first. Naming it `Default` saves setting the property on every component.
* **The five page URLs are required for a reason.** A missing Checkout Page URL, for instance, leaves the shopper's **Continue** click reporting that the checkout page is not configured.
* **Business unit fields do two different jobs.** **Product Business Unit Ids** filters what the Store *shows*; **Cart Business Unit Logic** decides what the Order *gets*. Setting one does not set the other.
* **Currency ISO Codes is ignored in single-currency orgs**, so a picker you expected will not appear.
* **The record's name, not its label, is what components reference.** Renaming the label is safe; renaming the name breaks every component pointing at it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.