Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

changing shipping price in admin #158

Closed
vladyslav2 opened this Issue · 3 comments

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

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
Owner

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
@vladyslav2

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
Something went wrong with that request. Please try again.