Smootify.getProductByHandle()
The getProductByHandle method of window.Smootify.
New in 2.0.
getProductByHandle(handle: string): Promise<Product | null>Types
Product
export interface Product {
/** `gid://shopify/Product/<id>` */
id: string;
title: string;
handle: string;
vendor: string;
productType: string;
descriptionHtml: string;
tags: string[];
isGiftCard: boolean;
requiresSellingPlan: boolean;
totalInventory: number | null;
category: { name: string } | null;
publishedAt: string;
createdAt: string;
metafields: (Metafield | null)[];
collections: { nodes: { handle: string; title: string; image: { url: string } | null }[] };
media: { nodes: ProductMedia[] };
options: ProductOption[];
sellingPlanGroups: { nodes: SellingPlanGroup[] };
/** every variant on the product page; the first 250 elsewhere */
variants: { nodes: ProductVariant[]; pageInfo: { hasNextPage: boolean; endCursor: string | null } };
}