Order Size Limited Sales Tax

  • Posts: 59
  • Thank you received: 4
  • Hikashop Business
9 months 11 hours ago #359965

-- url of the page with the problem -- : safetyzonespecialists.com
-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.3.4
-- PHP version -- : 8.0.30

Greetings,

The % varies but Florida counties have a say 1% sales tax that has a maximum limit of a $5000 order size.

That is:

On orders from $0 to $5000, 1% is charged.

On orders above $5000 a flat rate of $50 is charged (1% of $5000).

How can I structure taxes based on order size ?

Thanks

Dave

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
8 months 4 weeks ago #359967

Hi,

Adding an extra charge of 1% with a threshold above which the charged amount is flat is possible with the cart fees plugin:
www.hikashop.com/marketplace/product/279-cart-fee.html
With two formulas:
- one with a condition {price}<5000 and a formula {price}*0.01
- one with a condition {price}>=5000 and a formula 50
So that's not a problem.

The big problem you'll have is that there is no mechanism to restrict a formula based on the county. In fact, there is no easy way to know the county based on the address of the user.
It would first require an integration with a paid service like opencagedata.com/api to provide the address and get back the county, so that you can then apply the correct charge based on the county ( pointmatch.floridarevenue.com/General/Di...alesSurtaxRates.aspx )

Also, the surtax might not apply based on the type of product being sold:
floridarevenue.com/taxes/taxesfees/Pages/sales_tax.aspx
For example, if you sell services as well as physical products, you can't blindly take into account the total amount of the order, but only the portion for the type of product for which the surtax applies.

So, if you want to get a complete solution, handling both the product type and different rates for different counties, with a threshold, I'm afraid the only solution is to develop a custom plugin to handle this.
By implementing the onHikashopGetTax(&$obj, $zone_id, $tax_category_id, $type, &$matches, &$taxPlans) event in a hikashop plugin, you can force the list of taxes in $obj->taxRates (with objects similar to what you have in $matches or $taxPlans), empty $matches and $taxPlans and the system will us your tax rate objects to calculate the tax. And to base yourself on the user address, you can load the cart address:

$checkoutHelper = hikashopCheckoutHelper::get();
$cart = $checkoutHelper->getCart();
echo $cart->shipping_address->address_city;
That way, you can pass the address to the API of the service to get back the county name.
And you can use $tax_category_id to check the type of product.
And then, you need to implement the event onAfterCartShippingLoad(&$cart) to check if the surtax calculated goes above the threshold and if so you can force the value and recalculate the total.
So, if you're a skilled developer, or can hire one, with the information above, it should be totally possible to do it. It's not simple though and it will require at least a few days of work, if not a few weeks.

A better solution would be to use TaxCloud: www.hikashop.com/support/documentation/260-taxcloud.html
The integration plugin is included for free in HikaShop. And with it, TaxCloud will calculate the taxes for your products based on their TIC and the address of the user.

The following user(s) said Thank You: daduts

Please Log in or Create an account to join the conversation.

  • Posts: 59
  • Thank you received: 4
  • Hikashop Business
8 months 4 weeks ago #359974

thanks nicolas

yah, the county thing adds another level of trickiness. as you know, we americans tax by county but don't use the county in our addresses.

we have the florida list of cities/counties so we're planning to assign tax zones by city. the client has been using this manually for decades and believes it to be reliable.

can you confirm I can assign the cart fee plugin by tax zones ?

fyi, on taxcloud. we've been using taxcloud and it works well. they recently raised minimum rates from $30/mth to $79/mth. client asked me to explore a different approach based on that.

cheers

dave

Please Log in or Create an account to join the conversation.

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
8 months 4 weeks ago #359975

Hi,

No, there is no mechanism to restrict a fee formula to a tax zone.
The condition option of the plugin allows you to take into account the data of the current cart. So you have access to the billing/shipping address information.
You could use a condition like

{cart.shipping_address.address_state} == 'state_Florida_4270' && strtoupper(trim('{cart.shipping_address.address_city}'))=='CHARLOTTE'
in order to target a specific city of a specific state.
However, note that if the user made a typo in the name of the city, then it won't match.


In think TaxCloud is much more appropriated. Configuring the cart fees plugin with dozens of fees (1 per county in Florida ) is a lot of work and its a bit clunky. It's a shame for the raise in prices.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum