MahmudulHassan5809 / django-shopping-cart

MIT License
34 stars 18 forks source link

store more product fields to cart #11

Open ylada opened 2 years ago

ylada commented 2 years ago

Thank you. I used this and like its simplicity. I am not familiar with sessions. One question, is it possible to add a few more fields of product to the cart. Currently, only product's name/image/price are passed to the cart session. In my Product model, there are fields like 'shape', 'color', etc. that I like to be in the cart. So after addition the product to cart, I can access 'shape', and 'color' by using cart.items()[1]['shape'].

Thank you again for the nice work.

MahmudulHassan5809 commented 2 years ago

Hello

Yup you can set others value in session. And actually this package is not up to date. I have plan to make it more dynamic and adding more feature and unit test. My suggestion is you implemented your own shopping cart wiyhout using thia package. If you need help you can knock me.I will try.

Thanks and Regards Mahmudul Hassan

On Fri, Jan 28, 2022, 9:41 PM ylada @.***> wrote:

Thank you. I used this and like its simplicity. I am not familiar with sessions. One question, is it possible to add a few more fields of product to the cart. Currently, only product's name/image/price are passed to the cart session. In my Product model, there are fields like 'shape', 'color', etc. that I like to be in the cart. So after addition the product to cart, I can access 'shape', and 'color' by using cart.items()[1]['shape'].

Thank you again for the nice work.

— Reply to this email directly, view it on GitHub https://github.com/MahmudulHassan5809/django-shopping-cart/issues/11, or unsubscribe https://github.com/notifications/unsubscribe-auth/AILJTSSVXUZ3QMTDGKZ7R2TUYK2LBANCNFSM5NBCMEVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

ylada commented 2 years ago

Thank you for your prompt response. I briefly checked django sessions and found it straightforward. I ended up copying your Cart.py and modified a little so it will take more fields. Thank you so much and best wishes.

MahmudulHassan5809 commented 2 years ago

You're welcome ❤️

On Sat, Jan 29, 2022, 3:47 AM ylada @.***> wrote:

Thank you for your prompt response. I briefly checked django sessions and found it straightforward. I ended up copying your Cart.py and modified a little so it will take more fields. Thank you so much and best wishes.

— Reply to this email directly, view it on GitHub https://github.com/MahmudulHassan5809/django-shopping-cart/issues/11#issuecomment-1024668151, or unsubscribe https://github.com/notifications/unsubscribe-auth/AILJTSVZFAAPZVK4IF5ZB73UYMFIFANCNFSM5NBCMEVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>