Sync Display Variations

Auto-populates a "Display" product's description and regular price from the source products that go into it - single-clicker matches, pa_ends shape combos, and simple-product bundles - with per-display curation, component stock decrement on sale, and out-of-stock notes, via a WooCommerce → Sync Displays admin tool.

WooCommerce v1.2.1

Sync Display Variations - WordPress Plugin

Auto-populate each WooCommerce "Display" variation's description and regular price from the individual clickers that go into it.

A display variation is one gauge (and colour) combination - for example a *18g Yellow Gold* display. It should contain one of every size of the matching individual clicker for that same gauge and colour. This plugin works that out for you: it finds the matching clicker product, lists every size that belongs in the display, and sets the display variation's description (the "1x ..." includes list) and regular price (the sum of those clickers' regular prices).

Installation Instructions

  • 1. Download: You've already downloaded the plugin! The file sync-display-variations_1.2.1.zip contains the complete plugin.
  • 2. Upload to WordPress:
  • Login to your WordPress admin dashboard
  • Navigate to Plugins → Add New
  • Click Upload Plugin at the top of the page
  • Choose the sync-display-variations_1.2.1.zip file
  • Click Install Now
  • 3. Activate:
  • After installation, click Activate Plugin
  • 4. Run a sync:
  • Go to WooCommerce → Sync Displays
  • Review the matches: each display shows which clicker product it was paired with, the reasoning, and a confidence flag
  • Check each display variation's item list and computed new price
  • Tick the displays you want and click Apply checked displays

Display types

A product is treated as a display if its title contains the word display or it lives in a category whose name/slug contains it (configurable). Each display is filled from one or more source products - one of every size - and falls into one of three shapes:

  • Clicker - a variable display matched to a single clicker product. Each variation (gauge, and colour when present) collects every size of that clicker. Matching is automatic: the clicker must be a variable product with a pa_size attribute plus every non-size attribute the display has. Candidates are scored on exact attribute-set match, overlapping term values, and title tokens (e.g. 18kt, titanium) so a gold display never crosses onto a titanium clicker. Low-confidence matches are flagged.
  • Combo - a variable display with a pa_ends attribute (configurable) whose values bundle several shape products, e.g. disc_bumpy = the Disc product + the Bumpy product. Each value is split into shape tokens; source products are matched by shape token + a shared title token (metal/family). The variation collects every size of each matched product, filtered by colour.
  • Bundle - a simple (non-variable) display product. It sums every variation of a curated set of source products and writes the description + price to the product itself. Members are auto-detected by a product tag shared with the display.

Curating a display's contents

Auto-detection only *proposes* the source products. Under each display the tool shows a checkbox per candidate - tick to include, untick to remove. Your choice is saved per display (in post meta), so e.g. "all Ti threadless fronts *except* the Freckle Disc" sticks across future runs. Use Save selections only to store curation without touching prices, or Apply checked displays to save and write.

Stock sync (after Apply)

Displays are not stock-managed themselves. Once a display has been applied, the plugin remembers which source variations feed it and keeps things in sync at runtime:

  • Selling a display decrements each of its managed source variations by one per unit sold. Sources that don't manage stock (typically titanium) are left alone. Stock is put back if the order is cancelled or refunded.
  • When a source size sells out, every display that includes it has its description rebuilt so that line is flagged *"(Out of stock, will ship later)"* - and the flag clears again when the size is back in stock.

The includes list is ordered by size (4mm, 5mm, … 10mm, 11mm), not alphabetically. The out-of-stock note text is the CLKDS_OOS_NOTE constant.

Diagnostics

The Open diagnostics button (read-only) lists every display and source product the tool can see - type, status, categories, and variation-attribute slugs - and, for any display that isn't picked up, the reason why.

Configuration

Edit the constants near the top of plugin.php:

  • CLKDS_DISPLAY_KEYWORD - the title word that identifies a display (display).
  • CLKDS_SIZE_ATTR - the size attribute the clicker has and the display does not (pa_size).
  • CLKDS_ONLY_IN_STOCK - set true to count only in-stock clicker variations.
  • clkds_overrides() - force a display_id => clicker_id pairing when auto-match gets it wrong.
  • clkds_format_item_line() - change the wording/order of each includes line.

Safety

  • Nothing is written until you review the preview and click Apply.
  • Apply always recomputes from scratch and never trusts posted values.
  • A display variation that matches zero clickers is skipped, never zeroed.

License

GPLv2 or later.