Display a custom message when add to cart is clicked
IsaacAvoseh opened this issue · comments
Isaac Avoseh commented
Please, how do I display a custom message with toastify or sweetalert when adding to cart( addItem ) ?
Jamie Barton commented
Hey @IsaacAvoseh
Inside of the <CartProvider />
you can pass it a function to onItemAdd
/onItemUpdate
/onItemRemove
etc.
See this example:
https://github.com/GraphCMS/gatsby-graphcms-ecommerce-starter/blob/master/gatsby-browser.js#L46-L48
]
https://github.com/GraphCMS/gatsby-graphcms-ecommerce-starter/blob/master/src/utils/cart-helpers.js#L1-L8
Isaac Avoseh commented
Great, so helpful, thanks a million.
…On Thu, Jan 20, 2022 at 12:58 PM Jamie Barton ***@***.***> wrote:
Hey @IsaacAvoseh <https://github.com/IsaacAvoseh>
Inside of the <CartProvider /> you can pass it a function to onItemAdd/
onItemUpdate/onItemRemove etc.
See this example:
https://github.com/GraphCMS/gatsby-graphcms-ecommerce-starter/blob/master/gatsby-browser.js#L46-L48
]
https://github.com/GraphCMS/gatsby-graphcms-ecommerce-starter/blob/master/src/utils/cart-helpers.js#L1-L8
—
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMXTBX7NENGSWOENMYXDGSTUW72F7ANCNFSM5MMNYHFA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>