Monday, 19 December 2022

Cart toast notification - Shopify Hydrogen

I managed to create onLineAdd toast notification whenever a person adds something to their cart, however i can't seem to grasp how to show product information and show it in the toast.

What im looking for is onLineAdd to trigger notification that says: "XXX (with picture) have been added to the cart."

Is this possible?

What i currently have:

const open = useCallback(() => {
   console.log("Opening product added popup, with image and title.")
}, []);

<ShopifyCartProvider
      onLineAdd={open}
      onCreate={open}
    >
      {children}
</ShopifyCartProvider>


from Cart toast notification - Shopify Hydrogen

No comments:

Post a Comment