Skip to content

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.

OrderWhenLabelSupporting lineBuy button
1Discontinued Run Out (misc26) on, stock 1 or moreFinal stock (amber)This model is being run out — once it’s gone, it’s goneAdd to Cart
2Discontinued Run Out on, no stockNo longer available (grey)This model has been discontinuedNone
3Direct Ship Only (misc12) on, no stockShipped from supplier (amber)Usually leaves the supplier in N daysBackorder and bell
4Special Order Only (misc25) on, stock 1 or more, overselling not allowed on the productIn stock (green)NoneAdd to Cart
5Special Order Only on, no stockSpecial order (amber)Usually available in N daysBackorder and bell
6Special Order Only on, overselling allowed on the productSpecial order (amber)Usually available in N daysAdd to Cart
7Pre-order by quantityPre-order (amber)Released (arrival date)Pre-Order Now
8On pre-order (a future Date of arrival), stock 1 or morePre-order available (amber)NoneAdd to Cart
9Stock 1 or 2Low stock (amber)Only a few left — contact us for urgent ordersAdd to Cart
10Stock 3 or moreIn stock (green)NoneAdd to Cart
11No stock, more stock incoming on a purchase orderMore 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
12No stock, backorders allowed store-wideBackorder available (red)Usually back in stock in N daysBackorder and bell
13Anything elseSold out (grey)Use “Notify Me” below and we’ll email you when it returnsNotify 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).

LineShows whenWhat the shopper sees
Dispatch cut-offAt 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 timeThe 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”
CostThe 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:00 means 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 list
https://www.example.com/guide.pdf|/assets/files/fit-list.pdf

Use | 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.

Features List

It uses three pipe-delimited fields that match by position:

FieldHolds
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 as data-arm). Node doc: docs/map/availability/Availability.md.
  • Buy button chain: products/includes/buying_options.template.html (178-192) and its twin products/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 commit 3ab9b8e; the misc12 zero-stock gate is 0d34f07 (AUD-52); the document / rule is cbdef95 (AUD-13); the Discontinued notice link removal is 70161f2 (AUD-49); the card misc12 arm is 3002f1f (AUD-23). None was on main on 21 October 2026.
  • Store configs ALLOW_NOSTOCK_CHECKOUT = 1 and WEBSTORE_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 in docs/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 in products/template.html.
  • Features: products/includes/product_information.template.html (all-three gate), products/includes/features.template.html.