The great nutrition-table rescue
About a thousand hand-edited, screen-reader-hostile nutrition tables, parsed into structured Drupal fields and swapped for clean, accessible templates, with an admin signing off on every product. It’s big enough to get its own case study.
- Accessibility
- PHP
- Text Parsing/Regex
- Drupal
Every product line, its own colors
Each product line (Supplements, Natural Foods, Sports Nutrition, Essential Oils, Beauty & Health and more) got matching product listings, on-sale pages and category info, and each has its own color scheme. Compare Supplements with Beauty & Health.
The trick is a single class: each section sets a class on the <body>, and the Sass maps that class to its brand colors for headings, buttons and other key elements. One set of templates, multiple distinct looks.
- Drupal
- CSS
- Sass
- Data Architecture
Blocks for editors
Most pages are built with Drupal’s Layout Builder and a set of custom blocks, so editors can lay out pages freely without ever touching code. The blocks include a Mailchimp signup, carousels of related content, and customizable WYSIWYG sections.
- Drupal
- Layout Builder
- Mailchimp API
Related content that knows the catalog
Products and articles suggest related content using Drupal entity queries. The matching is based on shared taxonomies (several levels deep) plus NOW’s own business rules, so a vitamin page points to the right articles, and an article points back to the right products.
- Drupal
- PHP
- Data Architecture
One menu, every screen
A single, unified menu that behaves differently depending on screen size and scroll position, built from one set of templates, jQuery and SCSS rather than separate desktop and mobile menus. It all meets WCAG accessibility standards.
- JavaScript
- Sass
- Accessibility
- Responsive Web Design
Product listings
For shopping, one Views-powered product search serves the whole catalog of about a thousand products in several versions. The full versions, like All Supplements and All Natural Foods, give shoppers keyword search, sorting, and checkbox filters for On Sale, In Stock and category. Other versions, like the category and health-need pages (Digestive Support, for one), are the same view, pre-filtered by the URL.
The Sale page shows the idea best. It’s the same view with “on sale” built into the URL and the checkbox hidden, because nobody on the sale page is going to uncheck “on sale.” It’s a small thing, but it means one listing to maintain instead of a dozen, and no pointless controls for shoppers.
Product finders
Where the listings help you find a product you already have in mind, the finders work more like a recommendation engine. They’re guided, multi-page quizzes built as Drupal webforms, like the Probiotic & Gut Health Product Finder. Shoppers answer one question per page, starting with their age group, and land on products that fit. Because they’re webforms, NOW’s team can build and edit finders without a developer.
Smoothie Builder
The Smoothie Builder is built around a health coach’s formula of protein, fat, fiber and greens, plus a liquid and a few optional extras. The ingredient types and the ingredients in each one are managed in the CMS, and each type becomes its own carousel of selectable thumbnails. There are also a few featured smoothies you can load in and customize.
Pick one from each carousel, and your choices are saved under a random token, so the results page gets its own URL that you can bookmark, share or email to yourself. That email option doubles as a signup for NOW’s newsletter, with a consent checkbox. The results page lays out the full recipe, with amounts, and a shopping list of the NOW products in it, each with an add-to-cart button.
- Drupal
- JavaScript
- UI/UX
- E-Commerce
Structured data for search and crawlers
Every product page carries schema.org Product and BreadcrumbList data as JSON-LD, filled in automatically from the commerce fields: price, SKU, category, brand and availability. It powers rich results in search, and it also feeds a third-party integration that crawls NOW’s product data, so it had to be accurate across the whole catalog.
Cart and checkout
A custom, session-based PHP shopping cart hooked up to Braintree Hosted Fields, so card details go straight to Braintree and never touch NOW’s servers, which keeps PCI compliance simple. A lot of the work went into the multi-page checkout flow itself, and it all ends in nicely styled HTML receipt emails.
Smart product galleries
Pick a size or dosage and the product slideshow jumps straight to the matching photo. The size and amount options in the add-to-cart form each got an extra click handler, added with JavaScript, that advances the slideshow to the right image.
The slideshows across the site are built on Slick, Ken Wheeler’s carousel library and a favorite of mine across many projects.