Open thenewguy opened 5 years ago
On this note it would also be appropriate to offer two methods for calculation.
Is overriding the price
getter on the ProductVariant
helpful here?:
https://jamesramm.github.io/longclaw/docs/tutorial/products#dynamic-pricing
I feel like it could be made to work there but it would be more complicated than adding it in that one place.
Sales tax in the USA needs to know origin and destination addresses to be calculated. And it needs to know if the items are taxable. And in some cases customers are tax exempt on some things they buy... however this could probably be solved after the common cases are solved.
Sales tax is also typically displayed on invoices separate from the price of goods so the template would need access to it in some form separate from the price.
It might be worthwhile to create a method dedicated to determine tax amount.
Perhaps a general method that is intended to return a dictionary or ordered list of three tuples could be called for all line items, fees and discounts on an order.
The fields for displaying any fee I can think of this moment would be as follows: fee name, normal price, charged price.
The normal price and charged price is important in the template for being able to show discounted line item prices.
Yes I think this is the best way to go. A new method at checkout which can be overridden, which will know both the customer address(es) and everything in their basket.
This sounds like a more generic version of the basic proposal for custom shipping in #204.
So this function would return (somehow) potentially:
I've let this stew in the back of my mind for a few hours and I still think shipping needs to be separate from this in my opinion because the user needs to be able to select which shipping rate to use.
Here is why:
Shipping rates could be selected at this time but I am pretty sure there are cases where shipping rates are taxable in the US. Not for me, but I think it is potentially something that the project would want to support.
In that case, I think we need (for a first implementation) a basic calculate_tax
function somewhere on the checkout. It should:
Need a mechanism to determine appropriate sales tax and add it to the amount charged for an order. It should also be recorded for display.