Skip to main content

Theme Overview

Documentation for the custom Hello Elementor child theme powering TenPoint Crossbows.

Theme Details

Name: Hello Elementor (Child Theme)
Base: Hello Elementor v2.2.0
Status: Heavily customized with Rhino Group modules
Location: wp-content/themes/elementor/

Key Features

Elementor Integration

  • Full Elementor Pro theme builder support
  • Custom body classes for CSS targeting: suma-ct-{document_slug}
  • Font display optimization: 'swap' for Google Fonts
  • Removes Font Awesome & Eicons to reduce bloat
  • All core Elementor locations registered

WooCommerce Customizations

Located in: inc/class-woocommerce.php

Product Features:

  • Custom product image handling via <picture> elements
  • Responsive images with rear view support (crossbow-specific)
  • Product variations with custom pricing and SKU fields
  • Custom related products rendering
  • Back-in-stock button integration
  • Product schema markup

Checkout & Orders:

  • Custom checkout validation (prevents email in street address)
  • Gift card support
  • Custom order statuses:
    • wc-awaiting-shipment
    • wc-invoiced
    • wc-partially-shipped
  • Payment method filtering in admin
  • Exported status column integration

Admin Columns:

  • "Exported to Epicor" status
  • Payment method filtering
  • Custom product columns

Specialized Modules

Located in: inc/

ModuleFilePurpose
Adminclass-admin.phpTheme settings options page, cache clearing, admin bar customization
Product Contentclass-product-content.phpProduct listing customization, schema markup, Bazaar Voice integration
Bazaar Voiceclass-bazaar-voice.phpReviews & ratings sync, REST API (/bv/v1/statistics-update)
Recall Checkerclass-recall.phpSerial number validation against recall database
Gravity Formsclass-gravity-forms.phpDefault field values, warranty registration validation
FacetWPclass-facetwp.phpCategory name mapping for facet display
Algoliaclass-algolia.php + class-algolia-custom-search.phpInstantSearch integration
Elementor Blocksclass-elementor-blocks.phpCustom widget registration
Frontend Assetsclass-frontend.phpCSS/JS enqueue management
PayTomorrowclass-custom-paytomorrow.phpFinancing widget customization
Dealer Locatorclass-dealer-locator.phpDealer search integration
Elite Warrantyclass-elite-warranty.phpWarranty product handling
Rate Limiterclass-rate-limiter.phpAPI request rate limiting
Regulationsclass-regulations.phpCompliance messaging
Theme Orchestratorclass-theme.phpBootstrap entire theme system

File Structure

wp-content/themes/elementor/
├── functions.php # Theme entry point
├── style.css # Theme stylesheet header
├── style.min.css # Minified styles
├── theme.css # Compiled theme styles
├── theme.min.css # Minified theme styles
├── editor-style.css # Block editor styles
├── inc/ # Custom modules
│ ├── class-theme.php # Main orchestrator
│ ├── class-admin.php
│ ├── class-woocommerce.php
│ ├── class-product-content.php
│ ├── class-bazaar-voice.php
│ ├── class-recall.php
│ ├── class-gravity-forms.php
│ ├── class-facetwp.php
│ ├── class-algolia.php
│ ├── class-elementor.php
│ ├── class-frontend.php
│ └── [other modules...]
├── suma-utils/
│ └── init.php # Theme bootstrap
├── assets/
│ ├── css/
│ │ └── custom.css # Custom CSS (v2.0.6)
│ ├── js/
│ │ └── bundle.js # Compiled JS (v2.3.5)
│ └── images/
├── templates/ # Custom templates
├── api.php # AJAX endpoint
├── webpack.mix.js # Laravel Mix config
├── gulpfile.js # Gulp build tasks
└── mix-manifest.json # Asset versioning

Frontend Assets

JavaScript Libraries (CDN)

  • jQuery 2.2.4
  • Swiper (latest)
  • Fancybox 3.5.7 (for video library)
  • Picturefill 3.0.3 (responsive images polyfill)

Theme Assets

  • CSS: assets/css/custom.css (v2.0.6)
  • JS: assets/js/bundle.js (v2.3.5)
  • Algolia: Conditional load on page 6832
  • Warranty Page: Dequeues eBiz billing script on page 4550

Localized JavaScript

elementorRest = {
nonce: 'wp_rest_nonce_value',
root: '/wp-json/'
};

Custom REST Endpoints

Bazaar Voice Statistics Update

Endpoint: POST /wp-json/bv/v1/statistics-update
Auth: Nonce-based
Purpose: Update product review statistics from Bazaar Voice API

Process:

  1. Batch processes 100 products at a time
  2. Queries Bazaar Voice API for review stats
  3. Updates product meta:
    • bazaarvoice_review_count
    • bazaarvoice_average_rating
    • bazaarvoice_last_review_date
  4. Rate limiting via bazaarvoice_last_update meta

Custom AJAX Endpoints

Location: /api.php
Query Parameter: ?action={action_name}

ActionPurpose
check_serial_numberValidate serial against recall database
current_cart_countGet current cart item count
check_selectionProduct selection validation

Custom Database Tables

Serial Numbers

Table: wp_serial_numbers

ColumnTypePurpose
idBIGINTPrimary key
serial_numberVARCHAR(255)Serial number
product_idBIGINTWooCommerce product ID
order_idBIGINTWooCommerce order ID
registered_atDATETIMERegistration timestamp

Recalled Serial Numbers

Table: wp_serial_numbers_recalled

ColumnTypePurpose
idBIGINTPrimary key
serial_numberVARCHAR(255)Recalled serial number
recall_dateDATEDate of recall
reasonTEXTRecall reason

Theme Hooks

WordPress Core Hooks

HookPriorityCallbackPurpose
wp_enqueue_scripts10Frontend::enqueue_assets()Queue CSS/JS
wp_enqueue_scripts20Theme::dequeue_wc_styles()Remove WC default CSS
after_setup_theme10Theme::theme_support()Register theme features
init10Theme::register_menus()Register navigation menus

WooCommerce Hooks

Product Display:

  • woocommerce_before_add_to_cart_form
  • woocommerce_single_product_summary
  • woocommerce_after_single_product_summary
  • woocommerce_product_options_pricing
  • woocommerce_variation_options_pricing
  • woocommerce_product_options_advanced
  • woocommerce_product_options_sku

Checkout & Orders:

  • woocommerce_checkout_process (validation)
  • woocommerce_order_status_changed
  • woocommerce_payment_complete
  • woocommerce_thankyou

Admin:

  • manage_shop_order_posts_custom_column
  • manage_product_posts_custom_column
  • restrict_manage_posts (order filtering)

Elementor Hooks

  • elementor/theme/register_locations → Register theme builder locations
  • elementor/frontend/after_enqueue_styles → Remove Font Awesome
  • elementor/widgets/widgets_registered → Register custom widgets

Theme Support

Registered features:

add_theme_support('title-tag');
add_theme_support('post-thumbnails');
add_theme_support('align-wide');
add_theme_support('post-formats', ['aside', 'gallery', 'video']);
add_theme_support('woocommerce');
add_theme_support('wc-product-gallery-zoom');
add_theme_support('wc-product-gallery-lightbox');
add_theme_support('wc-product-gallery-slider');

Registered Locations:

  • primary-menu — Primary navigation

ACF Options Pages

Created via ACF Pro:

Theme Settings:

  • Location: Settings → Theme Settings
  • Fields: Global theme options, API keys, feature toggles

Bans Control Panel:

  • Location: Settings → Bans CP
  • Fields: Banned IP addresses, user management

Build Process

Laravel Mix (webpack.mix.js)

mix.js('src/js/app.js', 'assets/js/bundle.js')
.sass('src/scss/theme.scss', 'assets/css/custom.css')
.version();

Gulp Tasks

  • CSS compilation: SCSS → CSS
  • JS bundling: ES6 modules → bundle.js
  • Image optimization: Compress images
  • Watch mode: Auto-recompile on file changes

Build Commands

# Development
npm run dev

# Production (minified)
npm run production

# Watch mode
npm run watch

# Gulp tasks
gulp
gulp watch

Performance Optimizations

Asset Loading

  • Dequeue unnecessary WooCommerce CSS/JS
  • CDN assets for common libraries
  • Conditional script loading (Algolia, PayTomorrow)
  • Asset versioning via mix-manifest.json

Image Handling

  • Responsive images via <picture> elements
  • Lazy loading with Picturefill
  • WebP format support (if server configured)
  • Rear image support for crossbow products

Caching

  • Transient caching for Bazaar Voice data
  • Database query caching
  • Object cache compatibility (Redis/Memcached)

Customization Examples

Adding a New Theme Module

  1. Create module class in inc/:

    // inc/class-my-module.php
    namespace SumaTheme;

    class MyModule {
    public function __construct() {
    add_action('init', [$this, 'init']);
    }

    public function init() {
    // Module initialization
    }
    }
  2. Load module in inc/class-theme.php:

    new \SumaTheme\MyModule();

Custom WooCommerce Hook

Add to inc/class-woocommerce.php:

add_action('woocommerce_before_single_product', [$this, 'custom_product_message']);

public function custom_product_message() {
echo '<div class="custom-message">Special offer!</div>';
}

Custom Elementor Widget

Add to inc/class-elementor-blocks.php:

public function register_custom_widgets($widgets_manager) {
require_once __DIR__ . '/widgets/my-widget.php';
$widgets_manager->register_widget_type(new \SumaTheme\Widgets\My_Widget());
}

Troubleshooting

Styles Not Loading

  • Clear Elementor cache: Elementor → Tools → Regenerate CSS
  • Rebuild assets: npm run production
  • Check file permissions
  • Verify asset paths in mix-manifest.json

JavaScript Errors

  • Check browser console
  • Verify jQuery loaded before custom scripts
  • Clear browser cache
  • Check for plugin conflicts

WooCommerce Display Issues

  • Regenerate product thumbnails
  • Clear WooCommerce transients
  • Check WooCommerce system status
  • Review theme support declarations