Wocart

@wocart/storefront v3.1.0


@wocart/storefront / index / storefrontPath

Function: storefrontPath()

storefrontPath<T>(type, params?): string

The public path of a page type, its parameter encoded: storefrontPath("product", { handle: "robe" }) → /products/robe. Throws when the parameter is missing — a link to nowhere is a bug to see, not a path to render.

Type Parameters

T

T extends "category" | "home" | "product" | "catalog" | "collection" | "page" | "landing" | "checkout" | "thankYou" | "trackOrder" | "search" | "contact"

Parameters

type

T

params?

StorefrontPathParams<T>

Returns

string