Project portfolio Browse selected work

Shopify Plus Upgrade Monthly Fee Reduction + Up to $4800 Development Fee Credit - Exclusive WesWoo Offer

Developer modules / Cart, totals and promotions

Cart, totals and promotions

Render server-owned line items before totals, payments and promotion conditions.

Promotion cards, copy controls and expiry

Show eligible products, thresholds, currency and validity before the copy button. A successful copy changes feedback only; confirm application through the actual cart or checkout.

Data and dependencies

  • Approved code, dates and combination conditions.
  • A read-only input, button and role=status feedback.

Interaction logic

  • Allow manual selection if clipboard access fails.
  • Remove misleading claims when expired or ineligible.
Example code · assets/ww-copy-code.js
JavaScript · WESWOO
export function bindDiscountCopy(button, input, status) {
  button.addEventListener('click', async () => {
    const value = input.value.trim();
    if (!value) return;
    try {
      await navigator.clipboard.writeText(value);
      status.textContent = 'Code copied. Check its conditions at checkout.';
    } catch {
      input.focus();
      input.select();
      status.textContent = 'Select and copy the code.';
    }
  });
}
// Use a read-only text input, a type=button control and a role=status element.
// Copying a code does not apply or validate a discount.

Acceptance checks

  • Check clipboard failure, empty codes and repeated activation.
  • Validate checkout with eligible and ineligible products.

Copying does not apply a discount. Client-side display values do not establish the final price.

Read it, integrate it, verify it

  1. Choose a module and confirm the data contract.
  2. Connect the fragment to the current theme or framework.
  3. Check real variants, markets and recovery states.

Examples target Shopify Online Store 2.0 themes. Headless has separate data and version boundaries. Integrate fragments with actual fields, theme components and locale files.

Architecture references

Original educational examples with Shopify documentation and pinned upstream references. Follow the applicable license when adopting repository code.

Shopify/dawn · Licensecommit 3e9ee2281dc4 · Shopify-integration theme license; architecture reference without copying the implementation.
Shopify/hydrogen · Licensecommit 9e358a2462ba · MIT; retain copyright and license when using substantial code.

References checked 2026-11-12