django-easycart
django-easycart copied to clipboard
include additional optional parameters in Add post request
I like the simplicity of django-easycart, but there is one feature I am not sure how to accomplish.
Using the jquery POST add request, I would like to push additional optional options, in addition to the quantity param such as size or color, how would I accomplish that?
Take a look at: http://django-easycart.readthedocs.io/en/latest/cookbook.html#associating-arbitrary-data-with-cart-items
Yes, I can pass additional arguments on the backend using the add method, however, I can only pass the pk, and quantity arguments with the add POST request. I can't include any additional parameters. Looking at the source code on line 117 of https://github.com/nevimov/django-easycart/blob/master/easycart/views.py
I see that the quantity param is the only optional parameter I can pass after the POST AJAX request, every other additional parameter is filtered out.
Yep, looks like you're right. I'll fix the problem within a week.
I've added a quick fix for the problem. See branch 'allow-passing-arbitrary-data'.
However, I've realized that the project needs some serious refactoring. The thing is, I don't use the app anymore and have no time/desire to work on it further. So, I recommend to use another app. I'll put a notice on the main page later.
Thanks,
I completely understand. Since I have a decent understanding of your code, I probably modify your code as I continue developing. I searched for alternative shopping carts. I choose yours because it's the simplest and quickest learning curve.
@mozilla-rowvigor can you ping me if you keep development? We are using it in soon-to-be production
Sure.
@mozilla-rowvigor please also ping me. Thanks. :+1: