Skip to content

Conversation

@dhaval2711
Copy link

@dhaval2711 dhaval2711 commented Dec 19, 2025

  • Fix issue where category URLs used default store's base URL during indexing
  • Use category's actual store ID to get correct base URL
  • Prevents cross-store URL issues in Algolia search results
  • Fixes issue where categories indexed for store X would have URLs from store Y

Summary

During category indexing, URLs are generated using the default store's base URL instead of the category's actual store view base URL. This happens because Category::getUrl() relies on StoreManager->getStore() which may return the default store when store emulation is not active (common in CLI/cron contexts).
Result

  • Modified getUrl() method to explicitly use the category's store ID to get the correct base URL
  • Build URL manually using $store->getBaseUrl() with the category's store context
  • Fall back to store emulation if request_path is not available

Impact

  • Fixes incorrect URLs in Algolia search results
  • Prevents cross-store navigation issues
  • Ensures category URLs match their store view's base URL

- Fix issue where category URLs used default store's base URL during indexing
- Use category's actual store ID to get correct base URL
- Prevents cross-store URL issues in Algolia search results
- Fixes issue where categories indexed for store X would have URLs from store Y
@damcou
Copy link
Contributor

damcou commented Dec 22, 2025

Hello @dhaval2711 and thanks for your contribution !

We will look at it ASAP and it will be added to our next release if it gets approved.
Thanks again !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants