Git Product home page Git Product logo

Comments (3)

madEng84 avatar madEng84 commented on July 30, 2024

Reading the code I have seen this warning in the definition of basket_charge_incl_tax in Django-Oscar Project:

[oscar/apps/shipping/base.py line 76]

def basket_charge_incl_tax(self):
    warnings.warn((
        "Use the charge_incl_tax property not basket_charge_incl_tax. "
        "Basket.basket_charge_incl_tax will be removed "
        "in v0.7"),
        DeprecationWarning)
    return self.charge_incl_tax

# For backwards compatibility, keep an alias called "ShippingMethod"
ShippingMethod = Base

So I have found the method charge_incl_tax as a property of the class OrderAndItemCharges that extend the abstract class ShippingMethod [oscar/apps/shipping/models.py line 76]: I think the latest could overwrite the ShippingMethod seen above....

class ShippingMethod(models.Model):
.....

class OrderAndItemCharges(ShippingMethod):
...

@property
def charge_incl_tax(self):
    """
    Return basket total including tax
    """
    if self.free_shipping_threshold is not None and \
            self._basket.total_incl_tax >= self.free_shipping_threshold:
        return D('0.00')

    charge = self.price_per_order
    for line in self._basket.lines.all():
        charge += line.quantity * self.price_per_item
    return charge

So i think you have to call charge_incl_tax and let we know if it is ok (remember this is a property and not a function)
Excuse me but now I'm working on an other project

P.s. i see that basket_charge_incl_tax is called three times in the whole Django-Oscar-Paypal project

from django-oscar-paypal.

duartebruno avatar duartebruno commented on July 30, 2024

Thanks. See 9e9ce2a

from django-oscar-paypal.

codeinthehole avatar codeinthehole commented on July 30, 2024

Fixed in 16a13c5 on master, which will be part of 0.8 release.

from django-oscar-paypal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.