changing shipping price in admin #158

Closed
vladyslav2 opened this Issue May 28, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@vladyslav2

If you change shipping price through admin order total price did not changed, so need to recount in manually.

I believe we need to add something like this in BaseOrder:

    def save(self, force_insert=False, force_update=False, using=None):
        self.order_subtotal = Decimal(0.00)
        for item in self.items.all():
        self.order_subtotal += item.line_total

        self.order_total = self.order_subtotal
        for i in self.extraorderpricefield_set.all():
            self.order_total += i.value

        return super(BaseOrder, self).save(force_insert, force_update, using)

PS i'm new in git, so tell me please, if i have some useful code, i should not paste it in issue, just make a pull requests ? Thank you.

@vladyslav2

This comment has been minimized.

Show comment Hide comment
@vladyslav2

vladyslav2 May 28, 2012

and if you're change item price - order total price still will be the same.

maybe it's better to use pre_save signal, to take all data from POST.

and if you're change item price - order total price still will be the same.

maybe it's better to use pre_save signal, to take all data from POST.

@alesdotio

This comment has been minimized.

Show comment Hide comment
@alesdotio

alesdotio Oct 9, 2012

Contributor

Sorry but I don't think it's a good idea to do all this work in the save() method of Order. Seems like too much overhead for such a feature. Maybe if you come up with a better solution, but for now, I'm closing.

Contributor

alesdotio commented Oct 9, 2012

Sorry but I don't think it's a good idea to do all this work in the save() method of Order. Seems like too much overhead for such a feature. Maybe if you come up with a better solution, but for now, I'm closing.

@alesdotio alesdotio closed this Oct 9, 2012

@vladyslav2

This comment has been minimized.

Show comment Hide comment
@vladyslav2

vladyslav2 Oct 9, 2012

I too think that is it not a good solution.
But i have no idea what to do with this problem.

I too think that is it not a good solution.
But i have no idea what to do with this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment