In my store i want to display product prices (and shipping cost) with tax included to the customers. In the summary I want to show all prices and totals with tax included. And a line saying how much of the total is tax.
I have made a tax module to add the correct amount of tax pr. item, but I need some general advice on:
Current storefront implementation have full support taxes for cart objects as line items, shipments and you do not need any extra changes to make it work.
All cart types (Cart, LineItem, Shipments) inherit this interface and support taxes
we just have missed only taxes on product level (product detail and product list), is our omission and we definitely will include this feature in future storefront releases.
As temporary solution you can do follow steps:
1. extend or override current VirtoCommerce.Storefront.Model.Catalog.ProductPrice class with new properties related to tax rate. That's allows to you use tax on liquid templates (product detail and search result views).
2. define new implementation VirtoCommerce.Storefront.Services.IPricingService or override exist PricingServiceImpl where with evaluation product price also will be evaluated taxes by using this api http://demo.virtocommerce.com/admin/docs/ui/index#!/Commerce_core_module/Commerce_EvaluateTaxes
Thanks. This seems to be a strategy if you have prices without tax in your pricelists. I can see both positive and negative results of this.
Positive, it will probably not break other integrations like Google Shopping.
Negative, if you have a percentage discount on an item, like 50%, it will not be 50% off the item when taxes are added.
The idea I am thinking about is based on having prices WITH tax in the pricelists. The tax provider module still calculate tax.
The modifications then have to be in the totals calculations. Maybe have a store wide property saying if catalog prices are with or without tax.
Lets say we have one product with the price $100 without tax, and tax is 25% (No shippipng cost to simplify sample):
Store prop saying prices are WITHOUT tax:
Basically, the prop is controlling if the tax line is included in the total or not.
Does this seem like a viable solution? If so, do you have any general advice as to where these changes have to take place?
VC tax evaluation strategy designed for common cases when tax can be evaluated dynamically depend on more external factors. That why we do not include it in price lists.
Sorry probably I'm don't understand correctly negative side of prices without tax, if you mean that applying order of discount and tax related to resulting price? Then it not true, because resulting price with discounts and taxes evaluated by this formula:
Resulting price = price * (1 - discount + tax - discount * tax)
and as you see discount and tax applicable order do not affect to result (you can apply tax and discounts in any order)
1. price = 100, discount = 0.5, tax = 0.25 Result price = 100 * (1 - 0.5 + 0.25 - 0.5 * 0.25) = 62.5$
But totally I agree with you we missed flag TaxIncluded respond to display taxes in totals. Its should be simply implemented because will be used only for display and not related to calculation process.
And also do not understand which allows the inclusion of taxes in the price list?