Your catalog is searchable by name and CAS number, which works right up until
the buyer knows neither. They know the structure. This lets them draw it.
A shopper clicks a button, draws a molecule, and gets back the products in your
catalog that match — either the same substance, or every product containing what
they drew. Draw a benzene ring and you get everything with a benzene ring in it.
Results are rendered with your theme’s own product template, so they look
like the rest of your shop: your prices, your badges, your add-to-cart buttons.
Any WooCommerce store that sells by structure: chemical suppliers and
distributors, reagent and laboratory supply shops, building-block and
screening-compound vendors, custom synthesis and research chemical sellers,
fine chemical and pharmaceutical intermediate catalogs. If your buyers think
in molecules, SMILES strings and CAS numbers, this gives them a search box
that speaks their language: chemical structure search, substructure search,
SMILES search, CAS number lookup and plain product name search, all in one
drawer on your product pages.
The chemistry toolkit is large — around 10 MB between the structure editor and
the chemistry engine — and none of it is downloaded until a shopper actually
clicks to open the drawing editor. A page with the search widget on it costs
about 11 KB of JavaScript. A page without one costs nothing at all: no scripts,
no styles, no requests.
Searching happens in the shopper’s browser against a small index file, so it
puts no load on your database however many people are searching at once.
Matching is done by RDKit, the standard open-source
cheminformatics toolkit, compiled to WebAssembly. The same code canonicalises
your catalog when you build the index and canonicalises what the shopper draws,
so the two are always comparable. Aromaticity, tautomers, salts, stereochemistry
and isotopes are handled by RDKit rather than by string matching — deuterated
solvents stay distinct from their ordinary counterparts.
Everything described on this page is in this plugin and stays free. A separate
Pro add-on, sold by Branching Software, adds tools for keeping a catalog’s
structures complete and for seeing what shoppers want:
The add-on installs as a second plugin and adds its tabs to this plugin’s
screen. See https://branchingsoftware.com/chemical-structure-search/.
This plugin bundles two open-source libraries, both redistributed under their own
terms with their licence files included:
assets/vendor/rdkit), the cheminformatics toolkit that performsassets/vendor/jsme), the structure drawing editor,Neither library contacts any external service. Both run entirely in the
visitor’s browser, and this plugin makes no outbound requests of its own.