The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Taxes, Coupons, and Wholesale... Oh My!

nickffnickff Member
in Help edited July 2012
Hi All,

Odd scenario here that I'm trying to figure out the quickest solution for.

The overview:
Client has wholesale customers that receive 50% off all orders.
I create coupon code that they then give to wholesalers for usage when ordering.
Works perfectly.

The wrinkle:
Store is located in Vermont, which has 6% sales tax.
Tax is created for Vermont customers and works great.
But tax does not apply to wholesale customers, whether in state or not.

The solution:
I was hoping coupon codes had the option to remove sales tax, but they don't.
This makes me think that I'm gonna need to pass in a field to the checkout page if the wholesale coupon code is present, which then negates sales tax on the order whether the customer is located in vermont or not.

Is that possible? If so, would anyone be able to shine some light on a potential way to pull that off? *cough* @fc_adam *cough*.

Let me know!
Comments
  • oskayoskay Member
    I imagine that you could use javascript on the checkout page that, if the wholesale coupon is present, changes the category code of every item in the cart to "wholesale," where you set up that "wholesale" category to not apply a sales tax.
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    @oskay is right - you can't actually use javascript in the cart to disable taxes. They come back anyway.

    I recommend hijacking the SSO to check the cart, if the coupon is there, loop through all the products and remove them, then re-add them in a non-tax category.

    Assuming you are using FoxyShop: here's some code to get you started: http://www.foxy-shop.com/wp-content/uploads/2012/04/foxyshop-inventory-custom.zip (you only need the piece that hooks into the SSO action)
  • fc_adamfc_adam FoxyCart Team
    edited July 2012
    @nickff,

    @oskay and @sparkweb covered it for you - but just to make one point clear, you can't customise taxes on the checkout using javascript as they are re-added server-side when the customer hits to confirm their checkout. SSO is definitely your best bet.
  • nickffnickff Member
    Thanks so much guys, this is great. I'll start plugging away at this and see how it goes!
Sign In or Register to comment.