INTERNAL PLAYBOOK & ARCHITECTURE REFERENCE
Partner & Race Director Portal Guide (Option 1)
VIP Access Passcode Micro-Site + Automated WooCommerce Cart Discount
Overview & Live Status
Architecture
Option 1 (VIP Passcode Gate)
Option 1 (VIP Passcode Gate)
WooCommerce Coupon
racefest26 (15% Off • ID 224894)
racefest26 (15% Off • ID 224894)
Portal Access Code
RACEFEST26 (case-insensitive)
RACEFEST26 (case-insensitive)
What Has Been Autonomously Configured & Deployed
-
WooCommerce Partner Coupon (
racefest26):
Created via WooCommerce REST API to provide a 15% discount across products. -
Dedicated Landing Page (
/racefest/):
Published at https://emediagrp.com/racefest/ (Page ID:224895).- Gated by default: displays the VIP access card prompting for the event access code.
- Interactive validation: entering
RACEFEST26(or visiting with?code=RACEFEST26) reveals the curated storefront. - Includes a quick “Click to Auto-Fill & Unlock” button for fast testing.
- Features 4 core endurance products with live images, specs, and discounted price calculations:
- Elite Tyvek Runner Bib (7.5″ x 5.75″) (ID 979)
- Competitor Tyvek Runner Bib (7.5″ x 7.5″) (ID 7525)
- Express 2 Race Bibs Pack of 100 (ID 7543)
- Race Day Safety Pins Box of 1,440 (ID 7689)
-
Master CSS Architecture:
Section 9 (.emg-partner-portal) added tomaster-custom-styles.css, and styles are also embedded directly in the page markup so it renders immediately without cache latency. -
Auto-Discount Code Snippet Prepared:
Saved locally aspartner-portal-auto-discount.phpand included below for one-click copying into WPCode.
Optional Manual Steps (2 Quick Tasks)
Step 1: Set Page Template to “Blank Page” (For 100% White-Label Isolation)
By default, Divi displays the standard global header & footer on published pages. If you want this page to be 100% white-labeled with only the partner top bar and no main emediagroup menu:
- Go to WP Admin → Pages → All Pages.
- Click Edit on “RaceFest 2026 Partner Portal”.
- In the right-hand sidebar under Page Attributes, change Template from Default Template to Blank Page.
- Click Update.
Step 2: Activate Universal Auto-Coupon Snippet (In WPCode)
To ensure that any item added by a visitor who unlocked the portal automatically carries the 15% discount into the WooCommerce cart without typing a promo code:
- Go to WP Admin → Code Snippets → Add Snippet.
- Click Add Your Custom Code (New Snippet).
- Title:
EMG Partner Portal Auto-Discount. - Code Type: Select PHP Snippet.
- Copy the PHP snippet below and paste it into the Code Preview box.
- Insertion: Auto Insert, Location: Run Everywhere.
- Toggle the switch in the top right to Active and click Save Snippet.
partner-portal-auto-discount.php
/**
* Title: EMediaGroup Partner Portal - Auto-Apply Partner Coupons
* Description: Automatically binds and applies partner coupons (e.g. racefest26) to the WooCommerce cart when visiting via partner link or with active portal session cookie.
* Author: emediagroup
* Version: 1.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'template_redirect', function() {
if ( is_admin() || ! function_exists( 'WC' ) || ! WC()->cart || WC()->cart->is_empty() ) {
return;
}
$target_code = '';
if ( ! empty( $_GET['partner_code'] ) ) {
$target_code = sanitize_text_field( wp_unslash( $_GET['partner_code'] ) );
} elseif ( ! empty( $_GET['coupon_code'] ) ) {
$target_code = sanitize_text_field( wp_unslash( $_GET['coupon_code'] ) );
} elseif ( ! empty( $_COOKIE['emg_partner_code'] ) ) {
$target_code = sanitize_text_field( wp_unslash( $_COOKIE['emg_partner_code'] ) );
}
if ( empty( $target_code ) ) {
return;
}
$target_code = strtolower( trim( $target_code ) );
$applied = array_map( 'strtolower', WC()->cart->get_applied_coupons() );
if ( ! in_array( $target_code, $applied, true ) && ! WC()->cart->has_discount( $target_code ) ) {
$coupon = new WC_Coupon( $target_code );
if ( $coupon->get_id() ) {
WC()->cart->apply_coupon( $target_code );
}
}
} );
How to Create Future Partner Pages in 2 Minutes
Whenever a new race director or reseller comes on board (e.g., emediagrp.com/greenville-marathon/):
- Create Coupon: Go to WooCommerce → Coupons → Add Coupon (e.g.
gvlmarathon15, 15% discount). - Duplicate Page: In Pages → All Pages, duplicate the RaceFest 2026 Partner Portal page using Duplicate Page.
- Update 3 Variables:
- Change Page Title & Slug (e.g.
/greenville-marathon/). - In the page content, search & replace
RACEFEST26withGVLMARATHON15(and lowercaseracefest26/racefestwhere applicable). - Update event title/branding in the top header.
- Change Page Title & Slug (e.g.
- Click Publish. Done!
