Shopify #
Setup lives in the help centre: Integrating eCardWidget with my Shopify store. This page is the developer's companion to it: how the storefront pieces behave, how the shopper's language is handled, and what data flows into the order and the eCard.
What the integration adds to a store #
All of it is configured in the dashboard under Shopify Settings, per connected store.
Selling eCards without Shopify. An eCard Form has its own checkout (Stripe): senders pay or donate on the form itself, on any website or on the hosted Share Page, with custom amounts, several recipients and every sharing method. Unless your store's checkout has to take the payment, that is the simpler setup: Ecommerce & Donations in the dashboard. The Shopify app is for stores that want the eCard inside a Shopify order.
| Piece | Where shoppers see it | Notes |
|---|---|---|
| Product-page Form | Replaces Add to Cart on the products you attach it to | The eCard is sent once the order is paid |
| Product-page Add-on checkbox | "Add an eCard with this item", under the normal Add to Cart | Non-replacing; exclusive with the Form on the same product |
| Cart add-on | Cart page and cart drawer | Deliver now, when the order ships, or let the shopper choose |
| Thank-you page | After checkout | A Checkout UI extension block ("eCard Share Form") you add in the checkout editor; optional limit of one send per item bought |
| Automatic eCard | Nothing to click; sent by us | On payment or on fulfilment, after an optional delay, on every order or the first only |
An eCard is attached to a product; product variants are not supported (a variant cannot switch the eCard form on or off, or pick the design).
Product scope is per design: Specific products (attach product by product) or Every product in my store, which replaces Add to Cart storefront-wide and is meant only for stores that sell nothing but eCards. The storefront pieces run from the eCardWidget app embed, switched on once in the theme editor; the dashboard links straight to it. Changes take effect after Save changes; allow a few minutes for the storefront to pick them up.
Several products at once. With Specific products, tick two or more products in the list (the checkbox under the list selects every product shown), pick the design under Design to attach, tick where it appears (Form, Add-on checkbox, Thank-you page link) and click Attach to … products, then Save changes. Each attach adds one eCard, or one eCard Form with all of its designs, to every ticked product, on top of what those products already have: repeat it to attach more designs, or tick another group of products for a different design. Products are not matched to designs automatically; to avoid a design per product, use the product merge tags below, so one design prints the name, image and text of whichever product is being bought.
Language #
The storefront form follows the shopper, not the store's default language.
- Detection. The form reads the page's language: a locale prefix in the URL such as
/fr/products/…, thenShopify.locale, then the page's<html lang>. Regional variants fold to the base language (fr-CA→ French,pt-BR→ Brazilian Portuguese). - Supported languages. English, French, Spanish, German, Brazilian Portuguese, Dutch, Arabic, Hebrew, Korean, Vietnamese and Polish. Anything else falls back to English.
- Which designs are shown. When a product carries designs from more than one eCard Form, the form shows only the designs whose eCard Form language matches the shopper's. If none match, every attached design is shown. An eCard Form set to a Custom translation keeps that translation regardless of the page language.
- Wording per language. Under Shopify › Text & languages you can override the panel heading, subtitle and button, the sending-page heading and description, and the cart and product add-on copy, one language at a time. Overrides apply only to that language; the rest keeps our defaults.
- The eCard itself is sent in the language the form resolved, so the envelope email and the card page match what the shopper saw.
Data that reaches the order and the eCard #
Order line items. A product-page send adds line-item properties to the cart line: From, To,
eCard Name and eCard ID, so the eCard is visible on the order in Shopify admin.
Product merge tags. The product-page form sends these merge tags with every eCard. Put them in the eCard's subject, header or body text (eCards → Details) and the card describes the product it was bought with:
[shopify_product_title] · [shopify_product_description] · [shopify_product_ecard_text] ·
[shopify_product_url] · [shopify_product_price_amount] · [shopify_product_price_currency] ·
[shopify_product_image]
[shopify_product_description] is the product's full description as plain text. The title, address, price
and image come from the product page's share tags (Open Graph).
[shopify_product_image] is the address of the product's share image (og:image), so it goes inside an
image tag, for example in the page content below the card:
<img src="[shopify_product_image]" alt="[shopify_product_title]" width="320">
Card text from a product metafield. When the eCard should say something other than the full product
description, keep the card's text in a product metafield and print it with [shopify_product_ecard_text]:
- In Shopify admin, go to Settings → Custom data → Products and add a metafield definition named
eCard text with the namespace and key
custom.ecard_text. Use the type Multi-line text (Rich text also works; only its text is used). - On each product, fill in eCard text with the words the card should carry.
- In eCardWidget, put
[shopify_product_ecard_text]in the eCard's body text where the description was.
A product with no eCard text falls back to its description, so you can fill the metafield in product by product. The text is plain (no formatting) and up to 2,000 characters. It needs the eCardWidget app embed turned on in your theme (Online Store → Themes → Customize → App embeds); a store still using the older script-tag install gets the description.
The page-level custom merge tags
hook (window.ecw_merge_tags) applies to the standard embedded eCard Form, not to the storefront forms.
Custom fields. A custom fields preset assigned to the attached eCard Form appears on the product-page
form. The shopper's answers are recorded with the send and show in your eCard logs and exports; use
[field_name] merge tags in the eCard to print them on the card.
Webhooks. Storefront sends fire the same ecard_shared webhook as any other send,
with the merge tags above in its merge_tags field.
Notes #
- Our app installs the
orders/create,orders/paid,orders/fulfilled,orders/partially_fulfilledandapp/uninstalledwebhooks on the store; nothing else is written to the store. - Lost connection? The dashboard shows the store as disconnected; reconnecting from the Shopify admin restores it without re-doing the product setup.