Skip to content

Disable VAT/Taxes on specific cases #989

Closed Answered by duncanmcclean
Web10-Joris asked this question in Help
Discussion options

You must be logged in to vote

I believe you should be able to achieve this by creating your own tax engine, which extends the "Standard Tax Engine" you're already using.

You first need to create your tax engine class - I've just put mine in app and called it CustomTaxEngine, feel free to call it whatever you want.

The calculateForLineItem method is responsible for calculating the tax for each line item.

As a really basic example, I've got the $hasValidVat variable which, when true, will return a 0% tax rate for the line item. Otherwise, it'll fallback to the normal standard tax engine logic. You can obviously change this as needed.

<?php

namespace App;

use DuncanMcClean\SimpleCommerce\Contracts\Order;
use DuncanMcClean

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Web10-Joris
Comment options

Comment options

You must be logged in to vote
1 reply
@Web10-Joris
Comment options

Answer selected by Web10-Joris
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
2 participants