Page 1 of 1

Configuring Inclusive Tax For Product

Posted: Thu May 07, 2015 1:51 am
by retaildev
Hi,

We are looking for a solution where retail price of product is inclusive of tax. How to create a tax module for this and best approach for calculating the tax and display the same on confirmation page.

Example:
Product Retail Price = 1000
Inclusive Tax = True
Tax Rate = 5%

On all the listing category pages the price will be displayed inclusive of tax i.e 1000 but on checkout the Product Price should become 950, Tax 50 and Order Total to be 1000.

What is the way to do this and how to modify the Order Item Price in the Order and it should not effect any other WorkFlow

Regards
Dev

Re: Configuring Inclusive Tax For Product

Posted: Fri May 08, 2015 9:23 am
by Theo Schumacher
Hi,

I do have the same requirement. I have configured everything without tax (in you example: product price is 950) and then calculated a display price in the templates e.g. product.html:

Code: Select all

                     <div blc:price="__*{defaultSku.retailPrice}__ *1.21"
                        th:classappend="*{defaultSku.onSale}? 'has-sale'"></div>


I know this is not very nice as the tax vlaue (21% VAT in my case) is hardcoded in the template.

The correct way would be to create custom dialect like:

Code: Select all

                     <div mydialect:priceWithTax="__*{defaultSku.retailPrice}__ "
                        th:classappend="*{defaultSku.onSale}? 'has-sale'"></div>


In the broadleaf documentation you will find how to create a custom dialect. In the coding of the dialect you then need to call your tax module.

Re: Configuring Inclusive Tax For Product

Posted: Sat May 09, 2015 4:13 pm
by retaildev
Hi Theo,

Thanks for your answer. I was more looking at an implementation through workflow activity or module, which i think would be a good way of implementation.

Regards
Dev

Re: Configuring Inclusive Tax For Product

Posted: Wed May 20, 2015 12:09 am
by phillipuniverse
@retaildev,

What Theo described is the right way. The pricing workflow that you mentioned is only for pricing an order. You want to display the price of the product when the user is browsing to include tax (presumably for VAT as Theo mentioned) and writing a custom Thymeleaf processor to calculate it is a perfectly reasonable thing to do since VAT is all about display anyway. Once you get into actually pricing the workflow, that's when the TaxActivity and the TaxProvider kick in and actually add that total to the Order.