Common changes
Steps and file lists for routine code changes to the ASC storefront.
Each entry lists the files that must change together. Release every change as described in Releasing a change.
Change a booking form label
No code. Theme settings, ASC - Camp Booking. See Booking form and cart.
Add a field to the booking form
- Add the field to the Zod schema in
src/components/models/ParticipantDetailsSchema.tsx. - Add the input to
src/components/ParticipantDetails.tsx, with a default in the form's initial values. - Add its label and placeholder settings to the ASC - Camp Booking group in
theme/config/settings_schema.json, pass them through the config object intheme/layout/theme.product.liquid, and type them insrc/components/types.d.ts. - Check how
finalSubmitinsrc/components/CampBooking.tsxbuilds the properties, and add conditional handling if the field depends on a switch. - Map the new property to Zoho in
asc-api-src-zoho-integration. - If saved children should remember it, add it to
asc-api-membership-passand to the mapping insrc/components/SavedChildrenDropdown.tsx. - Build and commit the bundles in the theme repository.
Release the Zoho integration change first. Orders placed with the new property before then are still processed, but the value is not recorded in Zoho.
Change the cart page
Edit theme/sections/asc-new-cart-layout.liquid, not asc-cart-items.liquid or asc-cart-actions.liquid. Button behaviour is in src/js/custom.js. Styles are in src/css/new-cart-layout.css, which needs a rebuild. See Cart and membership pass.
Add a Tailwind class
Tailwind generates classes it finds in src/**/*.{ts,tsx} and in the theme's sections, snippets and layout folders.
A class used only in src/js/*.js, theme/assets/*.js, a JSON template or a theme setting value is not generated. Add it to safelist in src/tailwind.config.js, rebuild, and commit theme/assets/styles.css.
Change a brand colour
Colours are CSS variables in src/css/tw_in.css, referenced by name in src/tailwind.config.js. Change the variable, rebuild and commit styles.css. Update the matching values in doc-site/content/diagrams/generate.mjs if the diagrams should follow.
Add a theme section
- Create
theme/sections/<name>.liquidwith a schema. Includepresetsif staff should be able to add it from the theme editor. - Put section CSS in
src/css/<name>.cssand import it fromsrc/js/index.js. Put section JavaScript intheme/assets/<name>.jsand load it from the section withdefer. - Add the section to a template, or let staff add it.
- If its script should wait for user interaction, match it in
window.YETT_BLACKLISTin both layouts. If it must run immediately, make sure it does not match.
Add a page template
- Copy the nearest
theme/templates/page.*.json. - Connect Hero Video and Thumbnail to the page metafields with dynamic sources, as in
page.find-a-camp-sport.json. - Keep a
camp-findersection on any template with a map, because the map reads its pin images fromwindow.theme.campFinder. - Add the template to City and sport pages.
Point the storefront at a different pass service
Change theme setting ASC - Membership Pass, Google Cloud API URL. The value must end with /. No rebuild is needed.
Point club search at a different integration service
Change ZOHO_INTEGRATION_API_ENDPOINT in src/.env, without a trailing /, rebuild and commit camp-booking.bundle.js.
Replace the Google Maps key
- Set
GOOGLE_PLACES_API_KEYinsrc/.env. - Replace the key literal in the loader in
src/js/camp-booking.js. - Rebuild and commit
camp-booking.bundle.jsandvendors-booking.bundle.js. - Restrict the new key in Google Cloud to the store's domains and the Maps JavaScript and Places APIs.
Change a Zapier hook URL
Theme settings, ASC - Webhooks. The third setting is labelled "Brochure Download Webhook" but is form_submission_webhook, used for general Hulk form submissions.
Record a Zoho function change
Copy the function body from Zoho CRM into the matching file in misc/deluge-scripts/ and commit it with a message naming the Zoho change. The files are a record only. Nothing deploys them.
Update these docs
Edit the Markdown in doc-site/content/. Page order is set by each folder's meta.json.
For diagrams, edit the DIAGRAMS array in doc-site/content/diagrams/generate.mjs and run:
node doc-site/content/diagrams/generate.mjsIt rewrites every .svg beside it and every .excalidraw in diagrams/source/. Relative links between pages must start with ./ or ../.
Cart and membership pass
The live cart section, the JavaScript behind its buttons, the membership pass request, and the disabled cart code that still sits beside it.
Testing
What to check before releasing a storefront change, given there are no automated tests, and how to test bookings without affecting Zoho.