Title: Calculation logic
Last modified: July 14, 2019

---

# Calculation logic

 *  Resolved [stosun](https://wordpress.org/support/users/stosun/)
 * (@stosun)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/)
 * Hi,
    I want to try different calculations based on width and height values. For
   example; width < x and height < y ; then {uni_cpo_price} = $price*width*height
   width < x and height > y ; then {uni_cpo_price} = $price*width*height*1.2 width
   > x and height < y ; then {uni_cpo_price} = $price*width*height*1.4 width > x
   and height > y ; then {uni_cpo_price} = $price*width*height*1.6
 * Is it possible to do it at free version?
    If possible, how can I write thses 
   four formulas? I can not find it.
 * Secondly, is it possible to get X and Y values from custom fields?
    Thanks at
   advance for your supoort. Regards

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

 *  Plugin Author [moomooagency](https://wordpress.org/support/users/moomooagency/)
 * (@moomooagency)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730227)
 * Hi,
 * Yes, it is possible, use formulas conditional logic.
 * No, it is not possible to get X and Y from options.
 *  Thread Starter [stosun](https://wordpress.org/support/users/stosun/)
 * (@stosun)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730240)
 * Hi moomooagency,
    Thanks for your quick reply. But, there I can not find “less”
   or “greater” operators when adding Rule. There, there are only “equal”, “not 
   equal”, “is empty” and “is not empty” operators. For example, How can I add below
   formula; {uni_cpo_en}< 100 and {uni_cpo_boy} > 200 ; then {uni_cpo_price}=$price*{
   uni_cpo_en}*{uni_cpo_boy}*1.2 .
 * Thanks again.
    Regards
 *  Plugin Author [moomooagency](https://wordpress.org/support/users/moomooagency/)
 * (@moomooagency)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730264)
 * Your width and height should be text inputs, of course. Basically, for free version
   that is all you can do.
 *  Thread Starter [stosun](https://wordpress.org/support/users/stosun/)
 * (@stosun)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730272)
 * Hi,
    Sorry,I think, you misunderstood me. I defined {uni_cpo_en} and {uni_cpo_boy}
   fields as select. Question is how I can write rule for {uni_cpo_en}< 100 and {
   uni_cpo_boy} > 200 . Because when adding rule, I can not find “less” or “greater”
   operators. Regards
 *  Plugin Author [moomooagency](https://wordpress.org/support/users/moomooagency/)
 * (@moomooagency)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730295)
 * No, no, I don’t. I told you already that your options must be text inputs. This
   is the only way in free version.
 *  Thread Starter [stosun](https://wordpress.org/support/users/stosun/)
 * (@stosun)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730369)
 * Hi moomooagency,
    Sorry, you are right. Only, at text-inputs, I can see the other
   operators. Is it possible to use select options with less /greater operators 
   at PRO version? I created some formulas like {uni_cpo_price}=$price*{uni_cpo_en}*{
   uni_cpo_boy} , but it calculates it as “1” ,always. What is the wrong at this
   formula sample?
 * Secondly, you wrote ” it is not possible to get X and Y from options.”. Is there
   any suggestions for it at Free or PRO versions?
    Briefly, I will have two “X”
   and “Y” values like 100 and 200 product based. So, I have to compare these values
   with customer inputs then I create formulas according to them. Best Regards
    -  This reply was modified 6 years, 11 months ago by [stosun](https://wordpress.org/support/users/stosun/).
 *  Plugin Author [moomooagency](https://wordpress.org/support/users/moomooagency/)
 * (@moomooagency)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730407)
 * “Is it possible to use select options with less /greater operators at PRO version?”
   –
   No.
 * “What is the wrong at this formula sample?”
    – I don’t know what is ‘$price’,
   but you will not find anywhere in the docs vars in this format. Also this ‘{uni_cpo_price}
   =’ is wrong.
 * “Briefly, I will have two “X” and “Y” values like 100 and 200 product based.”
   –
   I don’t know if this is exactly your case, too little info. But if these are 
   kind of choices in Select/Radio option, then you can use NOV matrix functionality
   to get this data – “capture” it – in NOV and then use in formula conditional 
   logic. Or use in one or many additional NOVs in order to complete your logical
   computations and then use in formula conditional logic. This is all depends on
   your exact case.
 *  Thread Starter [stosun](https://wordpress.org/support/users/stosun/)
 * (@stosun)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730429)
 * Hi,
    Many many thanks for your support. “X” and “Y” values will be entered by
   admin for each product and those values are hidden to customer.
 *  Plugin Author [moomooagency](https://wordpress.org/support/users/moomooagency/)
 * (@moomooagency)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11730761)
 * Then use NOVs for these values.
 *  Thread Starter [stosun](https://wordpress.org/support/users/stosun/)
 * (@stosun)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11733964)
 * Thanks.

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

The topic ‘Calculation logic’ is closed to new replies.

 * ![](https://ps.w.org/uni-woo-custom-product-options/assets/icon-256x256.jpg?rev
   =1764217)
 * [Product Options and Price Calculation Formulas for WooCommerce – Uni CPO](https://wordpress.org/plugins/uni-woo-custom-product-options/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/uni-woo-custom-product-options/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/uni-woo-custom-product-options/)
 * [Active Topics](https://wordpress.org/support/plugin/uni-woo-custom-product-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/uni-woo-custom-product-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/uni-woo-custom-product-options/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [stosun](https://wordpress.org/support/users/stosun/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/calculation-logic/#post-11733964)
 * Status: resolved