fcomursDocs

Store Developer Guide

Customize a fcomurs store with HTML, CSS and JavaScript — right inside the editor. No server, no build, no deploy.

1.Where things are

Diagram
Online store → Customize (the editor)
│
├─ ⋯ → Edit code  ·  or right-click any section → Edit code / Customize code
│    ├─ Header · Footer          header.html/.css/.js
│    ├─ Your sections  + New     <name>.html · .css · .js · .json
│    ├─ Your blocks    + New     same four files, for a block
│    ├─ Theme sections / blocks  built-in code, read-only → Customize
│    └─ top bar: Docs · Pause custom code · Publish code
│
├─ Custom code (top left)        This page · Whole store · Tracking
└─ Any section/block → Style → For developers   copy #section-… / #block-…
I want to…Go toLive when
Build my own sectionEdit code, Your sectionsPublish code
Build a block for any sectionEdit code, Your blocksPublish code
Change a built-in section/blockRight-click, Customize codePublish code
Own header / footerEdit code, Header / Footerpage Publish
Small CSS on one pageCustom code, This pagepage Publish
Store-wide CSS / scriptsCustom code, Whole storeSave
Analytics, Pixel, TikTok…Custom code, TrackingSave

Tip: drag the edges between panels to resize them (double-click resets).

2.Files at a glance

FileSectionBlockRuns
.htmlHandlebars {{settings.x}}Handlebarsserver + editor preview
.css✓✓browser
.jsgets section, fcgets block, fcstore only (and Preview links)
.jsonsettings blocks starter max_blockssettings onlybuilds the settings panel

3.First section in 5 steps

  1. Edit code, Your sections, + New, type a name, Enter
  2. .json — list what the merchant can change
  3. .html — use them: {{settings.heading}}
  4. Save draft (Ctrl+S), check the preview
  5. Publish code, add it: Add section, Code sections

4.settings.json

JSON
{
  "settings": [
    { "key": "heading", "label": "Heading", "kind": "text", "default": "Why shop with us" },
    { "key": "featured", "label": "Product", "kind": "product" },
    { "key": "layout", "label": "Layout", "kind": "select", "options": ["grid", "list"], "default": "grid" }
  ],
  "blocks": [
    { "type": "card", "label": "Card", "fields": [
      { "key": "title", "label": "Title", "kind": "text" },
      { "key": "image", "label": "Image", "kind": "image" }
    ] }
  ],
  "starter": [{ "type": "card", "settings": { "title": "Easy returns" } }],
  "max_blocks": 12
}
kindTemplate gets
text textarea url color datetimetext
richtextHTML — print with {{{ }}}
imageimage address
selectchosen value (needs options)
number rangenumber (min max step unit)
checkboxtrue / false
producttitle url image price compareAtPrice inStock id slug
collectionname url image slug products
collectionsa list of collections
forma form's id

Field extras: default · help · placeholder. key: starts with a letter; letters, numbers, _.

5.Template cheat sheet

NameSectionBlock
settings.<key>✓✓
blocks (each: id type settings)✓—
section.id / block.id block.type✓✓
store — name logo phone email address currencySymbol✓✓
data — the built-in's own data (customized copies)✓—
HelperExample
eq ne gt lt{{#if (eq type "card")}}
and or not{{#if (and settings.a (not settings.b))}}
default{{default settings.title "Untitled"}}
money{{money price}}, ৳1,990
embed{{embed settings.url}}, YouTube/Vimeo player URL
encode{{encode settings.address}}, safe inside a URL
lines{{#each (lines settings.items)}}{{this}}{{/each}}
Handlebars
<section class="cards">
  <h2>{{settings.heading}}</h2>
  {{#each blocks}}
    {{#if (eq type "card")}}<div class="card">{{settings.title}}</div>{{/if}}
  {{/each}}
  {{#with settings.featured}}<a href="{{url}}">{{title}} — {{money price}}</a>{{/with}}
</section>

{{x}} is escaped (safe). {{{x}}} prints HTML — only for richtext.

6.Script (.js)

fc.Does
submitForm({ form, name, email, phone, message, website })Contact / Email signup, error text or null
submitBuiltForm(formId, answers, website)a form built in Online store, Forms
addToCart(productId, quantity)adds to cart; header count updates
JavaScript
// section = this copy's element (runs once per copy)
section.querySelectorAll('.card').forEach((card) => {
  card.addEventListener('click', () => card.classList.toggle('open'));
});

Doesn't run in the editor preview — test with Preview (beside Publish). Errors show in the console as Code section "<name>".

7.Blocks

Code sectionCode block
On a pagecode:<id>cb:<id>
.jsonsettings + blockssettings only
Script getssectionblock
Added fromAdd section, Code sectionsAdd block, Your code blocks

Which sections take which blocks — accepts in each built-in's schema.json:

SectionsAdd block offers
most ("@theme", the default)every built-in block + your code blocks
Product grid · Featured collection · Collection list · Brand listHeading, Text, Button, Divider, Space

Blocks already on a page stay, even if no longer offered.

8.Customize built-in code

Diagram
Built-in section ──Customize code──▶ "<name> (custom)"   your store only
   settings + its own blocks ─────── kept ───────────▶
   store data (products, slides…) ── as data.* ─────▶
HowWhere
Right-click a section / ⋯, Customize codeon the page
Edit code, Theme sections / Theme blocks, Customizenot placed on a page yet
Back: ⋯, Use original section / blockyour copy stays in Edit code

23 sections and 11 blocks can be customized.

Sectiondata has
Product grid, Featured collectiondata.products
Featured productdata.product (+ images, description)
Collection list / Brand listdata.collections / data.brands
Slideshowdata.slides, data.side
Contact details / Formdata.contact / data.form

Slideshow: use a different banner on phones

Each slide has its own Picture and optional Picture for phones fields. Add or select a slide in the editor, upload the desktop banner under Picture, then upload a phone-specific crop under Picture for phones. Leave the phone picture empty to reuse the desktop banner. The storefront switches at 639px and below; the same slide's link and alt text are kept on both screen sizes.

When customizing the slideshow code, preserve the <picture> pattern:

Handlebars
<picture>
  {{#if mobileImage}}<source media="(max-width: 639px)" srcset="{{mobileImage}}">{{/if}}
  <img src="{{image}}" alt="{{title}}">
</picture>

data.slides supplies image, mobileImage, link, and title for every slide. This is per slide, so a slideshow can have a different phone banner for each desktop banner. The slideshow's separate Side picture setting is for the side-by-side layout, not the mobile banner.

9.Draft → Publish → History

Diagram
write ──Save draft──▶ DRAFT ──Publish code──▶ LIVE
  │ preview as you type   │                     │ old version → History (last 20)
  │                       └──Discard draft──▶ back to live
  └─ Preview link shows drafts (and runs scripts)
ActionWho sees it
Typingthe editor preview
Save draftyou + anyone with a Preview link
Publish code (tick what to publish)every shopper, on every page using it
History, Restore as draft / Restore & publish—
  • Page Publish does not publish code.
  • Two people on one file, *"changed while you were editing"*: Keep mine or Load theirs.

10.Mistakes can't break the store

MistakeWhat happens
Bad settings.jsonred message; can't save
Broken template ({{#if}} not closed)Save refused, file + line in red
Fails while drawingpreview: red box · store: the built-in original (a from-scratch section is left out)
JavaScript erroronly that copy stops; console shows it

Pause custom code (top bar): every customized section/block shows its original, no code scripts run. Nothing deleted.

11.When fcomurs updates a built-in

Your copy never changes by itself. A newer default, Update badge:

  1. Compare — what changed in the default · yours vs the new one
  2. Start from the new default — new files go to your draft (your extra settings kept)
  3. Preview, Publish code
HeaderFooter
{{logo}} {{store_name}}{{logo}} {{store_name}} {{about}}
{{menu}} {{search}}{{categories}} {{social}}
{{cart_count}} (updates itself){{quick_links}} {{info_links}} {{support_links}} {{extra_links}}
{{phone}} {{email}}{{phone}} {{email}} {{address}} {{copyright}} {{year}}

Turn it on: Use this code in Edit code, Header.

13.Colours & selectors

CSS variableFor
var(--primary)prices, links, accents
var(--btn-color) / var(--btn-fg)buttons / their text
var(--nav-bg) / var(--nav-fg)header & footer / their text
var(--background)page
TargetSelector
one section / block#section-<id> · #block-<id> (right-click, Copy CSS selector)
a kind[data-section="product-grid"] · [data-block="button"]
all.fc-section · .fc-heading · [data-code-section] · [data-code-block]

14.Permissions

PermissionCan
Custom codewrite, Save draft, preview, Customize, History
Custom code — publishPublish code, Restore & publish, delete, Pause

Owner has both. Settings, Staff, Page access.

15.Full example — Trust badges

Badges with a click-to-open detail, plus one product.

trust-badges.jsonJSON
{
  "settings": [
    { "key": "heading", "label": "Heading", "kind": "text", "default": "Why shop with us" },
    { "key": "product", "label": "Product to show", "kind": "product", "help": "Optional" },
    { "key": "columns", "label": "Badges per row", "kind": "range", "min": 2, "max": 4, "default": 3 }
  ],
  "blocks": [
    {
      "type": "badge",
      "label": "Badge",
      "fields": [
        { "key": "icon", "label": "Icon", "kind": "text", "default": "✓" },
        { "key": "title", "label": "Title", "kind": "text", "default": "Easy returns" },
        { "key": "detail", "label": "Detail (opens on click)", "kind": "textarea" }
      ]
    }
  ],
  "starter": [
    { "type": "badge", "settings": { "title": "Easy returns", "detail": "Change your mind within 7 days." } },
    { "type": "badge", "settings": { "icon": "⚡", "title": "Fast delivery", "detail": "Inside Dhaka in 1–2 days." } },
    { "type": "badge", "settings": { "icon": "↺", "title": "Easy returns", "detail": "Change your mind within 7 days." } }
  ],
  "max_blocks": 8
}
trust-badges.htmlHandlebars
<section class="tb">
  {{#if settings.heading}}<h2 class="tb-title">{{settings.heading}}</h2>{{/if}}
  <ul class="tb-list" style="--tb-cols: {{default settings.columns 3}}">
    {{#each blocks}}
      {{#if (eq type "badge")}}
        <li class="tb-badge">
          <button type="button" class="tb-head" aria-expanded="false">
            <span class="tb-icon" aria-hidden="true">{{default settings.icon "✓"}}</span>
            {{settings.title}}
          </button>
          {{#if settings.detail}}<p class="tb-detail" hidden>{{settings.detail}}</p>{{/if}}
        </li>
      {{/if}}
    {{/each}}
  </ul>
  {{#with settings.product}}
    <a class="tb-product" href="{{url}}">
      <img src="{{image}}" alt="{{title}}" loading="lazy">
      <span>{{title}} — {{money price}}</span>
    </a>
  {{/with}}
</section>
trust-badges.cssCSS
.tb { max-width: 1100px; margin: 0 auto; padding: 40px 20px; }
.tb-title { margin: 0 0 20px; font-size: 26px; font-weight: 700; text-align: center; }
.tb-list { display: grid; grid-template-columns: repeat(var(--tb-cols), minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 640px) { .tb-list { grid-template-columns: 1fr; } }
.tb-badge { border: 1px solid #e5e5e5; border-radius: 8px; }
.tb-head { display: flex; width: 100%; align-items: center; gap: 10px; padding: 14px 16px; border: 0; background: none; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.tb-icon { color: var(--primary); }
.tb-detail { margin: 0; padding: 0 16px 14px 42px; opacity: 0.75; }
.tb-product { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: inherit; text-decoration: none; }
.tb-product img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
trust-badges.jsJavaScript
section.querySelectorAll('.tb-head').forEach((head) => {
  const detail = head.nextElementSibling;
  if (!detail) return;
  head.addEventListener('click', () => {
    const open = head.getAttribute('aria-expanded') === 'true';
    head.setAttribute('aria-expanded', String(!open));
    detail.hidden = open;
  });
});
Then
Save draftred bar = a mistake, with the file
Place itAdd section, Code sections, Trust badges, pick a product
Test the scriptPreview (beside Publish)
Go livePublish code, tick it, Publish; then the page's Publish
UndoHistory, Restore & publish · or Pause custom code

As a block instead: Your blocks, + New, Badge; its .json has only settings (icon, title, detail); script uses block instead of section.

16.Limits & fixes

Limit
Each file100,000 characters (.json 20,000)
Code sections / blocks per store50 / 50
Historylast 20 publishes each
ProblemFix
Saved, store unchangedSave draft is only a draft, Publish code
No Publish buttonyou have write-only access — ask the owner
Script does nothingnot in the editor preview — use Preview; check console
CSS hits other sectionsstart selectors with #section-<id> or your own class
{{settings.x}} emptynot in .json, or empty, {{default settings.x "…"}}
My block isn't in Add blockthat section doesn't accept it — use Rich text / Custom section
Customized section looks like the originalcode paused, or its template fails — see the preview's red box