T2 // Economy & Business

coe_shops

Retail Commerce & Cart Checkout

Convenience Stores, Pharmacies & Ammu-Nation with Visual Shopping Cart

INTERFACE // CAPTURE
Retail Commerce & Cart Checkout
01 // OVERVIEW

Shopping interface for commercial establishments. Citizens browse products, adjust item quantities in a shopping cart, review order subtotals with sales taxes, and choose payment methods (Cash or Debit Card). Natively integrates with coe_inventory and coe_economy.

On FiveM Enhanced

Hardware-accelerated DX12 interface loads the 233 high-resolution item icons without hesitation during store browsing.

02 // FEATURES

What the module delivers

01

Interactive Shopping Cart

Add multiple different items and checkout in a single atomic transaction.

02

Dynamic Payment Selection

Pay using physical cash banknotes or direct debit against bank accounts.

03

Player-Driven Inventory Stock

Player-owned stores maintain real finite stocks replenished by freight truckers.

04

Configurable Price Schedules

Business owners can fine-tune markups and seasonal discounts.

ARCHITECTURAL LAYERS // CLEAN ARCHITECTURE

4-Layer Isolation with 0.00 ms Idle

Every COE Framework script strictly follows the principle of separation of concerns. Interact with the 3D stack below:

L4
Presentation & NUI
HTML5 · CSS tokens · CoE UI
CEF DX12
L3
Application & Server
Atomic locks · Rate limiting
Auth Server
L2
Platform & HAL
Core.Platform · Mock natives
Gen9 HAL
L1
Domain & ACID Database
Prepared SQL · MariaDB pool
ACID Pool
LAYER 04 // PRESENTATION & NUI

Responsive NUI & CoE UI Design System

Built with vanilla HTML5, CSS3 tokens, and modern JavaScript. No heavyweight frameworks (React/Vue/Electron). Rendered directly in FiveM DX12's Chromium Embedded Framework at 0.00 ms while closed.

Five themes supported in real time through CSS variables (--coe-accent, --coe-surface)
Fully keyboard-navigable (Tab, Esc, Enter) and ARIA-accessible
Secure asynchronous communication with the FiveM client via fetch("https://...")
ADMIN POWERS // OPERATION & MANAGEMENT

What this script delivers to Server Owners

Manage your city without relying on developers. Runtime parameters, auditing, and ACE-protected commands:

🛡️
ACE Permissions
Administrative operations strictly protected by coe.staff and coe.admin principals.
IsPlayerAceAllowed(src, "coe.admin")
📊
Ledger Auditing
Relevant actions write audit records to the database through coe_audit.
exports.coe_audit:Record(severity, category, event, context)
⚡
0.00ms Idle Telemetry
Event-driven thread dispatch that stays dormant until network events fire.
Clean Architecture & HAL
03 // EXPORTS

Public API 5

Typed contracts to call from other resources. Full types live in types.lua and in the docs reference.

exports['coe_shops']:IsReady() → boolean

Verifies if database migrations are applied and store business records are initialized.

No parameters.

LUA
local result = exports['coe_shops']:IsReady()
exports['coe_shops']:GetShelves(storeId) → table<string,CoeShopsShelf>|nil

Retrieves the product shelves of a player-owned store. Returns `nil` for staff stores (infinite stock) or unknown stores. Serves as the foundation for logistics restocking missions.

ParameterType
storeIdstring
LUA
local result = exports['coe_shops']:GetShelves(storeId)
exports['coe_shops']:IsStore(businessId) → boolean

Checks if a registered business is a retail store managed by `coe_shops`. Used by the business management app to render the Store tab.

ParameterType
businessIdstring
LUA
local result = exports['coe_shops']:IsStore(businessId)
exports['coe_shops']:BusinessTablet(playerId, characterId, businessId, payload) → table

Handles Store tab operations in the business management tablet app. Invoked exclusively by `coe_businesses` (permission validation performed beforehand). `payload.op`: `overview` (shelves, pricing, sales metrics, and cash balance) or `price` (`productId`, `price`; `false` resets to default wholesale price). Restocking and cash withdrawals take place physically at the counter. Error codes: `forbidden`, `not_ready`, `not_a_store`, `unknown_action`, `invalid_price`.

ParameterType
playerIdinteger
characterIdstring
businessIdstring
payloadtable
LUA
local result = exports['coe_shops']:BusinessTablet(playerId, characterId, businessId, payload)
exports['coe_shops']:RegisterPaymentMethod(def) → boolean|table

Registers an extensible payment provider from the calling resource (requires ACE permission `coe.shops.payments`). Registration automatically unbinds when the provider resource stops. `def`: `{ id, label, kind = 'instant'|'pin'|'device', charge, refund, options?, client? (device), order? }`, pointing to export names hosted by the provider. Error codes: `forbidden`, `invalid_method`, `method_taken`, `too_many_methods`.

ParameterType
deftable
LUA
local result = exports['coe_shops']:RegisterPaymentMethod(def)
04 // COMMANDS

In-game commands 1

/lojadebug

F8 diagnostics: nearest store, distance, clerk and interior.