feat: use category link from tweakwise#378
Open
ahuininga-orisha wants to merge 11 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<link>field from the Tweakwise navigation response instead of having Magento resolve and build the category URL at request time. This reduces server-side computation and produces more predictable URLs that are consistent with what Tweakwise has configured.<link>value for a facet item (e.g. non-category facets always have an empty<link>).getLink(): stringmethod toAttributeTypeto read thelinkfield from the Tweakwise API response, making the mapping visible and type-safe instead of relying on the magic__callgetter.DefaultRenderer::getCategoryUrl()where a Tweakwise-providedhttp://link combined with a Magentohttps://base URL causedstrposto miss the match and prepend the domain a second time. The comparison is now scheme-agnostic.How to test
Scenario 1 — Setting disabled (default behaviour unchanged)
/default/women/tops-women2/).Scenario 2 — Setting enabled, Tweakwise provides a link
<link>field (e.g.https://magento2.test/default/women/tops-women2/).Scenario 3 — Setting enabled on search results page
Scenario 4 — http/https scheme mismatch
http://links while Magento is configured with anhttps://base URL (or vice versa).