Login Cart Persistence - Django Wednesdays ECommerce 28

  Рет қаралды 3,363

Codemy.com

Codemy.com

Күн бұрын

Пікірлер
@Codemycom
@Codemycom 10 ай бұрын
▶ Watch Django Wednesdays Ecommerce Playlist ✅ Subscribe To My KZbin Channel: bit.ly/3OBQJfN bit.ly/2IGzvOR ▶ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt! Take 50% off with coupon code: youtube50 bit.ly/2VC9WUN ▶ Get The Code bit.ly/47xAhWJ
@fantasyworld1087
@fantasyworld1087 9 ай бұрын
Hey John, I have been following you for two years. Firstly I have learnt your blog playlist. Then I started learning ecommerce from other source and also developed a project but my thirst was not satisfied. When I found your ecommerce playlist I started learning it. It's also awesome as blog playlist. I am thankful to you. I am actually a college teacher. I started learning programming just for fun but now it's my hobby and coding gives me pleaser. I think your teaching method makes it easy for us. Thank you very much. Keep teaching us as always in your style.
@Codemycom
@Codemycom 9 ай бұрын
Thanks! I appreciate it!
@godbernaz
@godbernaz Ай бұрын
im ready to #29, and I just started last week, im addicted to these series damn
@fantasyworld1087
@fantasyworld1087 10 ай бұрын
Waiting for Checkout and payment gateway.
@БогданСокольников-т1н
@БогданСокольников-т1н 9 ай бұрын
Two brilliant video's bro, waited for them!
@Codemycom
@Codemycom 9 ай бұрын
Glad you liked them!
@deleos3744
@deleos3744 10 ай бұрын
Very clear explanation
@Codemycom
@Codemycom 10 ай бұрын
Thanks!
@alexallcool
@alexallcool 9 ай бұрын
Hi @Codemycom and thank you so much for this detailed course! Will you make a video about how to customise/change CSS styles for this shopping project?
@Codemycom
@Codemycom 9 ай бұрын
No, I'm not a design guy...we're learning the functionality of the thing, not how to make it look pretty.
@namdarcs
@namdarcs 9 ай бұрын
Hey John, Sorry just catching up here from a couple weeks off! I think I may have noticed a bug with the persistent shopping cart... With the code we have implemented thus far it appears when we update the quantity from the view cart function and than log out and log back in... the quantity is not saved, it only shows last quantity item selected from adding to the cart function.... I went back between tutorials 15 and 19 to see if I perhaps made a mistake but I cant see any.... Do we want the cart quantity to retain if the user logouts after updating from there? Let me know I can clarify further if required :) Thanks for all the hard work here !
@horror3378
@horror3378 9 ай бұрын
Good👍
@ІванТвердий-о3у
@ІванТвердий-о3у Ай бұрын
8:36 you could have written product = Product.objects.get(id=key) and pass the product and not create a whole new function that is the same as add
@SalamiEdwin
@SalamiEdwin 6 ай бұрын
Hi John, Still in the past a bit (based on how many videos I still need to complete to get to your most recent video). I however made an observation about this video. When I logout and add things to the cart, the things I add show in the cart when I log back in. Is that how you planned it to be or are we missing something?
@Codemycom
@Codemycom 6 ай бұрын
We deal with that later in the playlist
@SalamiEdwin
@SalamiEdwin 6 ай бұрын
@@Codemycom Alright, thanks🙏
@joselucianocastro2836
@joselucianocastro2836 4 ай бұрын
Hello, first of all, thank you for this great project, I don't know if what I'm suggesting is logical, but right now at this point I don't see it contemplated, the situation is, an anonymous user who registers 1 or more products logs in. the system and does not buy more products and logs out, what I observe is that the cart is not persisted in the database, of course I do not know if this should be corrected or is it the normal behavior of ecommerce. Greetings
@Codemycom
@Codemycom 4 ай бұрын
No, an anonymous user can't log in. Logging in requires that you register. Your thing can't happen. If they aren't registered or logged in, then of course we don't want to save that to the database.
@joselucianocastro2836
@joselucianocastro2836 4 ай бұрын
I haven't explained myself well, I'm sorry. What I mean is that a user adds 1 or more products to the cart, he logs into the system, and if within the system he does not add more products and then logs out, then we have a case in which, having added a product, he does not We have persisted in the database, of course the question was whether this operation would be logical? I have implemented this, an else to the if saved_cart: # Convert database string to python dicctionary if saved_cart: # Convert to dicctionary using JSON, para esto se importa libreria JSON #para que este json.loads() funciona se necesita tener este tipo de diccionario {"2":3, "5":1} converted_cart = json.loads(saved_cart) # Add the loaded cart dictionary to our session # Get the Cart cart = Cart(request) # Loop thru the cart and add items from the database {"3": 5, "1": 1} for key, value in converted_cart.items(): #aqui se llama al metodo add de la clase Cart, pasando el product.id y quantity # cart.add(product=key, product_qty=value) # pero a ultima hora decide hacer otro metodo en la clase Cart cart.db_add(product=key, product_qty=value) """ else: print("Me logo tengo productos siendo anonimo, este es el carro de la sesion", request.session.get('session_key')) # Get the Cart cart = request.session.get('session_key') # get the Current user Profile current_user = ProfileUser.objects.get(user=request.user) # Convert {'3':1, '2':3} to {"3":1, "2":3} carty = str(cart) carty = carty.replace("\'", "\"") print("carty es. ", carty) #Save the carty to the ProfileUser Model #current_user.update(old_cart=str(carty)) asi lo hace el current_user.old_cart = carty current_user.save() """
@joselucianocastro2836
@joselucianocastro2836 4 ай бұрын
​@@Codemycom I haven't explained myself well, I'm sorry. What I mean is, if a user adds one or more products to the cart, he logs into the system, within the system he does not add more products and immediately logs out, because we have a case in which, having added some product, he does not We have persisted it in the database, of course the question was whether this operation would be logical? I have implemented this, an else in case the old_cart field is empty: # Convert database string to python dicctionary if saved_cart: # Convert to dicctionary using JSON, para esto se importa libreria JSON #para que este json.loads() funciona se necesita tener este tipo de diccionario {"2":3, "5":1} converted_cart = json.loads(saved_cart) # Add the loaded cart dictionary to our session # Get the Cart cart = Cart(request) # Loop thru the cart and add items from the database {"3": 5, "1": 1} for key, value in converted_cart.items(): #aqui se llama al metodo add de la clase Cart, pasando el product.id y quantity # cart.add(product=key, product_qty=value) # pero a ultima hora decide hacer otro metodo en la clase Cart cart.db_add(product=key, product_qty=value) """ else: # Get the Cart cart = request.session.get('session_key') # get the Current user Profile current_user = ProfileUser.objects.get(user=request.user) # Convert {'3':1, '2':3} to {"3":1, "2":3} carty = str(cart) carty = carty.replace("\'", "\"") print("carty es. ", carty) #Save the carty to the ProfileUser Model #current_user.update(old_cart=str(carty)) current_user.old_cart = carty current_user.save() """
@joselucianocastro2836
@joselucianocastro2836 4 ай бұрын
I haven't explained myself well, I'm sorry. What I mean is, if a user adds one or more products to the cart, he logs into the system, within the system he does not add more products and immediately logs out, because we have a case in which, having added some product, he does not We have persisted it in the database, of course the question was whether this operation would be logical? I have implemented this, an else in case the old_cart field is empty: if saved_cart: # Convert to dicctionary using JSON, para esto se importa libreria JSON #para que este json.loads() funciona se necesita tener este tipo de diccionario {"2":3, "5":1} converted_cart = json.loads(saved_cart) # Add the loaded cart dictionary to our session # Get the Cart cart = Cart(request) # Loop thru the cart and add items from the database {"3": 5, "1": 1} for key, value in converted_cart.items(): #aqui se llama al metodo add de la clase Cart, pasando el product.id y quantity # cart.add(product=key, product_qty=value) # pero a ultima hora decide hacer otro metodo en la clase Cart cart.db_add(product=key, product_qty=value) else: # Get the Cart cart = Cart(request).cart #cart = request.session.get('session_key') # get the Current user Profile current_user = ProfileUser.objects.get(user=request.user) # Convert {'3':1, '2':3} to {"3":1, "2":3} carty = str(cart) carty = carty.replace("\'", "\"") print("carty es. ", carty) #Save the carty to the ProfileUser Model #current_user.update(old_cart=str(carty)) asi lo hace el current_user.old_cart = carty current_user.save()
@SabbirHMukul
@SabbirHMukul 10 ай бұрын
how many video do you publish to complete ecommerce Django projects?
@Codemycom
@Codemycom 10 ай бұрын
No clue, it'll go as long as I find interesting things to talk about.
@vahid-m8b
@vahid-m8b 10 ай бұрын
Do you have plans for online chat ؟For this course!
@Codemycom
@Codemycom 10 ай бұрын
No, that's not really a core function of an ecommerce site.
@vahid-m8b
@vahid-m8b 10 ай бұрын
@@Codemycom Thank you for your efforts, and i meant to talk between admin and buyers !
@Codemycom
@Codemycom 10 ай бұрын
yes I understood what you meant, my answer doesn't change@@vahid-m8b
@poslepepper
@poslepepper 10 ай бұрын
Hi! Could you please show how to view others users profiles and same time be logged in for another user. Like: Iam Bob and want to see Johns and Marks profile, with their stuff.
@Codemycom
@Codemycom 10 ай бұрын
No, that wouldn't be appropriate for an ecommerce app. People's shopping information is private. I have other Django playlists where we do that sort of thing.
@poslepepper
@poslepepper 10 ай бұрын
Agree with you! I saw all the videos from the “Meeps”, can’t find it there too. Could you please send the link or tell in which playlists I can find it?
@Codemycom
@Codemycom 10 ай бұрын
I have a half dozen django playlists here, I have no clue, look around@@poslepepper
@nishantkhorwal7078
@nishantkhorwal7078 10 ай бұрын
Can we get a checkout and payment gateway fast pleaseee
@Codemycom
@Codemycom 10 ай бұрын
It'll come when it comes lol
@sma1gdz
@sma1gdz 10 ай бұрын
💙💙💙💚💚💚
@Codemycom
@Codemycom 10 ай бұрын
🙂
@rxz7834
@rxz7834 10 ай бұрын
Last.. 🙃
@Codemycom
@Codemycom 10 ай бұрын
huh?
@rxz7834
@rxz7834 10 ай бұрын
Younglings always try to be "First", so i decided to be last...
@Codemycom
@Codemycom 10 ай бұрын
@@rxz7834 lol
Payment And Shipping - Django Wednesdays ECommerce 29
14:31
Codemy.com
Рет қаралды 4,9 М.
Cart Persistence on Logout - Django Wednesdays ECommerce 27
14:46
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
SQLAlchemy: The BEST SQL Database Library in Python
16:39
ArjanCodes
Рет қаралды 90 М.
Add Postgres Cloud Database - Django Wednesdays ECommerce 43
20:45
Take Paypal Payments On Our Site - Django Wednesdays ECommerce 47
28:20
Login With User Authentication - Django Wednesdays #21
21:25
Codemy.com
Рет қаралды 185 М.
Customer Order Models - Django Wednesdays ECommerce 31
15:23
Codemy.com
Рет қаралды 3,9 М.
Attach Order Items - Django Wednesdays ECommerce 36
16:50
Codemy.com
Рет қаралды 2,6 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 190 М.
Fix Shipping Model Problem - Django Wednesdays ECommerce 33
8:25
This is the Only Right Way to Write React clean-code - SOLID
18:23
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН