Farbest Product Catalog
A custom WordPress plugin for Farbest
by BeckerGuerry · github.com/bluepraise/farbest-ingredient-catalog · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/bluepraise/farbest-ingredient-catalog/archive/refs/heads/main.zipCustom WordPress plugin replacing WooCommerce with a streamlined product catalog solution featuring advanced filtering, search, and automated email routing.
Overview
- Client: Farbest (via BeckerGuerry)
- Version: 1.1.0
- WordPress: 6.0+
- PHP: 7.4+
- Dependencies: Advanced Custom Fields Pro
Features
- Custom Post Type for ingredients with comprehensive ACF field groups
- Taxonomy system for ingredient categories, claims, certifications, and applications
- React-powered filtering and search interface
- Automated email routing based on sales representative codes
- Contact form with product sheet and quote requests
- REST API endpoints for frontend integration
- Canonical ingredient archive at
/ingredients/with plugin-owned hero/layout - Template override system for theme customization
- WP-CLI migration tool for WooCommerce products
Installation
- Upload the plugin to
/wp-content/plugins/farbest-product-catalog/ - Install Advanced Custom Fields Pro if not already installed
- Activate the plugin through WordPress admin
- Configure email routing in Ingredients → Email Settings
- Run
npm installandnpm run buildto compile React assets
Development
Build Assets
# Install dependencies
npm install
# Development mode (watch)
npm start
# Production build
npm run build
File Structure
farbest-product-catalog/
├── farbest-product-catalog.php # Main plugin file
├── includes/ # PHP classes
│ ├── class-post-types.php
│ ├── class-taxonomies.php
│ ├── class-acf-fields.php
│ ├── class-contact-form.php
│ ├── class-email-routing.php
│ ├── class-template-loader.php
│ └── class-migration.php
├── templates/ # Template files
│ ├── single-ingredient.php
│ ├── archive-ingredient.php
│ └── contact-form.php
├── assets/
│ ├── src/ # React source
│ │ ├── index.js
│ │ ├── components/
│ │ └── styles/
│ ├── build/ # Compiled assets
│ ├── css/ # Admin CSS
│ └── js/ # Admin JS
└── package.json
Usage
Ingredients
Add ingredients through WordPress admin under Ingredients → Add New. Each entry includes:
- Basic information (title, description, featured image)
- Product details (applications, packaging, product sheet PDF)
- Specifications (protein content, moisture, pH, etc.)
- Sales representative routing codes
Contact Form
Insert contact form using shortcode:
[fpc_contact_form product_id="123"]
Or use in templates:
<?php echo do_shortcode('[fpc_contact_form product_id="' . get_the_ID() . '"]'); ?>
Email Routing
Configure representative email routing in Ingredients → Email Settings:
101|john@farbest.com
102|jane@farbest.com
Migration
Migrate WooCommerce products using WP-CLI:
# Dry run (no changes)
wp farbest migrate --dry-run
# Migrate all products
wp farbest migrate
# Migrate limited number
wp farbest migrate --limit=50
Template Customization
Override templates by copying them to your theme:
your-theme/
├── farbest-catalog/
│ ├── single-ingredient.php
│ ├── archive-ingredient.php
│ └── contact-form.php
REST API Endpoints
Get Ingredients
GET /wp-json/farbest/v1/ingredients
Parameters:
categories- Filter by ingredient category slug(s)claims- Filter by claim slug(s)certifications- Filter by certification slug(s)applications- Filter by application slug(s)search- Search termorderby- Sort field (nameordate)order- Sort direction (ASCorDESC)page- Page numberper_page- Results per page (default: 12)
Get Single Ingredient
GET /wp-json/farbest/v1/ingredients/{id}
Get Filter Options
GET /wp-json/farbest/v1/filter-options
Submit Contact Form
POST /wp-json/farbest/v1/submit-contact
Hooks & Filters
Filters
fpc_email_subject- Customize email subjectfpc_email_message- Customize email message
Support
For support, contact BeckerGuerry development team.
License
GPL v2 or later