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

@@ -243,6 +243,19 @@ class Assets
$base_path = '';
}
// Also force empty base path for /collection/ routes since they are global
$spa_path_var = get_query_var('woonoow_spa_path');
if (!empty($spa_path_var) && strpos($spa_path_var, 'collection/') === 0) {
$base_path = '';
}
// Handle serve_spa_for_frontpage_routes which bypasses WP queries
$request_uri = $_SERVER['REQUEST_URI'] ?? '/';
$path = parse_url($request_uri, PHP_URL_PATH);
if (strpos($path, '/collection/') === 0) {
$base_path = '';
}
// Check if BrowserRouter is enabled (default: true for SEO)
$use_browser_router = $appearance_settings['general']['use_browser_router'] ?? true;
@@ -263,6 +276,9 @@ class Assets
'useBrowserRouter' => $use_browser_router,
'frontPageSlug' => $front_page_slug,
'spaMode' => $appearance_settings['general']['spa_mode'] ?? 'full',
'affiliateSettings' => [
'enableCuratedCollections' => class_exists('\WooNooW\Modules\Affiliate\AffiliateSettings') ? \WooNooW\Modules\Affiliate\AffiliateSettings::get_setting('woonoow_affiliate_enable_curated_collections', true) : false,
],
'security' => \WooNooW\Compat\SecuritySettingsProvider::get_public_settings(),
];
@@ -460,7 +476,7 @@ class Assets
}
// Check path prefixes
$prefix_routes = ['/shop/', '/my-account/', '/product/'];
$prefix_routes = ['/shop/', '/my-account/', '/product/', '/collection/'];
foreach ($prefix_routes as $prefix) {
if (strpos($path, $prefix) === 0) {
return true;