Title: Conditional calculations based on quantity
Last modified: May 2, 2023

---

# Conditional calculations based on quantity

 *  Resolved [copyart](https://wordpress.org/support/users/copyart/)
 * (@copyart)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/conditional-calculations-based-on-quantity/)
 * I want to make a sticker calculator.
   Is it possible to calculate the price based
   on the quantity, e.g.1 sticker costs 10.0010 stickers cost 8.00 per sticker20
   costs PLN 6.00 per stickerThe price per sticker is lower for larger quantities

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [stanstylemixthemes](https://wordpress.org/support/users/stanstm/)
 * (@stanstm)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/conditional-calculations-based-on-quantity/#post-16707289)
 * Hello, [@copyart](https://wordpress.org/support/users/copyart/)
 * This case can be solved using a JS formula, namely an if/else condition. I assembled
   a calculator according to your description and demonstrated the calculator in
   the video:
 * [Link](https://www.loom.com/share/0905fe28ccbb4879b9a8ed4355bf49dd)
 * Formula used in the calculator:
 * `if ( quantity_field_id_0 < 10 ) { quantity_field_id_0 * 10 } else if ( quantity_field_id_0
   >= 10 && quantity_field_id_0 <20 ) { quantity_field_id_0 * 8 } else if ( quantity_field_id_0
   >= 20 ) { quantity_field_id_0 * 6 }`
 * You can continue the formula and lower the price relative to the quantity.
 * Best regards.
 *  Thread Starter [copyart](https://wordpress.org/support/users/copyart/)
 * (@copyart)
 * [3 years ago](https://wordpress.org/support/topic/conditional-calculations-based-on-quantity/#post-16775109)
 * hello
   Thanks for the answer, the formula works. What formula to add to make the
   amount greater than or equal to 30 to the condition formula.Best regards.
 *  [stanstylemixthemes](https://wordpress.org/support/users/stanstm/)
 * (@stanstm)
 * [3 years ago](https://wordpress.org/support/topic/conditional-calculations-based-on-quantity/#post-16776630)
 * Hello, [@copyart](https://wordpress.org/support/users/copyart/)
 * I didn’t quite understand what kind of condition you need to add and whether 
   it is related to your last request. Could you please, as in the first example,
   describe the principle of the calculator?
 * Best regards.
 *  Thread Starter [copyart](https://wordpress.org/support/users/copyart/)
 * (@copyart)
 * [3 years ago](https://wordpress.org/support/topic/conditional-calculations-based-on-quantity/#post-16776722)
 * This is related to a recent request. I need a formula with a minimum price. The
   calculator displays a fixed price, e.g. 30 above this amount, it calculates according
   to the formula you wrote me.
   I need to combine these formulasif ( (total_field_id_8_total\
   _field\_id\_9) >30) { (total\_field\_id\_8_ total_field_id_9) } else {30} with
   this formula if ((total_field_id_8) < 10) { (total_field_id_8) * (total_field_id_9)}
   else if ((total_field_id_8) >=10 && (total_field_id_8) < 30) { (total_field_id_8)_((
   total\_field\_id\_9)_0.75) } else if ((total_field_id_8) >=30 && (total_field_id_8)
   < 50) { (total_field_id_8) _((total\_field\_id\_9)_0.65) } else if ((total_field_id_8)
   >=50 && (total_field_id_8) < 70) { (total_field_id_8) _((total\_field\_id\_9)
   _0.55) } else if ((total_field_id_8) >=70 && (total_field_id_8) < 10000) { (total_field_id_8)_((
   total\_field\_id\_9)_0.50) }
 *  Plugin Support [EricStylemixThemes](https://wordpress.org/support/users/ericstylemixthemes/)
 * (@ericstylemixthemes)
 * [3 years ago](https://wordpress.org/support/topic/conditional-calculations-based-on-quantity/#post-16804858)
 * Hello [@copyart](https://wordpress.org/support/users/copyart/)
 * Sorry for keeping you waiting.
 * I checked your formula and there some mistakes and some symbols missing. it seems
   WordPress editor misformatted.
 * if you need to combine our agent’s formula with yours, you can just continue 
   adding else if and the last statement should be finished with else:
 * [https://www.w3schools.com/js/js_if_else.asp](https://www.w3schools.com/js/js_if_else.asp)
 * If you can attach an exported version of your calculator, we can review the logic
   that you are using.
 * Regards

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Conditional calculations based on quantity’ is closed to new replies.

 * ![](https://ps.w.org/cost-calculator-builder/assets/icon-256x256.png?rev=3525305)
 * [Cost Calculator Builder](https://wordpress.org/plugins/cost-calculator-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cost-calculator-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cost-calculator-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/cost-calculator-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cost-calculator-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cost-calculator-builder/reviews/)

## Tags

 * [conditional](https://wordpress.org/support/topic-tag/conditional/)

 * 5 replies
 * 3 participants
 * Last reply from: [EricStylemixThemes](https://wordpress.org/support/users/ericstylemixthemes/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/conditional-calculations-based-on-quantity/#post-16804858)
 * Status: resolved