Custom Functions and Logic
This page explains the logic the theme applies to product data. For how to fill in each field, see Product field formats.
Availability logic
The Delivery tab on the product page shows a stock label (a coloured dot and a headline), sometimes a supporting line under it, and the buy button. The theme checks the rules below from top to bottom and uses the first one that matches.
The buy button is worked out separately, by a shorter set of rules that only looks at Discontinued Run Out, pre-order and stock. That’s why a Direct Ship Only or Special Order Only product can show Backorder.
”N days” in the supporting lines is the product’s Estimated Lead Time (misc14). If misc14 is blank or 0, that line doesn’t show.
| Order | When | Label | Supporting line | Buy button |
|---|---|---|---|---|
| 1 | Discontinued Run Out (misc26) on, stock 1 or more | Final stock (amber) | This model is being run out — once it’s gone, it’s gone | Add to Cart |
| 2 | Discontinued Run Out on, no stock | No longer available (grey) | This model has been discontinued | None |
| 3 | Direct Ship Only (misc12) on, no stock | Shipped from supplier (amber) | Usually leaves the supplier in N days | Backorder and bell |
| 4 | Special Order Only (misc25) on, stock 1 or more, overselling not allowed on the product | In stock (green) | None | Add to Cart |
| 5 | Special Order Only on, no stock | Special order (amber) | Usually available in N days | Backorder and bell |
| 6 | Special Order Only on, overselling allowed on the product | Special order (amber) | Usually available in N days | Add to Cart |
| 7 | Pre-order by quantity | Pre-order (amber) | Released (arrival date) | Pre-Order Now |
| 8 | On pre-order (a future Date of arrival), stock 1 or more | Pre-order available (amber) | None | Add to Cart |
| 9 | Stock 1 or 2 | Low stock (amber) | Only a few left — contact us for urgent orders | Add to Cart |
| 10 | Stock 3 or more | In stock (green) | None | Add to Cart |
| 11 | No stock, more stock incoming on a purchase order | More on the way (amber) | “Arriving (date)” if the arrival date is in the future, otherwise “Expected in N days”, otherwise “More stock is on its way” | Backorder and bell |
| 12 | No stock, backorders allowed store-wide | Backorder available (red) | Usually back in stock in N days | Backorder and bell |
| 13 | Anything else | Sold out (grey) | Use “Notify Me” below and we’ll email you when it returns | Notify Me |
How to read the table:
- Price on request beats every row. A product shoppers would pay $0 for shows Enquire about this product instead of any of these buttons. The stock label still shows. See Price on request and trade.
- Discontinued Run Out also shows a “This product has been Discontinued” notice on both product templates, at any stock level.
- Row 7 can’t happen on this store. It needs the store setting for pre-orders by quantity, which was off when last probed (14 August 2026). Row 8 is the live pre-order row.
- Row 13 only shows if the store-wide backorder setting is turned off. It was on when last probed (14 August 2026), so an ordinary out-of-stock product gets row 12.
- ”Backorder and bell” is a Backorder button with a bell icon beside it that opens the Notify Me form.
- Bike racks use the same labels and the same buy-button rules.
Delivery lines
Under the stock label, the Delivery tab can add lines built from the product’s shipping options. Each shipping option carries a delivery time (in days) and a daily close time (the dispatch cut-off).
| Line | Shows when | What the shopper sees |
|---|---|---|
| Dispatch cut-off | At least one delivery option has a daily close time other than 00:00. Doesn’t need a postcode | ”Order by 2pm for dispatch today” before the cut-off (Sydney time), otherwise “Dispatches next business day” |
| Delivery time | The shopper has entered a postcode and at least one option has a delivery time above 0 | ”2–4 days to 3000”. If only some options have a time, “from 2 days to 3000” |
| Cost | The shopper has entered a postcode | ”Free shipping to 3000” or “Shipping from $12.50 to 3000”. With no cost and no time set: “Delivery available to 3000” |
Two other messages replace these lines:
- “Available for pick up only” when the product’s only shipping options are pick-up.
- ”Delivery not available to 3000 — please try another postcode.” when no delivery option covers that postcode.
Rules worth knowing:
- A close time of
00:00means not set, not midnight. That option gives no cut-off line. - The earliest cut-off wins. The shopper hasn’t picked a carrier yet, so the line uses the earliest close time across all delivery options.
- The cut-off line doesn’t know about weekends or public holidays. On a Saturday morning it still says “Order by 2pm for dispatch today”.
- Only products that ship from our stock get the cut-off and delivery-time lines. That’s Final stock, In stock (both rows), Low stock and Special Order in stock (rows 1, 4, 9 and 10). Every other row keeps the cost line and the pick-up-only and not-available messages. “No longer available” (row 2) shows no delivery lines at all, and its Pick up tab drops the “can be ordered in” note.
The delivery time and daily close time are held on the store’s shipping rates, not the product, and in August 2026 were still being filled in one shipping table at a time. The delivery time is imported with the rates from the Delivery Times sheet in Shipping Matrix Price Updates.
Product Header Promo Image
A small image on the product page that marks the product as on promotion, and can link to the promotion page. It uses two custom fields: Product Header Promo Image Zone (misc11, the URL of a 346×86 px image) and Product Header Promo Link (misc29, where it links).
- It only shows while the product is on promotion (inside its Maropost promo dates). Outside them it’s hidden, even when the field is filled.
- Standard product page: under the product name, above the price.
- Bike-rack product page: at the bottom of the buy card, below the Add to Cart button.
- Product Header Promo Link does nothing without an image. An image without a link reloads the same page when clicked.
Images hosted off-site work, but it’s best to upload them to our own file system.
For the steps, see Add the promo image to products. Clear both fields after the promotion, or the old image comes back the next time the product goes on promotion.
Document Resource Lists
Document Names (misc9) and Document URL’s (misc19) give a product a list of links to instructions, manuals and other documents. On the standard product page they show in a “Resources” panel. On bike racks they show as links in the Description and Specifications sections.
Both fields are pipe-delimited lists that match by position: the first name goes with the first URL.
Installation guide|Fit listhttps://www.example.com/guide.pdf|/assets/files/fit-list.pdfUse | between items, not a comma (the old convention, still on 6 bike racks in the 2026-10-21 pull), and keep both lists the same length. One missing item shifts every link after it onto the wrong document. Full rules: Documents.
Features List
The Features list renders a strip of cards, each with an image, a heading and a short description. On the standard product page it’s titled “Key Features” and sits at the top of the Description section. On bike racks it’s in the Features section.
It uses three pipe-delimited fields that match by position:
| Field | Holds |
|---|---|
| Features - Image (misc43) | Card image URLs |
| Features - Heading Text (misc44) | Card headings |
| Features - Description Text (misc45) | Card descriptions |
- Standard product page: all or nothing. The cards show only when all three fields are filled. Leave one empty and no cards show.
- Bike racks: card by card. A card shows when it has an image and at least a heading or a description.
Formats, examples and traps: Features cards.
Product Compatibility Years
Compatibility Year Start (misc30) and Compatibility Year End (misc31) aren’t read by the theme. Filling them changes nothing on the site.
For developers
Based on Altapac-ReDev development, read 21 October 2026. Paths are relative to src/templates/.
- Stock label chain:
products/includes/availability_state.template.html(13 arms, first match wins; arm names are published asdata-arm). Node doc:docs/map/availability/Availability.md. - Buy button chain:
products/includes/buying_options.template.html(178-192) and its twinproducts/includes/bikerack/buycard.template.html(95-133). - Delivery lines:
products/includes/availability.template.html(cutoffMinutes,renderDelivery,SHIPS_FROM_STOCK). The AUD-17/AUD-54 gate is commit3ab9b8e; the misc12 zero-stock gate is0d34f07(AUD-52); the document/rule iscbdef95(AUD-13); the Discontinued notice link removal is70161f2(AUD-49); the card misc12 arm is3002f1f(AUD-23). None was onmainon 21 October 2026. - Store configs
ALLOW_NOSTOCK_CHECKOUT = 1andWEBSTORE_USE_PREORDER_QUANTITY = 0:.claude/skills/base-templating/references/value-formats.md(probed 27 July 2026, re-read in the 14 August 2026 availability probe indocs/probes/RESULTS.md). - Promo image:
buying_options.template.html(57-61),bikerack/buycard.template.html(147-151). - Documents:
products/includes/documents.template.html, Resources gate inproducts/template.html. - Features:
products/includes/product_information.template.html(all-three gate),products/includes/features.template.html.