feat: Affiliate program enrichment (Link Builder, Curated Collections, Smart Links)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user