Choose module
Newsletter triggers and feedback
Dismiss before submitting and reopen. Distinguish dismissal, successful submission and confirmation rather than treating one impression as a signup.
Remove the opener while the help dialog is open, then close it. The old sample left focus on body. Pass a stable focusable next step, such as the order heading, for this case. Normal dismissal still returns to the opener.
Focus entered the dialog and returned to the trigger on close. Read the active element to verify the return.
Reproduce the test and inspect the readings
Compare open state / focus location just after opening help and after pressing Close.
- In the order above
- true / dialog then false / trigger
WESWOO ran this entry’s published script in standalone Chrome with the fixture markup and records described here.
2026-11-24 · Chrome 157.0.8103.79 · assets/ww-help-dialog.js
Inspect the source and verification point
assets/ww-help-dialog.js · line 14
const destination = opener?.isConnected ? opener : fallback;
if (destination?.isConnected) destination.focus();
}, options);
How the module works
Start with a useful help destination
Use a type=button control to open the native dialog and retain a separate help or contact link without JavaScript. The helper does not prevent an anchor’s default navigation, so a link with an href should not serve directly as its trigger. Give the dialog a clear title and visible close control so visitors understand what opened.
The helper takes real trigger and dialog elements and connects opening and closing. It neither creates a support service nor automatically collects visitor information. Merchants still supply useful content and destinations.
Return to the task after closing
Move focus into the dialog on opening and return it to the invoking control after Escape or closing. Handle background interaction so support actions do not accidentally activate purchasing. Reduced motion can remove animation without changing access or exit.
Keep closing usable around phone purchase controls, system areas and zoom. After dismissal, headings and the purchase path should remain understandable so visitors can resume their task.
Example source code
View source fileJS
export function bindHelpDialog(trigger, dialog, fallback = null) {
const closeButton = dialog?.querySelector('[data-close]');
if (!trigger || !closeButton || typeof dialog.showModal !== 'function') return () => {};
const listeners = new AbortController();
const options = {signal: listeners.signal};
let opener;
trigger.addEventListener('click', () => {
if (dialog.open) return;
opener = trigger;
dialog.showModal();
}, options);
closeButton.addEventListener('click', () => dialog.close(), options);
dialog.addEventListener('close', () => {
const destination = opener?.isConnected ? opener : fallback;
if (destination?.isConnected) destination.focus();
}, options);
return () => listeners.abort();
}
// Pass a stable focusable fallback, e.g. the next task heading with tabindex="-1",
// if this theme can remove the opener while the dialog is open.
// Keep a normal contact link when dialogs are unavailable.Integration and checks
Data and dependencies
- A native dialog with an accessible heading and close button.
- Pass the actual trigger and dialog elements.
Interaction and states
- Open on user action and restore focus on close.
- Respect motion preferences and modal interaction boundaries.
Before launch
The function requires native dialog markup and ordinary help links. It does not collect visitor information.
Sources and further reading
Reference links
Theme accessibilityScope and licensing
Educational implementations for Shopify themes and Headless projects. Confirm real inputs, interaction states and existing components in a development theme before store acceptance. Missing task-specific WESWOO articles remain unlinked.
Shopify/dawnLicenseShopify-integration theme license; architecture reference without copying the implementation. · 3e9ee2281dc4Shopify/hydrogenLicenseMIT; retain copyright and license when using substantial code. · 9e358a2462baIs waiting ten seconds enough to diagnose a missing mobile popup?
Use a fresh session and record viewport width, elapsed time and any seen flag. Change one condition at a time to distinguish eligibility, delay and frequency.
We advanced the browser clock by ten seconds at 390 pixels and varied the desktop breakpoint, mobile eligibility and same-session seen flag.
Compare results, scope and replay code
The desktop gate still suppressed the popup after ten seconds. With mobile eligible it was hidden at 9,999 ms and visible after ten seconds. A seen flag suppressed it again.
The post supplies Split 1.1.7 markup and delay settings. The original trigger script and browser state are missing. The fixture does not establish which storage the theme used.
Tested in Chrome 157.0.8103.79. In a clean directory with Node.js 22 or later run, in order, npm install playwright → npx playwright install chromium → node weswoo-popup-gates.cjs.
Test dismissal, submission, confirmation and a fresh session independently. Suppression may be local frequency control. Consult the customer consent record before sending marketing.
The idle page opened the popup. Focus in an input suppressed it at the same timeout, a condition worth retesting after changing delays.
Reproduce the test and inspect the readings
Use the same short timer and scroll threshold. Compare an idle page with focus held in an external input. Read whether the popup opened.
- In the order above
- open then closed
WESWOO ran this entry’s published script in standalone Chrome with the fixture markup and records described here.
2026-11-24 · Chrome 157.0.8103.79 · assets/ww-newsletter-trigger.js
Inspect the source and verification point
assets/ww-newsletter-trigger.js · line 5
if (!dialog.showModal || root.querySelector('[data-newsletter-feedback="true"]')) return () => {};
const key=root.dataset.newsletterKey;let elapsed=false,shown=false;
try {shown=sessionStorage.getItem(key)==='dismissed';}catch {}
How the module works
Example source code
View 3 source filesLIQUID · JS
<section data-ww-newsletter data-newsletter-key="newsletter-{{ section.id }}">
<button type="button" data-ww-newsletter-open hidden>Subscribe by email</button>
<div data-ww-newsletter-inline>
<h2>Receive product guides and store updates</h2>
<p>Enter your email to subscribe to marketing updates. See the store privacy policy for details.</p>
{% assign signup_id = 'Signup-' | append: section.id %}
{% form 'customer', id: signup_id %}
<div data-newsletter-feedback="{% if form.errors or form.posted_successfully? %}true{% else %}false{% endif %}">
{% if form.errors %}<div role="alert">{{ form.errors | default_errors }}</div>{% endif %}
{% if form.posted_successfully? %}<p role="status">Subscription submitted.</p>{% endif %}
</div>
<label for="SignupEmail-{{ section.id }}">Email</label>
<input id="SignupEmail-{{ section.id }}" type="email" name="contact[email]" autocomplete="email" required>
<input type="hidden" name="contact[tags]" value="newsletter">
<button type="submit">Subscribe</button>
{% endform %}
{% if shop.privacy_policy != blank %}<a href="{{ shop.privacy_policy.url | escape }}">Privacy policy</a>{% endif %}
</div>
<dialog id="Newsletter-{{ section.id }}" data-ww-newsletter-dialog aria-label="Email subscription">
<button type="button" data-ww-dialog-close>Close subscription</button>
</dialog>
</section>
export function bindDialog(trigger, dialog) {
let previous;
function open() {
if (dialog.open) return;
previous = document.activeElement;
dialog.showModal(); trigger.setAttribute('aria-expanded','true');
}
function close() { if (dialog.open) dialog.close(); }
const onClick = event => { if (event.target.closest('[data-ww-dialog-close]')) close(); };
const onClose = () => {
trigger.setAttribute('aria-expanded','false');
if (previous?.isConnected) previous.focus();
};
trigger.setAttribute('aria-haspopup','dialog'); trigger.setAttribute('aria-controls',dialog.id);
trigger.setAttribute('aria-expanded','false');
trigger.addEventListener('click',open); dialog.addEventListener('click',onClick); dialog.addEventListener('close',onClose);
return {open,close,destroy(){close();trigger.removeEventListener('click',open);dialog.removeEventListener('click',onClick);dialog.removeEventListener('close',onClose);}};
}
import {bindDialog} from './ww-dialog-controller.js';
export function bindNewsletter(root, {delayMs=8000,threshold=0.25}={}) {
const inline=root.querySelector('[data-ww-newsletter-inline]'), dialog=root.querySelector('[data-ww-newsletter-dialog]');
const trigger=root.querySelector('[data-ww-newsletter-open]');
if (!dialog.showModal || root.querySelector('[data-newsletter-feedback="true"]')) return () => {};
const key=root.dataset.newsletterKey;let elapsed=false,shown=false;
try {shown=sessionStorage.getItem(key)==='dismissed';}catch {}
dialog.append(inline);trigger.hidden=false;
const controls=bindDialog(trigger,dialog);
function maybeOpen() {
const distance=document.documentElement.scrollHeight-innerHeight;
const progress=distance>0 ? scrollY/distance : 0;
if (!elapsed || shown || progress<threshold || document.visibilityState!=='visible' ||
document.querySelector('dialog[open]') || document.activeElement?.matches('input,textarea,select,button,a[href],[contenteditable="true"]')) return;
shown=true;controls.open();
}
const dismiss=()=>{shown=true;try {sessionStorage.setItem(key,'dismissed');}catch {}};
const timer=setTimeout(()=>{elapsed=true;maybeOpen();},delayMs);
addEventListener('scroll',maybeOpen,{passive:true});document.addEventListener('visibilitychange',maybeOpen);dialog.addEventListener('close',dismiss);
return () => {
clearTimeout(timer);removeEventListener('scroll',maybeOpen);document.removeEventListener('visibilitychange',maybeOpen);
dialog.removeEventListener('close',dismiss);controls.destroy();root.append(inline);trigger.hidden=true;
};
}
Integration and checks
Integration steps
3 stepsVerify the native form response
Render newsletter-popup and first validate native success and error responses.
Connect the dialog triggers
Load both JavaScript modules and call bindNewsletter(root); session dismissal affects automatic opening only.
Check mobile layout and focus
Supply current-theme dialog/backdrop and focus styles and test phone purchase access.
Data and dependencies
- The Shopify customer form submits contact[email], with actual subscription and privacy information.
- Default thresholds are eight seconds and 25% scroll; session state stores dismissal, not an email.
Interaction and states
- A server error or success response prevents moving the form into an automatic modal.
- Escape or Close dismisses and restores focus; automatic opening does not repeat in that session.
Before launch
| State | Trigger | Outcome |
|---|---|---|
| Threshold unmet | Insufficient time or scroll | Do not open automatically |
| Both thresholds and no interruption | Open once | Support dismissal and focus return |
| Server feedback or dismissed | Reload or scroll | Keep feedback visible or suppress automatic opening |
The native customer form represents marketing subscription. Match the disclosure to actual email use and validate the store confirmation behavior.
Sources and further reading
Reference links
Shopify newsletter sign-upShopify native formsForm result statesTheme accessibilityShopify/dawn · sections/newsletter.liquidFurther reading
Shopify Subscription Popup: Consent, Frequency, and QAScope and licensing
Educational implementations for Shopify themes and Headless projects. Confirm real inputs, interaction states and existing components in a development theme before store acceptance. Missing task-specific WESWOO articles remain unlinked.
Shopify/dawnLicenseShopify-integration theme license; architecture reference without copying the implementation. · 3e9ee2281dc4Shopify/hydrogenLicenseMIT; retain copyright and license when using substantial code. · 9e358a2462baIf the theme and an app both emit Product data, which block can be turned off?
Disable one known emitter in a duplicate theme and compare the same product identity. Theme and app initially both emitted AX-1. Turning off only the theme Product left one AX-1 and preserved the app’s BreadcrumbList. Counting scripts alone would be misleading.
Save source before and after changing the duplicate. Run the inventory function, including graphs and variants. Locate the responsible snippet or app. Verify desired price and availability in the retained output before changing production.
Compare results, scope and replay code
Disabling the theme Product reduced AX-1 from two nodes to one and kept BreadcrumbList.
A distinct second SKU was retained, and invalid JSON was identified separately.
The fixture distinguishes duplicate emitters, distinct variants and invalid JSON. It does not establish an installed Avada version or rich-result eligibility.
function productNodes(scope) {
function visit(node, result) {
if (Array.isArray(node)) { for (const child of node) visit(child,result); return; }
if (!node || typeof node!=='object') return;
if ([node['@type']].flat().includes('Product')) result.push({id:node['@id']||null,sku:node.sku||null});
for (const child of Object.values(node)) if(typeof child==='object')visit(child,result);
}
return [...scope.querySelectorAll('script[type="application/ld+json"]')].map((el,index)=>{
const products=[];try{visit(JSON.parse(el.textContent),products);}
catch{return {index,products,error:'invalid JSON'};}
return {index,products};
});
}
console.table(productNodes(document)); WESWOO tested Chrome 157.0.8103.79. In a clean directory with Node.js 22 or newer, run npm install playwright, then npx playwright install chromium, then node weswoo-schema.cjs.
Original question · Google · Product structured data · Google · Product variants
Match raw HTML, rendered selected-variant price and checkout price by market and currency. A JSON-LD script being present does not establish rich-result eligibility.
Only a supplied product produced the JSON-LD script wrapper. Finding that tag is the first check. The payload’s variant, price and currency still need validation.
Reproduce the test and inspect the readings
Product absent / present, checking the JSON-LD script wrapper only. Counts below report occurrences of “type="application/ld+json"” in the two outputs.
- In the order above
- 0 then 1
WESWOO rendered the template body locally with two input fixtures. Shopify form and pagination wrappers and editor schemas were excluded. The comparison checks output branches.
2026-11-24 · LiquidJS 10.21.1 · snippets/ww-product-schema.liquid
Inspect the source and verification point
snippets/ww-product-schema.liquid · line 3
{{ product | structured_data }}
</script>
{% endif %}
How the module works
Ground markup in visible facts
Check the real product or article and current page address, with readable model, price, stock and policy information in HTML. Variant and market changes should leave visible content and declarations aligned rather than showing sold-out text with an available offer.
Maintain source and scope together. Structured data describes content; it does not validate an invented rating or price. Handle missing facts rather than manufacturing a complete-looking record.
Inspect existing output before adding more
Inspect source HTML and rendered content to identify the main entity and canonical address. Modify existing theme markup instead of adding another copy with potentially conflicting prices, ratings or identity.
The product sample belongs on actual product templates, not as Product markup on a knowledge page. Handle filter parameters through the real crawling and indexing strategy. Consistency between page type, content and declarations matters more than extra markup types.
Example source code
View source fileLIQUID
{% if product != blank %}
<script type="application/ld+json">
{{ product | structured_data }}
</script>
{% endif %}
Integration and checks
Data and dependencies
- Actual product/article objects and the page canonical.
- Match sources, market, variants and visible content.
Interaction and states
- Compare selected-variant output with declared facts.
- Manage filtered URLs under the actual crawl/index policy.
Before launch
If the theme already emits markup, update it instead of adding a duplicate. The fragment belongs to a product template, not this knowledge page.
Sources and further reading
Further reading
Shopify GEO: From Product Data to Checking What AI Actually CitesProduct-page architecture: facts, SEO and testingScope and licensing
Educational implementations for Shopify themes and Headless projects. Confirm real inputs, interaction states and existing components in a development theme before store acceptance. Missing task-specific WESWOO articles remain unlinked.
Shopify/dawnLicenseShopify-integration theme license; architecture reference without copying the implementation. · 3e9ee2281dc4Shopify/hydrogenLicenseMIT; retain copyright and license when using substantial code. · 9e358a2462baOpen the base listing, a filter, a sort and page two. Compare actual products and canonical. Decide which combinations serve distinct intent and verify search engine selection separately.
Color, sort and page landed in separate fields. Adding parameters did not add a second canonical. The output describes page signals; indexing needs separate verification.
Reproduce the test and inspect the readings
Keep one canonical and one pagination link. Add color, sort and page 2 to a plain URL. Read filter count / sort / page / canonical count / pagination-link count.
- In the order above
- 0 / none / none / 1 / 1 then 1 / price / 2 / 1 / 1
WESWOO ran this entry’s published script in standalone Chrome with the fixture markup and records described here.
2026-11-24 · Chrome 157.0.8103.79 · assets/ww-facet-audit.js
Inspect the source and verification point
assets/ww-facet-audit.js · line 5
filterParameters:[...address.searchParams].filter(([name])=>name.startsWith('filter.')),
page:address.searchParams.get('page'),sort:address.searchParams.get('sort_by'),
canonicals:[...doc.querySelectorAll('link[rel="canonical"]')].map(link=>link.href),
How the module works
Parameters can represent different pages
Visit the base collection, a valid filter, empty results, a sort and page two. Record URLs, product scope and pagination to establish access to later products rather than clearing parameters for cosmetic simplicity.
The read-only helper records canonical, robots and links from document. It preserves actual theme output; search value still needs a content and purpose judgment rather than an automatic script decision.
Change shared rules after establishing the problem
Read canonical count and destination alongside actual results and language relationships. Distinguish useful filtered destinations from duplicate content, while preserving pagination’s role in finding later products.
Change rules only after confirming a shared error, then revisit working filters and pagination. The helper writes no noindex, redirects or robots rules. Search guidance about empty-result status codes does not grant Liquid arbitrary HTTP response control.
Example source code
View source fileJS
export function inspectListingDocument(doc = document) {
const address=new URL(doc.URL);
return {
address:address.href,
filterParameters:[...address.searchParams].filter(([name])=>name.startsWith('filter.')),
page:address.searchParams.get('page'),sort:address.searchParams.get('sort_by'),
canonicals:[...doc.querySelectorAll('link[rel="canonical"]')].map(link=>link.href),
robots:[...doc.querySelectorAll('meta[name="robots"]')].map(meta=>meta.content),
paginationLinks:[...doc.querySelectorAll('a[href]')].map(link=>link.href).filter(url=>new URL(url).searchParams.has('page'))
};
}
Integration and checks
Integration steps
3 stepsCapture representative pages
Save helper output for representative real pages in the browser development environment.
Compare canonical links
Choose valuable filter destinations and compare the native canonical behavior.
Retest the affected paths
Change shared rules only after confirming a common error, then retest pagination and languages.
Data and dependencies
- Use the real collection document, including its URL, head and pagination.
- Evaluate Google crawling guidance alongside actual Shopify theme output.
Interaction and states
- Base collections need stable entries and pagination must reach later products.
- Record empty, duplicate and intentionally indexable filter combinations separately.
Before launch
| State | Trigger | Outcome |
|---|---|---|
| Representative document | Read-only inspection | Record actual parameters and head |
| Confirmed duplication or error | Design a rule | Preserve useful pagination and language relations |
| Platform constraint | Record actual response | Do not claim an unsupported status-code change |
The helper changes no robots, noindex or redirects. Google status-code guidance does not grant Liquid arbitrary HTTP status control; verify platform capabilities and actual responses.
Sources and further reading
Reference links
Google faceted-navigation crawling guidanceStorefront filteringCollections and result countsLocale-aware routesShopify/dawn · snippets/facets.liquidShopify/dawn · layout/theme.liquidScope and licensing
Educational implementations for Shopify themes and Headless projects. Confirm real inputs, interaction states and existing components in a development theme before store acceptance. Missing task-specific WESWOO articles remain unlinked.
Shopify/dawnLicenseShopify-integration theme license; architecture reference without copying the implementation. · 3e9ee2281dc4Shopify/hydrogenLicenseMIT; retain copyright and license when using substantial code. · 9e358a2462baHow can I recover custom contact-page changes when Trade updates?
Obtain three files at the same path: the clean old version, your customized old copy and the clean new version. In a separate directory run git merge-file -p custom base next, save the output as a candidate and inspect the exit code. Resolve overlapping edits deliberately.
We ran Git on three temporary files. In one run the store added an order-number field while upstream edited the footer. In the other both edited the contact line.
Compare results, scope and replay code
Overwriting with the old file lost the new footer. The clean merge exited 0 and retained both edits. The overlapping merge exited 1 and printed conflict markers.
Test the contact form and collection pages in an unpublished theme copy before release. Without the clean old version you lack the common base. Check editor settings, app embeds and Shopify’s update eligibility separately.
git diff --no-index base custom
git merge-file -p custom base next
# Inspect the output and exit code before editing a theme copy. Tested in Chrome 157.0.8103.79. In a clean directory with Node.js 22 or later run, in order, npm install playwright → npx playwright install chromium → node weswoo-theme-merge.cjs. Git must be on PATH.
Original question · Shopify · Theme updates · Git · merge-file
Rehearse update and restoration on a duplicate theme with one custom Liquid block, CSS rule and app dependency. Passing a static check still leaves real preview, styling and purchase behavior to verify.
The exit code changed from zero to two. The check caught whitespace but cannot detect a wrong variant selection, which needs a storefront preview.
Reproduce the test and inspect the readings
Make the same heading change in an isolated Git checkout, then repeat with two trailing spaces. Run the published git diff --check and read the exit code.
- In the order above
- 0 then 2
WESWOO ran the example’s check command in an isolated Git repository and read the exit code.
2026-11-24 · Git · project-verification.txt
Inspect the source and verification point
project-verification.txt · line 2
shopify theme check --path .
git diff --check
How the module works
Know the version being changed
Preserve the current theme or framework version, source, lockfile and representative data, with an approved preview environment and variables. Run appropriate theme checks or headless builds without treating a sample browser pass as a merchant-store installation.
Static checks expose some structural problems, while previews inspect real content and interaction. Both matter but answer different questions: a successful build does not establish correct variant-to-cart handoff.
Recover dependencies as well as appearance
After switching, follow product, cart and checkout handoff in relevant markets, recording actual URLs, outcomes and before-and-after hashes. Different devices and languages can reveal different relationships; specific journeys are stronger evidence than a generic success statement.
Redeploy after Oxygen variable changes as required by the project. Restoring a prior version also requires matching dependencies and variables. Agree on ownership and the recovery target so restoration brings back a coherent system rather than merely its former appearance.
Example source code
View source fileTXT
# From a Shopify theme project, before preview acceptance:
shopify theme check --path .
git diff --check
# From a Headless project whose package.json defines these scripts:
npm run typecheck
npm run build
# After static checks: preview each market and recheck after a version switch.
# Retain the exact commit, lockfile, environment and recovery target.
Integration and checks
Data and dependencies
- Installed theme/framework versions and build scripts.
- Approved preview environment, variables and recovery target.
Interaction and states
- Run theme checks and Headless builds separately.
- Redeploy Oxygen variable changes and verify dependencies after recovery.
Before launch
Static checks and example-browser tests do not establish installation acceptance in a merchant store. Validate the actual environment before release.
Sources and further reading
Reference links
Theme Check static analysisDeployments and environment variablesHydrogen version migrationShopify/hydrogen · templates/react-router/package.jsonFurther reading
Shopify Oxygen Deployment: Cache, Monitoring, and RollbackShopify Hydrogen and Oxygen: Architecture and SEO QAScope and licensing
Educational implementations for Shopify themes and Headless projects. Confirm real inputs, interaction states and existing components in a development theme before store acceptance. Missing task-specific WESWOO articles remain unlinked.
Shopify/dawnLicenseShopify-integration theme license; architecture reference without copying the implementation. · 3e9ee2281dc4Shopify/hydrogenLicenseMIT; retain copyright and license when using substantial code. · 9e358a2462ba