BRD-1030-Localize-productUrl-per-locale-in-ShopifyAdapter#67
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces localized product URL generation for the Shopify adapter. It adds logic to extract product handles and construct URLs that incorporate locale prefixes and translated handles while preserving existing query strings. Feedback suggests also preserving URL fragments (anchors) during reconstruction to avoid potential data loss for deep-linked URLs.
|
@claude review |
|
Claude finished @PauliusInvertus's task in 1m 19s —— View job Code Review
The implementation is clean and well-structured. The two new private methods are focused, the fallback chain is sound, and the existing tests are correctly updated. A few notes: Fragment not preserved (agree with gemini-code-assist)
if (isset($parsed['query']) && $parsed['query'] !== '') {
$url .= '?' . $parsed['query'];
}
if (isset($parsed['fragment']) && $parsed['fragment'] !== '') {
$url .= '#' . $parsed['fragment'];
}Primary locale URL is reconstructed, not passed throughWhen Missing test: URL-fallback path in
|
Fixes localized product URLs in indexed Shopify documents. Per-locale productUrl_ now uses the locale prefix (/lt/...) and the translated handle from the Shopify translations payload, instead of duplicating the default-locale URL across every locale.
Build productUrl_ with the active locale prefix and the
translated handle when present, falling back to the default handle.
Preserves preview query strings for dev stores.