fix: MPS-24 — top chips navigate to the tag SERP like the left nav
Operator: the top chips should do what the new left-nav category links
do (navigate to the per-tag SERP rendered in the shop's configured
home_layout), not the in-place 'default cards' hide/show.
Root cause: tag_filter.js decided whether to intercept by checking
chips[0].href for '/tag/'. chips[0] is the 'All' chip, which points at
the shop home (shop_url, no '/tag/'), so the category chips' real
{tag_base}/tag/{slug} hrefs were never detected → tag_filter.js always
intercepted → in-place card filter. Now scan ALL chips: if any links
to /tag/<slug>, bail and let full navigation happen, so a chip behaves
exactly like its matching left-nav category link. JS-only defect fix;
tag_filter.js is ?v={{ request.git_hash }} cache-busted.
This commit is contained in:
parent
98939fbc80
commit
bcd8c2471b
1 changed files with 11 additions and 5 deletions
|
|
@ -25,11 +25,17 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// If chips link to /tag/<slug> (tag detail page), keep full navigation —
|
||||
// the server already filters; in-place filter would be wrong context.
|
||||
const firstChip = chips[0];
|
||||
const href = firstChip.getAttribute("href") || "";
|
||||
if (href.indexOf("/tag/") !== -1) {
|
||||
// If the category chips link to /tag/<slug> (the tag-detail SERP),
|
||||
// keep full navigation so a chip behaves EXACTLY like the matching
|
||||
// left-nav category link — the server renders that page in the
|
||||
// shop's configured home_layout, instead of an in-place "default
|
||||
// cards" hide/show. NOTE: chips[0] is the "All" chip, which points
|
||||
// at the shop home (no /tag/), so deciding from chips[0] alone
|
||||
// wrongly kept the in-place filter — scan ALL chips.
|
||||
const navigatesToSerp = Array.prototype.some.call(chips, function (c) {
|
||||
return (c.getAttribute("href") || "").indexOf("/tag/") !== -1;
|
||||
});
|
||||
if (navigatesToSerp) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue