diff --git a/includes/Frontend/Assets.php b/includes/Frontend/Assets.php index 61cfa41..4ed9ee2 100644 --- a/includes/Frontend/Assets.php +++ b/includes/Frontend/Assets.php @@ -15,6 +15,7 @@ class Assets { add_action('wp_head', [self::class, 'add_inline_config'], 5); add_action('wp_enqueue_scripts', [self::class, 'dequeue_conflicting_scripts'], 100); add_filter('script_loader_tag', [self::class, 'add_module_type'], 10, 3); + add_action('woocommerce_before_main_content', [self::class, 'inject_spa_mount_point'], 5); } /** @@ -113,6 +114,24 @@ class Assets { } } + /** + * Inject SPA mounting point for full mode + */ + public static function inject_spa_mount_point() { + if (!self::should_load_assets()) { + return; + } + + // Check if we're in full mode and not on a page with shortcode + $spa_settings = get_option('woonoow_customer_spa_settings', []); + $mode = isset($spa_settings['mode']) ? $spa_settings['mode'] : 'disabled'; + + if ($mode === 'full') { + // Only inject if the mount point doesn't already exist (from shortcode) + echo '
Loading...