Skip to content

Instantly share code, notes, and snippets.

@cpv123
Last active October 4, 2021 03:06
Show Gist options
  • Save cpv123/ee9b26bee1ec83c745f37c59e26f3157 to your computer and use it in GitHub Desktop.
Save cpv123/ee9b26bee1ec83c745f37c59e26f3157 to your computer and use it in GitHub Desktop.
const handleAddToCart = async (productId: string, quantity: number) => {
const { cart } = await commerce.cart.add(productId, quantity)
setCart(cart)
plausible("addProductToCart")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment