feat: Affiliate program enrichment (Link Builder, Curated Collections, Smart Links)

This commit is contained in:
Dwindi Ramadhana
2026-06-03 14:04:17 +07:00
parent fd8eb38512
commit f8c733832e
22 changed files with 1348 additions and 10 deletions

View File

@@ -211,6 +211,13 @@ class TemplateOverride
);
}
// /collection/* → SPA page (global, independent of frontpage setting)
add_rewrite_rule(
'^collection/(.*)$',
'index.php?page_id=' . $spa_page_id . '&woonoow_spa_path=collection/$matches[1]',
'top'
);
// Register query var for the SPA path
add_filter('query_vars', function ($vars) {
$vars[] = 'woonoow_spa_path';
@@ -430,7 +437,7 @@ class TemplateOverride
}
// Check path prefixes (for sub-routes)
$prefix_routes = ['/shop/', '/my-account/', '/product/', '/checkout/'];
$prefix_routes = ['/shop/', '/my-account/', '/product/', '/checkout/', '/collection/'];
foreach ($prefix_routes as $prefix) {
if (strpos($path, $prefix) === 0) {
$should_serve_spa = true;
@@ -500,7 +507,7 @@ class TemplateOverride
// Check if this is a SPA route
// We include /product/ and standard endpoints
$spa_routes = ['/product/', '/cart', '/checkout', '/my-account'];
$spa_routes = ['/product/', '/cart', '/checkout', '/my-account', '/go/'];
foreach ($spa_routes as $route) {
if (strpos($requested_url, $route) !== false) {