π οΈ Cart Config Entry Points
Every part of the cart is editable. No code changes needed for most adjustments.
π Structure: All config in config/cart/*.json files.
cart.html reads these on page load. Edit JSON β refresh page β new behavior.
β οΈ Will change: All values below are starting points. Update as your business evolves.
π Summary: 6 Config Files
| What to change | File | When |
| π¦ Shipping methods, prices, carriers | config/cart/shipping.json | Add/remove methods, change rates |
| π Countries, currencies | config/cart/countries.json | Add country, change currency |
| π DDP / DAP details | config/cart/trade_terms.json | Change trade terms, add EXW/FOB |
| π¬ WhatsApp / WeChat / Email / Phone | config/cart/contact.json | Update real contact info |
| π° Bulk discount tiers | config/cart/discounts.json | Change 5/10/15/20/25% |
| π Default cart (demo) | config/cart/default_cart.json | Change demo items |
π¦ Shipping Methods & Prices
π¦ Shipping methods list JSON
config/cart/shipping.json β shipping_methods[]
Add, remove, or rename shipping options. Each has id, name, carrier, delivery time, weight range.
{
"id": "standard",
"name": "Standard Shipping",
"carrier": "DHL / FedEx",
"delivery": "3-7 days",
"weight_range": "0.5-21 kg",
"icon": "β‘",
"recommended": true,
"show_when": "weight_under_21kg"
}
To add a new method: Copy an entry, change id/name/carrier.
To remove: Delete the entry.
show_when options: always / weight_under_21kg / weight_21kg_or_more
π° Shipping prices (per weight) JSON
config/cart/shipping.json β price_tiers[]
How much shipping costs at each weight range. 8 tiers from 0 to 100+ kg.
{"min_kg": 5, "max_kg": 11, "price_usd": 25.00}
To change a price: Edit the price_usd for that tier.
To add a tier: Insert a new entry with min_kg / max_kg / price_usd.
For 100+ kg: Set price_usd: null and note: "Quote required".
π Countries
π Country list + currencies JSON
config/cart/countries.json β countries[]
Which countries customers can ship to. Currency, WeChat availability.
{
"code": "US",
"flag": "πΊπΈ",
"name": "United States",
"currency": "USD",
"wechat_ok": false
}
To add a country: Add a new entry with all 5 fields.
To disable a country: Remove the entry (or add an enabled: false field).
wechat_ok: false = US/EU (where WeChat is restricted), true = Asia/Africa.
π Trade Terms (DDP / DAP)
π Trade terms options JSON
config/cart/trade_terms.json β trade_terms[]
What trade terms customers can choose (DDP, DAP, EXW, FOB, etc.)
{
"code": "DDP",
"name": "DDP (all included)",
"description": "β Price includes shipping + duties + taxes.",
"color": "#2E7D32",
"default": true
}
To add EXW/FOB/CIF: Add new entries (Incoterms 2020 list).
To change default: Set default: true on one term, false on others.
To remove a term: Delete the entry (but keep at least one).
π DDP vs DAP comparison table JSON
config/cart/trade_terms.json β guide.comparison_table[]
The comparison table shown in the "DDP vs DAP" tab.
{"aspect": "Customs duties", "DDP": "Included", "DAP": "You pay"}
Edit any row to change what customers see. Add rows for more aspects.
π¬ Contact channels (WhatsApp/WeChat/Email/Phone) JSON
config/cart/contact.json β channels[]
Contact buttons shown in the "Contact Us Directly" section.
{
"id": "whatsapp",
"name": "WhatsApp",
"icon": "π¬",
"phone": "+8613800000000",
"enabled": true
}
π΄ CRITICAL β Replace placeholders:
β’ "phone": "+8613800000000" β your real WhatsApp number
β’ "wechat_id": "your_store_id" β your real WeChat ID
β’ "address": "sales@yourstore.com" β your real email
β’ "phone": "+86-571-XXXX-XXXX" β your real phone
To add Telegram: Add a new entry with id: "telegram".
To disable a channel: Set enabled: false.
π Auto-message template JSON
config/cart/contact.json β auto_message_template
What message gets pre-filled when customer clicks WhatsApp/WeChat/Email.
"Hi! I'd like to order:
{items}
Ship to: {country}
..."
Available placeholders: {items}, {country}, {trade_term},
{shipping_method}, {weight}, {total}.
π° Discounts
π° Bulk discount tiers JSON
config/cart/discounts.json β tier_discounts[]
Volume discount: buy more get lower price per piece.
{"min_qty": 100, "max_qty": 499, "discount": 0.15, "label": "Bulk"}
To change 5% to 7%: Change "discount": 0.05 to 0.07.
To add a tier (e.g. 2000+): Add a new entry.
For "Contact for quote": Set max_qty: null.
π‘ Bulk discount tip text JSON
config/cart/discounts.json β bulk_tip
The yellow tip text shown in the cart.
"π‘ Bulk Discount: 10+ 5% off | 50+ 10% off | ..."
Edit the text. Use HTML tags like <strong> for bold.
π Default Cart (Demo)
π Items in default cart JSON
config/cart/default_cart.json β default_cart[]
The 3 items shown when a new visitor opens the cart (for demo purposes).
[{"sku": "LM8UU-POM", "qty": 100}]
Change SKUs and quantities. Use real SKUs from your product catalog.
π How It Works
1. User opens cart.html
β
2. Browser fetches all config/cart/*.json files
β
3. JS reads: shipping methods, countries, contact info, etc.
β
4. Cart renders with current config
β
5. User interacts (changes country, selects shipping, etc.)
β
6. When user clicks "Email Invoice":
- Lead saved to localStorage (or POST to backend)
- Invoice opens in new tab
β
7. To change behavior: edit JSON β refresh page
β
Key principle:
- Data (what to display) β in JSON files
- Behavior (how it works) β in cart.html JavaScript
- Style (colors, sizes) β in cart.html CSS
Most day-to-day changes = edit JSON, no code.