GridVids
Sign in with YouTube

E-commerce with #Directus and #Nextjs - [10] - Add To Cart

Mark watched
Don't Miss
Hide
Open in popup Open on YouTube

Watch and Learn 4 years ago

In this episode we are going to start implementing add to cart functionality. I say start because this is a pretty big functionality so I’m going to split it into two parts.

In this first part we are going to create add to cart button, and instead of using something like Redux we are actually going to try to use Directus and React Query for our state management.

Directus is going to be used to persist the data in the user session collection that we are going to create. There we will temporarily save the users order and persist the data that way.

So we are going to start adding our products to temporary order object in this episode.

And in the next episode we are going to finish this functionality by implementing user cart. And display current order that way.

### Code used in this video

https://bit.ly/3InwJt4

### You can support my work on Patreon

https://patreon.com/watchlearn

### Follow me on Social Media

Github: https://github.com/ivandoric Twitter: https://twitter.com/ivan_doric Instagram: https://www.instagram.com/watchlearntuts Facebook: https://facebook.com/watchlearntutorials