Taxes and discount rates

I am stuck!!!

I am trying to make a site for my business, which is set up like a direct sales company when you look at it. So I need when a consultants log in, they will get a discount based on their level and then taxes are done on FULL retail price not the discounted price then shipping is based on the discounted right ($500 or less is $30 and anything over $500 is $10)

ex: consultant gets 45% discount on an item
retail is $22
discount price is $12.10
Taxes based on 12% is $2.64
Shipping would be $30
Grand total is $44.74 (discount total+taxes+shipping)

I can NOT get these to add up correctly when doing the cart page. it either comes out with a wild number or its zero.

Can I also have the discount level change based on the person sales?

Thank you!!

There are several ways to do it. You will need to share more details about your workflows and setups so we can take a lot into what is going wrong…

Try to share some images.

most likely it is because you need to use parenthesis in your math logic
you need to enable that in the app settings (under versions)

then you may also want to break down the calculation into steps using custom events to process each part of the logic. you could either hold just the number in the event or update the database record in a field.

you could also use the math plugin for more complex math operations if needed.

my guess - without seeing your calculations - is that how you are applying the percentages is throwing the calc off

Don’t bother with custom states, they are unnecessary for this, and you don’t need a plugin.

Best way to achieve this is through input elements.

All values need an input element, so retail price of $22 is in an input element, and all input elements are decimal. Also, do keep in mind, an input element can be formatted to look like plain text, can have it disabled as well, so if your retail price is not to be altered, just format the input so it is not. This is true for all of the inputs you need.

Discount Price input initial content is the retail price input value multiplied by the discount percentage

Taxes input initial content is the retail price input value multiplied by the tax rate

Shipping input initial content is done through conditionals, one for your $500 or less and one for your $500 or more…these reference the discount input value to determine if it is over $500 or not…then property to change is the initial content which will be either $30 or $10 (in reality can do this without conditionals and in main initial content use formatted as text operator:converted to number to get ‘inline conditional’)

Grand Total input initial content is the discount price input value + taxes input value + shipping input value

Note, if you have a situation in which no discount is applied make sure to use conditions on the discount price input initial content so you do not attempt to multiply 0 (ie: 0%) by the retail price input value.

This worked took a bit but got it!!! Thank you!!! :slight_smile:

1 Like