This file contains 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
export function adopt(str) { | |
return str.replace(/\s([^\s<]+)\s*$/g, '\u00A0$1'); | |
} |
This file contains 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
export function handleize (str) { | |
return str | |
.toLowerCase() | |
.replace(/[^\w\u00C0-\u024f]+/g, '-') | |
.replace(/^-+|-+$/g, '') | |
} |
This file contains 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
alias scripts="pcregrep -M '(?<=scripts\":\s)(.|\n)*?(?=\n\s*},)' package.json" |
This file contains 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
{"lastUpload":"2020-08-28T21:31:48.308Z","extensionVersion":"v3.4.3"} |
This file contains 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
-- A SQL query to find customers that may have unintentionally unsubscribed from their e-mail. | |
-- This is related to a Shop Pay bug where if customers come from a Headless shop, they're unsubscribed. | |
SELECT T1.metadata__email "Email", C.accepts_marketing "Subscribed", C.accepts_marketing_updated_at "Unsubscribe Date", T2.created_at "Transaction Date", O.created_at "Order Date" | |
FROM ca_ecomm.transactions__receipt__charges__data T1 | |
LEFT JOIN ca_ecomm.transactions T2 | |
ON | |
T1.metadata__order_transaction_id::VARCHAR = T2.id::VARCHAR | |
LEFT JOIN ca_ecomm.customers C |
This file contains 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
const shopifyStores = [ | |
{name: 'Canada Web', tablePrefix: 'ca_ecomm'}, | |
{name: 'Canada Retail', tablePrefix: 'ca_retail'}, | |
{name: 'Intl. Web', tablePrefix: 'us_ecomm'}, | |
{name: 'Intl. Retail', tablePrefix: 'us_retail'} | |
]; | |
let KotnEmailsArray = [ | |
"kotn", | |
"ordinarysupply", |
This file contains 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
// Place this file at `/routes/discounts/[handle].tsx` | |
import {useUrl, useRouteParams, useSession} from '@shopify/hydrogen'; | |
// @TODO: Add in API route for setting session cookie with discount code: https://shopify.dev/custom-storefronts/hydrogen/framework/sessions#reading-and-updating-session-data | |
export async function api(request, {session}) { | |
let sessionData, jsonData; | |
} |
This file contains 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
const config = { | |
cacheControl: 'public, max-age=3600, stale-while-revalidate=86400', // Set to the amount of time you want to cache the page, in seconds | |
removeNoIndex: true, // Set to false if you want to respect robots noindex tags | |
updateCanonical: true, // Set to false if you want to respect canonical meta tags | |
ignoreRedirects: true, // Set to false if you aren't redirecting to Hydrogen in your theme | |
}; | |
export async function loader({request, context}) { | |
const { | |
shop: { |
This file contains 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
import { CacheLong } from '@shopify/hydrogen'; | |
interface Config { | |
cacheControl: string; | |
removeNoIndex: boolean; | |
updateCanonical: boolean; | |
ignoreRedirects: boolean; | |
} | |
const config: Config = { |
This file contains 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
{% comment %} | |
UPDATE: Now you can use this theme to more easily manage your redirects: | |
https://github.com/benjaminsehl/shopify-headless-theme | |
{% endcomment %} | |
{% assign new_website = 'https://headless-website.com/' %} | |
<!doctype html> | |
<html> |
OlderNewer