Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with orders,cart items, #1

Open
corradt opened this issue Oct 27, 2014 · 8 comments
Open

problems with orders,cart items, #1

corradt opened this issue Oct 27, 2014 · 8 comments

Comments

@corradt
Copy link

corradt commented Oct 27, 2014

If I do checkout and I go to check server side in particular orders I realize that sub total and final total are not exact.
If I try to pass from the status started to finished and I come back to the client side the content of the cart is still there. In the admin site if go to cart items, the line total is not correct respect at what I want to buy.If I push checkout tha page has only the menu doesn't get any message of confirmation. Thanks a lot for you job.

@codingforentrepreneurs
Copy link
Owner

Thanks for the message. We're still developing the Open eCommerce project
so it's likely there are still bugs in the system.

We do appreciate you taking the time to send us the issue. Please check
back in a little while as we'll have updates soon.

Cheers,

Justin
Coding For Entrepreneurs
codingforentrepreneurs.com

On Mon, Oct 27, 2014 at 12:06 AM, corradt [email protected] wrote:

If I do checkout and I go to check server side in particular orders I
realize that sub total and final total are not exact.
If I try to pass from the status started to finished and I come back to
the client side the content of the cart is still there. In the admin site
if go to cart items, the line total is not correct respect at what I want
to buy.If I push checkout tha page has only the menu doesn't get any
message of confirmation. Thanks a lot for you job.


Reply to this email directly or view it on GitHub
codingforentrepreneurs/eCommerce#1.

@corradt
Copy link
Author

corradt commented Oct 28, 2014

if I try to update cartitems like below, I get the message: Your Cart is Empty, please keep shopping.

from products.models import Product, Variation

from .models import Cart, CartItem

def view(request):
try:
the_id = request.session['cart_id']
cart = Cart.objects.get(id=the_id)
cartitem=CartItem.objects.get(id=the_id)

except:
    the_id = None

if the_id:
    new_total = 0.00
    for item in cart.cartitem_set.all():
        line_total = float(item.product.price) * item.quantity
        new_total += line_total
    request.session['items_total'] = cart.cartitem_set.count()
    cart.total = new_total
    cart.save()
    cartitem.line_total=cart.total
    cartitem.save()
    context = {"cart": cart}
else:
    empty_message = "Your Cart is Empty, please keep shopping."
    context = {"empty": True, "empty_message": empty_message}

template = "cart/view.html"
return render(request, template, context)

@codingforentrepreneurs
Copy link
Owner

Did you try logging out and back in (through admin) to delete the session
and start over? It's possible it has something to do with how your cart
id was stored.

On Monday, October 27, 2014, corradt [email protected] wrote:

if I try to update cartitems like below, I get the message: Your Cart is
Empty, please keep shopping.

from products.models import Product, Variation

from .models import Cart, CartItem

def view(request):
try:
the_id = request.session['cart_id']
cart = Cart.objects.get(id=the_id)
cartitem=CartItem.objects.get(id=the_id)

except:
the_id = None

if the_id:
new_total = 0.00
for item in cart.cartitem_set.all():
line_total = float(item.product.price) * item.quantity
new_total += line_total
request.session['items_total'] = cart.cartitem_set.count()
cart.total = new_total
cart.save()
cartitem.line_total=cart.total
cartitem.save()
context = {"cart": cart}
else:
empty_message = "Your Cart is Empty, please keep shopping."
context = {"empty": True, "empty_message": empty_message}

template = "cart/view.html"
return render(request, template, context)


Reply to this email directly or view it on GitHub
codingforentrepreneurs/eCommerce#1 (comment)
.

@codingforentrepreneurs
Copy link
Owner

Are you following along with our video tutorials for this project?

On Monday, October 27, 2014, corradt [email protected] wrote:

yes a I tried and if I try to add a product I get immediately the same
message of the else:
Your Cart is Empty, please keep shopping.


Reply to this email directly or view it on GitHub
codingforentrepreneurs/eCommerce#1 (comment)
.

@codingforentrepreneurs
Copy link
Owner

How far along are you?

On Tue, Oct 28, 2014 at 1:35 PM, corradt [email protected] wrote:

Yes

Best Regards

On 28/ott/2014, at 18:34, Coding For Entrepreneurs <
[email protected]> wrote:

Are you following along with our video tutorials for this project?

On Monday, October 27, 2014, corradt [email protected] wrote:

yes a I tried and if I try to add a product I get immediately the same
message of the else:
Your Cart is Empty, please keep shopping.


Reply to this email directly or view it on GitHub
<
https://github.com/codingforentrepreneurs/ecommerce/issues/1#issuecomment-60710386>

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
codingforentrepreneurs/eCommerce#1 (comment)
.

@codingforentrepreneurs
Copy link
Owner

Ok cool. Did you try pulling our code and running it? It's possible that
you have a spacing issue somewhere (which is highly possible) so pulling
our code should definitely work.

On Tue, Oct 28, 2014 at 6:59 PM, corradt [email protected] wrote:

I've studied computer engineering, so subjects as OO programming. So I was
enough fast to arrive almost to the ending.


Reply to this email directly or view it on GitHub
codingforentrepreneurs/eCommerce#1 (comment)
.

@codingforentrepreneurs
Copy link
Owner

I did not. What are you trying to change?

On Tue, Oct 28, 2014 at 7:10 PM, corradt [email protected] wrote:

did you try to do the same modification as I did.


Reply to this email directly or view it on GitHub
codingforentrepreneurs/eCommerce#1 (comment)
.

@codingforentrepreneurs
Copy link
Owner

Please email me so we can keep our communication to one place.
[email protected]. Please remind me what your are trying to
do. Thanks.

On Tuesday, October 28, 2014, corradt [email protected] wrote:

I wrote you what i did. I sent you a photo on udemy,


Reply to this email directly or view it on GitHub
codingforentrepreneurs/eCommerce#1 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants