Hi again speaking to myself :D

At the end instead of adding a new property to my product model I
added a new templatetag:

def regular_price(product):
    up = product.unit_price
    if config_value('TAX', 'DEFAULT_VIEW_TAX'):
        taxer = satchmo_tax._get_taxprocessor()
        return up + taxer.by_price(product.taxClass, up)
    else:
        return up

register.filter('regular_price', regular_price)



On Jul 27, 11:58 pm, Juanjo <[email protected]> wrote:
> Hi,
>
> I fixed the first problem adding a unit_price_with_tax property to my
> custom Product model and using it in the template. I've been only two
> days in Satchmo so maybe there is something wrong, but if not it would
> be useful to add it to the Product model:
>
>     def _get_fullPrice_withTax(self):
>         """
>         return price as a Decimal, adding taxes if applicable
>         """
>
>         taxer = satchmo_tax._get_taxprocessor()
>         return self.unit_price + taxer.by_price(self.taxClass,
> self.unit_price)
>
>     unit_price_with_tax = property(_get_fullPrice_withTax)
>
> I'll start looking now into the second problem (checkout and order
> price doesn't shows the discount.)
>
> On Jul 27, 9:46 pm, Juanjo <[email protected]> wrote:
>
> > Hi,
>
> > I've enabled the "show prices with tax" option globally and the
> > default tax enabled for all products, but testing the sales feature
> > (global 50% discount price) I found than on the "cart.html" template
> > the "Regular Price" (cartitem.product.unit_price|currency) shows the
> > price without the tax included (wrong), but "Sale
> > Price" (cartitem.product|discount_price:sale|currency) shows the
> > discounted price with the tax included (correct.)
>
> > When there isn't any sale running the template code shows the
> > "cartitem.product|discount_price:sale|currency", so I can't use that
> > for the regular price column.
>
> > How can I, from the template, show the regular, non discounted, price
> > with tax included?
>
> > Another related problem I'm having with sales: if I go to checkout
> > then the confirmation page shows the total with tax but without the
> > discount and that total is what would get billed if I proceed.
>
> > Thanks and regards,
> > Juanjo
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to