benonymus
Simple shopping cart with Phoenix?
Hey I am trying to make a very simple shopping site with elixir/phoenix, and I have the items done, but how can I make a shopping cart that can have multiple instances of the same item?
I had a few thoughts, like having just sort of “global” list what gets created empty on start and then items get added to it, but in order for that I would need to be able to store it’s current state somewhere outside the def where I am adding items to it.
other idea is that have a struct and save the id’s of the items of the items to the database but the problem with that is that I would need to create the cart itself on the page so that I can add items to it.
Wat do you guys think?
Most Liked
benonymus
Actually I think that might be the way to go, thanks
Zesky665
Can’t you just add a Quantity attribute for the items?
pdgonzalez872
This seems interesting: GitHub - nicolasblanco/shopix: Shopix : an Elixir & Phoenix e-commerce platform · GitHub
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









