My profile
My profile
My information
Back to profileAdd address
Back to addresses
Liquid error (sections/account-profile line 223): customer_address form must be given an address
Hey,
Helpful links
{ console.log(e); open = true}"
x-data='
{
open: false,
query: "",
results: "",
recentItems: [],
recentSearches: [],
clearRecent() {
this.recentItems = [];
localStorage.removeItem("recent-viewed")
},
clearSearches() {
this.recentSearches = [];
localStorage.removeItem("recent-searches")
},
close() {
this.open = false;
this.query = "";
this.results = ""
},
saveSearch(term) {
if (!term || term.length < 3) return;
const data = JSON.parse(localStorage.getItem("recent-searches") || "{}");
data.items = data.items || [];
if (data.items.includes(term)) return;
data.items.unshift(term);
let items = [...new Set(data.items.slice(0, 3))];
localStorage.setItem("recent-searches", JSON.stringify({
items
}));
this.recentSearches = items;
}
}
'
x-init='
async () => {
const viewed = JSON.parse(localStorage.getItem("recent-viewed") || "{}");
viewed.items = viewed.items || [];
viewed.items.map(async handle => {
return await fetch(`/products/${handle}?view=preview`)
.then(response => response.text())
.then(data => {
recentItems.push(data);
});
})
const searches = JSON.parse(localStorage.getItem("recent-searches") || "{}");
searches.items = searches.items || [];
recentSearches = searches.items;
$watch("open", () => {
$nextTick(() => {
if (open) {
$refs.search.focus();
}
})
})
$watch("query", () => {
if (query.length > 2) {
Shopify.analytics.publish("dynamic_search", {query: query, url: window.location.href});
exponea && exponea.track("search", {
_search_terms: query
});
fetch(`/search?q=title:*${query}*&type=product`)
.then(response => response.text())
.then(data => {
const parser = new DOMParser();
const doc = parser.parseFromString(data, "text/html");
const dom = doc.querySelector("#search-results");
results = dom.innerHTML;
saveSearch(query);
});
}
})
}
'
class="fixed inset-0 z-[200] bg-black/40 overflow-hidden"
>
POPULAR SEARCHES
Recently Viewed
Cart ()
Free Shipping!