Tested Perfect rating

Product Price by Formula for WooCommerce

(3 customer reviews)

From: $19.99 / year

Set formula for automatic WooCommerce product price calculation.

Clear

Description

Product Price by Formula for WooCommerce plugin lets you set formula for automatic WooCommerce product price calculation.

Plugin settings are accessible via “WooCommerce > Settings > Product Price by Formula”.

Bulk Settings

Product Price by Formula for WooCommerce - Bulk Settings

Enable for all products
Enables price calculation by formula for all products.
Default: no
Disable for product IDs
If you have checked “Enable for all products” option, you can optionally add product exceptions here (i.e. price calculation by formula will be disabled for these products). Set it as comma separated list of product IDs.
Default: None
Disable for product category IDs
If you have checked “Enable for all products” option, you can optionally add product category exceptions here (i.e. price calculation by formula will be disabled for these product categories). Set it as comma separated list of product category IDs.
Default: None
Use same formula
Enables same formula for all products. Possible values: No; Yes (with individual params); Yes (with same params).
Default: No

General Settings

Product Price by Formula for WooCommerce - General Settings

Disable for empty price
Disables price by formula for products with empty price.
Default: yes

Admin Settings

Product Price by Formula for WooCommerce - Admin Settings

Add dashboard widget
Adds default settings admin dashboard widget.
Default: no
Products list columns
Adds columns to the admin products list. Possible values: Formula; Params; Price.
Default: None

Advanced Settings

Product Price by Formula for WooCommerce - Advanced Settings

Shortcodes prefix
Optional prefix for all plugin’s shortcodes. E.g.: if set to my_prefix_, will transform [math_round] to [my_prefix_math_round].
Default: None
Price filters priority
Priority for WooCommerce price filters. Set to zero to use the default priority.
Default: 0
Plugin URLs
By default plugin applies price calculations on frontend only. If you need to apply it on other URLs, enter URLs here. One URL per line. E.g.: /wp-admin/edit.php?post_type=product
Default: None
Price changes
Try enabling this checkbox, if you are having compatibility issues with other plugins.
Default: no

Default Formula Settings

You can set default settings here. All settings can later be changed on individual product’s edit page (in Product Price by Formula meta box).

In formula use x variable for product’s base price. For example: x+p1*p2. Please note that you can not use x or pN inside other params.

In formula and/or params use can also use shortcodes.

Please note that if you are using caching plugins and dynamic product pricing (e.g.: price changing with product stock ([product_stock]) or by customer’s location ([if_customer_location])), then caching needs to be disabled for products pages. If you want to keep caching enabled, you will need to cache product pages for each condition: for example for [if_customer_location] you can set Default customer location option to Geolocate (with page caching support) in WooCommerce > Settings > General.

Product Price by Formula for WooCommerce - Default Formula Settings

Formula
Price formula.
Default: None
Number of parameters
Save settings after you change this number – new settings fields will appear.
Default: 1
pN: Value
Parameter value.
Default: None
pN: Admin note (optional)
Optional parameter admin note.
Default: None

Shortcodes

[math_round] – Rounding shortcode. Number of decimals can be set with precision attribute.

Example

[math_round precision="1"][if_customer_location country="US,CA"]x*1.10[/if_customer_location][if_customer_location not_country="US,CA"]x*1.20[/if_customer_location][/math_round]

[math_ceil] – Rounding up (ceil).

Example

[math_ceil]x*[product_weight][/math_ceil]

[math_floor] – Rounding down (floor).

Example

[math_floor]x*[product_length][/math_floor]

[math_min] – Min value.

Example

[math_min value1="x*p1" value2="x*p2"]

[math_max] – Max value.

Example

[math_max value1="x*p1" value2="{product_total_sales}"]

[product_meta] – Retrieves any meta for the product. Meta key is set by required key attribute.

Example

[product_meta key="_weight"]

[product_total_sales] – Retrieves product’s total sales number.

Example

[product_total_sales]

[product_stock] – Retrieves product’s stock.

Example

[product_stock]

[product_weight] – Retrieves product’s weight.

Example

[product_weight]

[product_length] – Retrieves product’s length.

Example

[product_length]

[product_width] – Retrieves product’s width.

Example

[product_width]

[product_height] – Retrieves product’s height.

Example

[product_height]

[product_id] – Product’s ID.

Example

[if_value value="{product_id}" compare_operator="in" compare_to_value="100,101,102"]x*4.9[/if_value][if_value value="{product_id}" compare_operator="not_in" compare_to_value="100,101,102"]x*5.5[/if_value]

[product_attr] – Retrieves product’s attribute. Attribute is set by required attribute attribute.

Example

[product_attr attribute="size"]

[if_customer_location] – Price by customer’s location (by IP).

Example

[if_customer_location country="US,CA"]x*1.10[/if_customer_location][if_customer_location not_country="US,CA"]x*1.20[/if_customer_location]

[if_time] – Price by current time.

Example

[if_time from="00:00:00" to="11:59:59"]x*1.10[/if_time][if_time from="12:00:00" to="23:59:59"]x*1.20[/if_time]

[if_date] – Price by current date.

Example

[if_date from="2018-09-15 00:00:00" to="2018-10-15 23:59:59"]x*1.10[/if_date][if_date from="2018-10-16 00:00:00" to="2019-09-14 23:59:59"]x*1.20[/if_date]

[if_user_role] – Price by customer’s user role.

Example

[if_user_role role="guest,administrator"]x*1.10[/if_user_role][if_user_role not_role="guest,administrator"]x*1.20[/if_user_role]

[if_user_id] – Price by customer’s user ID.

Examples

[if_user_id id="1,5"]x*1.10[/if_user_id][if_user_id not_id="1,5"]x*1.20[/if_user_id]
x[if_user_id id="0"]*2[/if_user_id]

[if_product_category] – Price by product’s category.

Example

x[if_product_category slug="cat1,cat2"]*1.10[/if_product_category][if_product_category not_slug="cat1,cat2"]*1.20[/if_product_category]

[if_product_tag] – Price by product’s tag.

Example

x[if_product_tag slug="tag1,tag2"]*1.10[/if_product_tag][if_product_tag not_slug="tag1,tag2"]*1.20[/if_product_tag]

[if_product_taxonomy] – Price by product’s taxonomy (any).

Example

x[if_product_taxonomy taxonomy="product_cat" slug="cat1,cat2"]*1.10[/if_product_taxonomy][if_product_taxonomy taxonomy="product_cat" not_slug="cat1,cat2"]*1.20[/if_product_taxonomy]

[if_value] – Compares any two values. Required attributes: value, compare_operator and compare_to_value. Possible compare operators are: equal, not_equal, less, less_or_equal, greater, greater_or_equal, in, not_in, between, not_between. There is also inclusive attribute for between, not_between compare operators.

Example

x[if_value value="{product_meta key='_weight'}" compare_operator="less" compare_to_value="1.5"]*4.9[/if_value][if_value value="{product_meta key='_weight'}" compare_operator="greater_or_equal" compare_to_value="1.5"]*5.5[/if_value]

[if_product_id] – Price by product’s ID.

Example

[if_product_id compare_operator="in" compare_to_value="100,101,102"]x*4.9[/if_product_id][if_product_id compare_operator="not_in" compare_to_value="100,101,102"]x*5.5[/if_product_id]

[if_product_meta] – Price by product’s meta.

Example

[if_product_meta key="_weight" compare_operator="less" compare_to_value="100"]p1[/if_product_meta][if_product_meta key="_weight" compare_operator="greater_or_equal" compare_to_value="100"]p2[/if_product_meta]

[if_regular_price] – Apply formula to regular product price.

Example

x[if_regular_price]*2[/if_regular_price][if_sale_price]/2[/if_sale_price]

[if_sale_price] – Apply formula to sale product price.

Example

x[if_regular_price]*2[/if_regular_price][if_sale_price]/2[/if_sale_price]

[option] – Site option.

Example

x+[option name="my_option_name" default="1"]

Usage Examples

Example 1

Let’s say product’s standard (i.e. original) price is $50 and its stock is 15 pcs. If you set Formula to x+p1*p2, Number of parameters to 2, p1 to 1.5 and p2 to [product_stock], then final price will be 50 + 1.5 * 15 = 72.5, i.e. $72.50.

Example 2

Let’s say you need to use [if_value] shortcode. While you could enter value directly, usually you will need to retrieve it from another shortcode or meta field, e.g. product weight. As placing [, ] and " in shortcode’s attributes is not allowed in WordPress, you will need to replace it with {, } and ' accordingly, e.g.:

x[if_value value="{product_meta key='_weight'}" compare_operator="less" compare_to_value="1.5"]*4.9[/if_value][if_value value="{product_meta key='_weight'}" compare_operator="greater_or_equal" compare_to_value="1.5"]*5.5[/if_value]

In the example above: product’s original price (x) will be multiplied by 4.9 in case if product weight ({product_meta key='_weight'}) is less than 1.5. And it will be multiplied by 5.5 if product weight is greater or equal to 1.5.

Moreover you can add shortcodes inside [if_value] shortcode’s content, e.g.:

[if_value value="{product_meta key='_weight'}" compare_operator="less" compare_to_value="1.5"][product_meta key="_length"]*4.9[/if_value][if_value value="{product_meta key='_weight'}" compare_operator="greater_or_equal" compare_to_value="1.5"][product_meta key="_length"]*5.5[/if_value]

Example 3

Using [product_attr] shortcode in [if_value] shortcode:

x[if_value value="{product_attr attribute='color'}" compare_operator="equal" compare_to_value="Gray"]*1.25[/if_value]

In this example all products with “Gray” color attribute will have a 25% price markup.

3 reviews for Product Price by Formula for WooCommerce

  1. masterez

    The plugin functions like it should and the support in great!

  2. Ajay Maharjan

    hello!
    Before purchasing the API I would like to know if you can calculate with below example

    Product value = round(Price * Product Weight * 1.15,0)

    *Price: Need to change every day for bulk products ( around 200 items)
    *Product weight: Will input by a user at the time of product entry.
    * 1.15: just a number

    • Tom Anbinder

      Hi,

      Sorry for a late reply.

      Yes, that is possible. Please set this as (Default) Formula:

      [math_round precision="0"]x*[product_weight]*1.15[/math_round]

      or more generally:

      [math_round precision="0"]x*[product_meta key="_weight"]*1.15[/math_round]

      Hope that helps.

  3. djmfxp

    hi
    i want buy and use “Product Price by Formula for WooCommerce”

    but i want know some details

    i want use a unique single formula for all products(all product use a one formula)
    but any products use own paramaters for universal formula.

    can i do with this plugin?

    • Tom Anbinder

      Yes, that is possible by selecting “Yes (with individual params)” option in “Use same formula” dropdown in plugin’s “General” settings.

Add a review

Your email address will not be published. Required fields are marked *

65 thoughts on "Product Price by Formula for WooCommerce"

  1. I have 3 roles I need different pricing for how do I do that? If I add

    [if_user_role=”administrator”]x*1.10[/if_user_role] and [if_user_role=”user”]x*1.10[/if_user_role] etc I get 0

  2. I have a question on how to use [if_value] or any other if blocks. We have two conditions, like if x=1 and y=1 then set a price. How can we do this logic through [if_value]? Below are two attributes we want to use as part of the conditions. How can we add the “and”?
    [if_value value=”{product_attr attribute=’Pages’}” compare_operator=”less” compare_to_value=”500” ]
    [if_value value=”{product_attr attribute=’Stock’}” compare_operator=”equal” compare_to_value=”matte”]

    Thanks

  3. we just bought your price calculator and still learning on how to use it. To disable formula for some category, it says enter the CategoryID/ProductID. How can we find these IDs? I only see names.

    Also I need to know if we can use the quantity as part of the condition. Like if quantity is below 200 use this price, over use different price.

    Thanks

  4. Hi, im interested in buying your plugin, my question is if there is a way to save the price after apply formula at the woocommerce database, rigth now i’m updating (with automattic import) prices (buying prices) of my products (about 10000) 2 or 3 times a day. Thats because i would like to export my products with the modified price. Thanks.

  5. Hi,
    I had purchased the plugin Product price by Formula. It is working fine for simple products but when I am trying to use for variable products, the price is not getting reflected on the frontend. This issue had happened earlier as well where you had added `use_parent_product` attribute for variable products and had added it for ‘product_weight’ as well. Now, when I am calculating formula for products through other attributes, it is not getting reflected on frontend.

    Have sent the details on an email as well. Looking forward to an early response since it is extremely urgent.

    Thanks

    1. Hi,

      It has been more than a week, I have sent you several emails that it is not working in variable products scenario.

      It is urgent, can you please reply back.

  6. Hi, I’ve been contacted for couple of times and haven’t heard back yet. We’re interested in your product but have couple few questions:
    1. Quantity – can it be part of condition as well as use it in the formula?
    2. Can we have multiple formulas or only one?
    3. Attributes – can we use customed attribute or have to use global attributes?

    Thanks

  7. Hi There,
    I installed your plugin and set in all the formulars for woocommerce which I need. Problems are as follows:
    1. In some cases in which I do have a categories with subcategories, I only need to mention the parent category in a formula. And in other I need to handle each subcategory in a separate formula. I can´t figure out what the problem could be.
    2. In some cases I am not able to have a formula for a certain parent category in any way
    3. In a subcategory in which I would like to have a different kind of multiplier as it is used in the parent category, I am not able to define it…

    So would you mind having a look into the wp-system to find out where the problem is?!
    Cheers,
    Daniel

    1. Hi Daniel,

      If possible, please share an admin account to your site – my email is [email protected].

    2. As we’ve figured out in private emails, the problem was that by default [if_product_category] shortcode only checks the first product category. So if your products have multiple categories, you need to add multiple attribute (available since plugin v2.3.0), e.g.:

      x[if_product_category slug="hats" multiple="yes"]*1.10[/if_product_category]
  8. Hello,

    thank you very much for your great plugin.

    I am using the shortcode x[if_product_category slug=”cat1,cat2″]*1.10[/if_product_category][if_product_category not_slug=”cat1,cat2″]*1.20[/if_product_category] for generating the prices for all products in my shop.

    Now I have the first product in used condition and therefore I need a separate price just for one product.

    How can I generate the special price just for one product?

    Thank you very much in advance.

    Best regards,
    Ismar Derlic

    1. Hi Ismar,

      First solution that comes to mind:

      1. Change your formula to:

      x[if_product_category slug="cat1,cat2"]*p1[/if_product_category][if_product_category not_slug="cat1,cat2"]*1.20[/if_product_category]

      2. Set “Number of parameters” to 1 and save changes.

      3. For p1 value set:

      [if_product_id compare_operator="in" compare_to_value="1659"]2.5[/if_product_id][if_product_id compare_operator="not_in" compare_to_value="1659"]1.10[/if_product_id]

      Here you need to replace 1659 (in two places) with the product ID you wish to make the exception for. You can also enter multiple product IDs with comma-separated list, e.g.: 1659,1710,1900. Also you need to change 2.5 with the coefficient you wish to apply for the exception product.

      Hope you get the idea. Please let me know if something is not working as expected or if you have any questions. And if you like the plugin, please consider leaving us a rating.

    2. Hello Tom,

      thank you for your help. I did exactly what you have described and the plugin outputs a price of 0,00 € for the specific product. Also all other prices of the category with variable p1 have changed to 0,00 €.

      Maybe I can give you access to my website and you can take look?

      Thank you very much.

      Best regards,
      Ismar

    3. Hi Ismar,

      Yes, website access would help. My email is [email protected].

    4. If anyone else has a similar question – as we’ve figured out in private emails – the problem was that “Use same formula” option had to be set to “Yes (with same params)” (instead of “Yes (with individual params)”) (in plugin’s “General” settings section).

  9. Hi There, i do have a problem. We import 10000 products with buying prices. And now we want your tool to calculate and show the selling prices on the Woo Product page. We use different calculation percentages for each Product Category like this (x[if_product_category slug=”bags”]*1.10[/if_product_category] [if_product_category slug=”men”]*1.50[/if_product_category])
    Everything is working fine BUT we want to prevent that if a product will be imported with a complete new category (a category to wicht we don´t have a formular for), the the buying price is showing up on the product page. So my question is, if there is any formular for this situation. For example: For products with the category “bag” use 1.2, for category “men” use 1.25 … and for other product categories use 1.33
    Is that possible?
    all product how

    1. Hi Olaf,

      Yes, that is possible. Basically, there are at least two possible solutions:

      1. You can use not_slug attribute, i.e.:

      x[if_product_category slug="bags"]*1.10[/if_product_category][if_product_category slug="men"]*1.50[/if_product_category][if_product_category not_slug="bags,men"]*1.33[/if_product_category]

      2. You could recalculate coefficients, i.e.:

      x*1.33[if_product_category slug="bags"]*0.827068[/if_product_category][if_product_category slug="men"]*1.127820[/if_product_category]

      That is – first we are always multiplying by 1.33 and then in case of “bags” we are additionally multiplying by 0.827068 (as 1.10 / 1.33 = 0.827068) and so on… Hope you get the idea.

      You could also write it in another form:

      x*1.33[if_product_category slug="bags"]*1.10/1.33[/if_product_category][if_product_category slug="men"]*1.50/1.33[/if_product_category]

      Please note that I didn’t test it, but I believe that both solutions should work fine, so please let me know if something is not working as expected.

      P.S. Please let me know if you have any questions. And if you like the plugin, please consider leaving us a rating at https://wordpress.org/support/plugin/product-price-by-formula-for-woocommerce/reviews/.

  10. Hello, I am using your plugin for generating prices in my online shop trendz24.de.

    Now, I want to export my products to Google Shopping. Therefore, I am using the plugin “Woocommerce Product feed manager” by WPMarketingRobot.

    I have a problem with the price. At the moment I can only export the regular price which is my buying price, but I want to export the prices generated by your plugin.

    How can I do that?

    Thank you in advance.

    Best regards,
    Ismar

    1. Hi Ismar,

      Maybe you can create/share an admin account to your server (WP and FTP), so I could log in and check what’s going on. My private email is [email protected].

  11. Hi Tom, I am really interested in buying your plugin. However, am I able to use your plugin with variable product attributes and using the attribute values into the formula? For example, I have a custom product attribute called “Number Of Prints” that is used for variations; Can I use it as part of the formula?

    1. Hi Zack,

      Please try:

      [product_meta key="attribute_pa_number-of-prints"]
    2. Thank you so much for your reply Tom! Can I ask another question? What if my attribute is of a text value instead of an integer value? Can I still use the conditional if_value shortcode?

    3. For example:
      [if_value value=”{product_meta key=’attribute_pa_media-type’}” compare_operator=”equal” compare_to_value=”paper”]x*4.9[/if_value]

    4. Wasn’t possible (as [product_meta] shortcode automatically converted the value to number), however, I have just added new convert_to_numeric shortcode attribute to [product_meta] in our development version, so now you should use:

      [if_value value="{product_meta key='attribute_pa_media-type' convert_to_numeric='no'}" compare_operator="equal" compare_to_value="paper"]x*4.9[/if_value]
    5. Wow! This is amazing. Great work man. However, can I confirm if this plugin will work with variable product?

      For example, my variable product have 2 options (attributes).
      1: Media Type (Paper, Cardboard)
      2: Number Of Prints (1, 2, 3)

      Formula:
      [if_value value=”{product_meta key=’attribute_pa_media-type’ convert_to_numeric=’no’}” compare_operator=”equal” compare_to_value=”paper”]
      (x+0.2)*{product_meta key=’attribute_pa_media-type’}
      [/if_value]
      [if_value value=”{product_meta key=’attribute_pa_media-type’ convert_to_numeric=’no’}” compare_operator=”equal” compare_to_value=”cardboard”]
      (x+0.5)*{product_meta key=’attribute_pa_media-type’}
      [/if_value]

      So when I select my options in the frontend, the pricing will update as accordingly?

    6. Yes, it will work with variable products (i.e. will set different prices for each variation depending on variation’s attributes). Small fix in formula is needed though:

      [if_value value="{product_meta key='attribute_pa_media-type' convert_to_numeric='no'}" compare_operator="equal" compare_to_value="paper"]
      	(x+0.2)*[product_meta key="attribute_pa_number-of-prints"]
      [/if_value]
      [if_value value="{product_meta key='attribute_pa_media-type' convert_to_numeric='no'}" compare_operator="equal" compare_to_value="cardboard"]
      	(x+0.5)*[product_meta key="attribute_pa_number-of-prints"]
      [/if_value]

      I.e. { and } brackets are only used inside shortcodes attributes, and inside shortcode’s content you need to use normal (i.e. square) brackets ([ and ]) for shortcodes.

    7. AWESOME! Is there anyway I can try a demo of the frontend first? I can’t seem to find any demo websites here.

    8. If anyone else has similar tasks – we’ve just released new plugin v2.2.1, where we have:

      1. added [product_attr] shortcode, which would be the correct way of retrieving the product’s attributes, e.g.:

      [product_attr attribute="number-of-prints"]

      You can also get product attribute’s value as suggested earlier by:

      [product_meta key="attribute_pa_number-of-prints"]

      However it seems that this way only works for variations, but not for simple type product’s attributes, while [product_attr] shortcode works for all types of products.

      2. added convert_to_numeric attribute to the [product_meta] shortcode (attribute defaults to yes).

  12. Hi how are you? I need to make this formula on my web page, could you help me?

    Product cost x 2 = retail price any thing from .01 to.98 should be rounded up to .99 + $2 = retail price displayed on site
    10.20 x 2 = 20.40 rounded up to .99 + $2 = $22.99

    1. Hi Samuel,

      That depends on how “product cost” is saved on your site.

      If you mean that you set this “product cost” as standard WooCommerce price, then you need to set Formula to:

      [math_ceil]x*2[/math_ceil]-0.01+2

      And if you mean that you are using some additional plugin to set this “product cost”, then you need to know product meta key in which cost is stored in product. For example, if you are using our Cost of Goods for WooCommerce plugin, then cost will be saved in _alg_wc_cog_cost meta key, so you need to set Formula to:

      [math_ceil][product_meta key="_alg_wc_cog_cost"]*2[/math_ceil]-0.01+2

      Hope that helps. Please let me know if something is not working as expected or if you have any questions. And if you like the plugin, please consider leaving us a rating.

  13. i think that i may need some help. i can not get the prices to update after i have entered a default formula

  14. Hello Tom,
    I would like to buy the price formula plugin.
    I would like to check (in each product page) “use default formula value” with daily variable values for different categories.
    F=x[if_product_category slug=”Gold”]*p1[/if_product_category][if_product_category slug=”Silver”]*p2[/if_product_category][if_product_category]slug=”Platinum”]*p3[/if_product_category]
    p1 = gold price, p2 = silver price, p3 = platinum price, and x is the weight. But I have a big problem. Commercial addition (mark-up) is different from product to product and should be added at the end of formula calculation as a numeric value. So, there is it a way to add commercial addition to “Final price preview”, as a numeric value, for each product? Or, is posible to keep default formula value p1,2,3 and have another p4 variable for each product? Final Formula= F+p4, p4- editable numeric value.

    Thank you
    PS: the website has a test domain

  15. Hello – Another question.
    I have a quantity plugin (the price is change due to a quantity product).
    But when i click Add to cart the price is the formula price * quantity.
    Is there a way to change it?
    URL: https://appirsum.com/product/belt/
    Thank you in advance,

  16. Hello.
    I’m trying using this formula to change prices:
    x[if_value value=”x” compare_operator=”less” compare_to_value=”50″]*2.5[/if_value]
    [if_value value=”x” compare_operator=”less” compare_to_value=”100″]*3.5[/if_value]
    [if_value value=”x” compare_operator=”less” compare_to_value=”150″]*4.5[/if_value]
    For some reason it does not work.
    Do you have any idea, why?
    Thank you in advance.

    1. Hi,

      The issue is that you can’t use x inside the shortcode’s attributes. Please try replacing x with {product_meta key='_price'}, i.e.:

      x[if_value value="{product_meta key='_price'}" compare_operator="less" compare_to_value="50"]*2.5[/if_value]
      [if_value value="{product_meta key='_price'}" compare_operator="less" compare_to_value="100"]*3.5[/if_value]
      [if_value value="{product_meta key='_price'}" compare_operator="less" compare_to_value="150"]*4.5[/if_value]

      * Please note that in your example if the original price is lower than 50 it will be multiplied by 2.5, then by 3.5 and then by 4.5. I.e. if, for example, the original product price is 5, the final price will be 5 * 2.5 * 3.5 * 4.5 = 196.88 (as 5 is lower than all values, i.e lower than 50, lower than 100 and also lower than 150).

      Hope that helps.

    2. Thank you very much for your quick and great support.
      Now i’m trying to solve the problem you mentioned.
      Thank you again.

    3. Sure, no problem, happy to help 🙂

      Regarding your task – if understood it correctly – one solution would be to re-calculate multipliers. I.e. if you need to multiply the price by 3.5, but it was already multiplied by 2.5, then you need to multiply only by 1.4, because 3.5 / 2.5 = 1.4, i.e. x * 3.5 is the same as x * 2.5 * 1.4. Hope you get the idea. So your formula would look like this:

      x[if_value value="{product_meta key='_price'}" compare_operator="less" compare_to_value="50"]*2.5[/if_value]
      [if_value value="{product_meta key='_price'}" compare_operator="less" compare_to_value="100"]*1.4[/if_value]
      [if_value value="{product_meta key='_price'}" compare_operator="less" compare_to_value="150"]*1.2857[/if_value]

      Now after your question, I’m thinking that I should add new between value to the compare_operator attribute in the [if_value] the shortcode, so it could be used like that:

      x[if_value value="{product_meta key='_price'}" compare_operator="between" compare_to_value="50,100"]*2.5[/if_value]

      I.e. compare_to_value attribute would be set as comma separated values. Will be adding that in next plugin version.

      Hope that helps.

      P.S. If you like the plugin, please consider leaving us a rating.

  17. Hi,

    I would like to change price based on date, for example:
    if current date is 3 days from the booking date (coming from the date field within single product page) > total price is higher 15%

    Please let me know is this possible?

    Thank you!

    1. Hi,

      Not possible at the moment, however I think it should be easy to add to the plugin. One question though – how is booking date saved in your product’s field? Is it saved as timestamp (e.g. 1549238065) or as date string (e.g. 2019-02-04 15:00:00)?

  18. Hi Tom,

    Really loving this plug-in.

    I’m noticing that x is affecting both sales and regular prices.

    I’m hoping to import x as a sales price and then add a formula but then import the regular price as the msrp.

    Is that possible?

    Many thanks and I look forward to hearing from you.

  19. Hello Tom,
    I want to add different formula for different categories containing more than 500 products but I dont see any option for adding different formula for different categories in free version. Do I have to purchase this plugin for adding more than formulas??

    1. Hi,

      What you need is [if_product_category] shortcode – unfortunately, it’s included in Pro version only. Basically, you will have one formula, but prices will be calculated differently depending on the product’s category. So in “Formula” you would need to enter something like this:

      x[if_product_category slug="cat1,cat2"]*1.10[/if_product_category][if_product_category not_slug="cat1,cat2"]*1.20[/if_product_category]

      In this example: if product’s category is “cat1” or “cat2” then the price is multiplied by 1.10 (i.e. 10% is added to the original price), and for all other products it’s multiplied by 1.20 (i.e. 20% is added).

  20. Hello Tom,
    Where shall I put the value of x in the website admin section while uploading the product?

    1. Hi Ajay,

      You just enter it as a standard price.

    2. Hello tom
      But I have to change the value of price every day.
      I have more than 500 items in my website.
      Does the value change in all 500 products once I change in one part?

    3. Yes, the final price will change automatically. For example: if you set formula to x+5 (e.g. in “WooCommerce > Settings > Product Price by Formula > Default Formula” for all products), then the price for each product will be calculated by adding 5 to its standard price. So, for example, if product A has standard price (i.e. price that is set normally, without our plugin) at 100, then its new (i.e. calculated by our plugin) price will be 100+5=105, and if product B has standard price set to 50, then its new price will be 50+5=55. So if you change standard price for some product, then new price will be re-calculated automatically.

      Hope that makes sense.

  21. Hello tom,
    Thank you for your reply.
    Could you please let us know where shall I put the value of ” Price” in the formulae
    [math_round precision=”0″]x*[product_meta key=”_weight”]*1.15[/math_round]

    “Product value = round(Price * Product Weight * 1.15,0)
    I think
    Product weight = _weight
    math_round is for rounding of he value.
    confused about the Price.

    Looking forward to hearing from you soon. Thank you.

    1. x is what is always replaced by price.

  22. Hello, when i use a formula for example x*2 the price change correctly but in the cart at checkout the price will be (x*2)*2 !! the problem seem that at checkout the function will run another time .
    how we can resolve this problem?
    thanks…

  23. How can I get the pricing to update automatically? It currenlty will only update on products if I click ‘update’ on each individual product. But if I’m trying to use one forumla for 400 products that can be time consuming. Thanks!

  24. Hello,

    Is it possible to add to the formula the cart quantity?
    My senario is this:
    10000qty of a product that cost 2€ with shipping cost of 3000€ of any qty someone will order.
    So even if someone orders 10000 or 20000 the shipping cost will be 3000.
    What i want to do is depending on the total cart quantity of products to divide the 3000 with that and then add it to the product price.
    So if someone has 10000 quantity then it should be 3000/10000=0.30€
    Product price would then be 2.30€.
    If then i order another 10000 of an other product that also cost 2€ that means that the shipping per product is 3000/20000=0.15€
    So now it should show 2.15€ as cost per lighter.

    Thanks in advance!

  25. There may be possibility to change the names of the parameters ?
    that i will know what the value of the parameter; like p1 will bee “paypalfee”, p2 “handlingfee” etc..

    1. Hi,

      We’ve just released new plugin version 1.1.0. Unfortunately I didn’t manage to add custom parameter naming there, however we have added “Admin note” option for each parameter (it’s in “WooCommerce > Settings > Product Price by Formula > Default Settings”). Please let me know if that’s good enough.

  26. Hi
    This plugin seems to be able to fulfill my needs, but i have to ask before purchase.
    I need all my product prices to be updated when i change the default value of my parameters.
    Does this plugin do that?

    I would appreciate it if you could reply ASAP.

    1. I need this too. As long as the value is not changed in a product, I want the changed global value to propagate down to the product (what I really need is a global margin setting for prices and this plugin comes close).

    2. Hi,

      Sorry for the late reply. Not sure I understood it correctly. If you are using the “Default formula”, you can change the parameter there and product prices will change accordingly. For example, if you have x*1.05 formula, then after you change the margin (i.e. 1.05) product prices will be updated. Could you please try to explain it to me to once again (if possible maybe give an example of how this should work)?

    3. I mean that if I change the default value for a field in the settings of the plugin, I want that new value to ripple to all products using that field if it’s not overridden in that product. This to be able to have one global field only to change when all prices should be changed with the same percentage.

    4. Hi,

      Hopefully I’ve understood you correctly – we’ve just released new plugin version 2.1.0. Now you can set “Use same formula” option to “Yes (with same params)” in plugin settings (in “WooCommerce > Settings > Product Price by Formula > Bulk Settings”), which should solve your task.

      Please give it a try and let me know if that was not it.

  27. Hi
    I really like this little plugin. I tried the free version and it fullfills my needs almost.
    I would like to buy this plugin, but its missing 1 very important feature which is mandatory for me.

    Is there a possibility to set price rounding to next close dezimal? eg 14.48 to 14.50 or 14.44 to 14.40

    My problem is that I would need this functionality / or possible hack rather quickly.

    1. Hi,

      In case if anyone else has similar question – yes, this can be done by setting precision attribute to 1 in [math_round] shortcode, e.g.:

      [math_round precision="1"]x[/math_round]
  28. Does this plugin allow to apply different formulas for different categories? e.g. CAT1 would be x*1.3 and CAT2 would be x*1.45 ???

    1. Hi,

      In case if anyone else needs similar functionality – yes, it’s possible since plugin version 2.1.1. You’ll need to use [if_product_category] shortcode in formula for this, e.g.:

      x[if_product_category slug="cat1"]*1.3[/if_product_category][if_product_category slug="cat2"]*1.45[/if_product_category]

      * There are also similar [if_product_tag] and [if_product_taxonomy] shortcodes available.

  29. hi
    i want buy and use “Product Price by Formula for WooCommerce”
    but i want know some details
    i want use a unique single formula for all products(all product use a one formula)
    but any products use own paramaters for universal formula.
    can i do with this plugin?

    1. hello?!!!!!!!!!!!!!!!

    2. Hi,

      Sorry for not replying earlier. Yes, you can do that, but after you save the parameters, if formula is changed, you have to go through all the products and update the formula. However this is easily fixable – please give me a minute and I’ll add this to the plugin. Will get back to you in a minute.

      Best regards,
      Tom

Leave a Reply

Your email address will not be published. Required fields are marked *

Changelog

2.3.0 - 10/07/2019

  • Fix - Admin columns - PHP notice (for variable products with no prices) fixed.
  • Dev - [if_product_taxonomy] - use_parent_product attribute (defaults to no) added (same in [if_product_category] and [if_product_tag]).
  • Dev - [if_product_taxonomy] - multiple attribute (defaults to no) added (same in [if_product_category] and [if_product_tag]).
  • Dev - [if_user_id] shortcode added.
  • Dev - [if_product_meta] shortcode added.
  • Dev - General - Bulk Settings - Enable for all products - "Disable for product IDs" option added.
  • Dev - General - Bulk Settings - Enable for all products - "Disable for product category IDs" option added.
  • Dev - General - General Settings - "Disable for empty price" option added (defaults to yes).
  • Dev - General - Advanced Settings - "Plugin URLs" option added.
  • Dev - General - Advanced Settings - "Price changes" option added.
  • WC tested up to: 3.6.
  • Tested up to: 5.2.

2.2.1 - 08/04/2019

  • Dev - [product_meta] - convert_to_numeric shortcode attribute added (defaults to yes).
  • Dev - [product_meta] - product_id shortcode attribute added (defaults to current product's ID).
  • Dev - [product_attr] shortcode added.

2.2.0 - 01/04/2019

  • Dev - [option] shortcode added.
  • Dev - [timestamp], [to_timestamp] shortcodes added.
  • Dev - [if_regular_price], [if_sale_price], [if_current_filter] shortcodes added.
  • Dev - [if_product_id] shortcode added.
  • Dev - [product_id] shortcode added.
  • Dev - [if_value] - between and not_between comparison operators (and inclusive attribute) added (i.e. for comma separated pairs).
  • Dev - [if_value] - in and not_in comparison operators added (i.e. for comma separated lists).
  • Dev - [if_value] - Evaluate formula action removed from shortcode's atts and content.
  • Dev - Default Formula - Automatically listing all shortcodes in admin settings.
  • Dev - Tabs and new line symbols are now automatically removed from formula.
  • Dev - Code refactoring.
  • Dev - Admin settings restyled.

2.1.2 - 21/01/2019

  • Fix - [product_meta] - Zero post meta value issue fixed.
  • Dev - [product_meta] - Applying conversion to number for non-numeric values (includes fractions).
  • Dev - [if_value] shortcode added.
  • Dev - [if_product_taxonomy], [if_product_category], [if_product_tag] shortcodes added to settings description (in "Default Formula" section).
  • Dev - Free plugin's version limitation (only ten "price by formula" products enabled at a time) removed (i.e. now unlimited number of "price by formula" products can be added with free version).

2.1.1 - 25/10/2018

  • Dev - [if_product_taxonomy] shortcode added.
  • Dev - [if_product_category] shortcode added.
  • Dev - [if_product_tag] shortcode added.
  • Dev - Maximum number of "price by formula" enabled products in free version increased to 10.
  • Dev - Products list columns - "Formula Enabled" column added.

2.1.0 - 25/10/2018

  • Dev - Use same formula - "Yes (with same params)" option added.
  • Dev - Per Product - Calculation - "Use default formula with individual params" option added.
  • Dev - Per Product - Calculation - Displaying info in case of global override.
  • Dev - Code refactoring.

2.0.0 - 10/10/2018

  • Dev - [product_length] shortcode added.
  • Dev - [product_width] shortcode added.
  • Dev - [product_height] shortcode added.
  • Dev - [product_weight] shortcode added (and %weight% value marked as deprecated).
  • Dev - [product_stock] shortcode added (and %stock% value marked as deprecated).
  • Dev - [product_total_sales] shortcode added (and %total_sales% value marked as deprecated).
  • Dev - [product_meta] shortcode added.
  • Dev - [if_customer_location] shortcode added.
  • Dev - [if_user_role] shortcode added.
  • Dev - [if_time] shortcode added.
  • Dev - [if_date] shortcode added.
  • Dev - [math_round] shortcode added (and "Final price rounding" section marked as deprecated).
  • Dev - [math_ceil] shortcode added.
  • Dev - [math_floor] shortcode added.
  • Dev - [math_min] shortcode added.
  • Dev - [math_max] shortcode added.
  • Dev - Admin Settings - "Products list columns" option added.
  • Dev - Default formula settings moved to separate "Default Formula" section.
  • Dev - "Advanced Settings" subsection added ("Shortcodes prefix", "Price filters priority" options).
  • Dev - Admin settings restyled and descriptions updated.
  • Dev - Major code refactoring.

1.1.0 - 03/10/2018

  • Dev - "Add default settings admin dashboard widget" option added.
  • Dev - "Admin note" option added for each parameter.
  • Dev - "Final price rounding" options added.
  • Dev - "Use same formula for all products (with individual params)" option added.
  • Dev - %weight% special value added.
  • Dev - Hiding "Enabled" option in per product settings if "Enable price calculation by formula for all products" is enabled.
  • Dev - Formulas with no (i.e. zero) parameters are now allowed.
  • Dev - Major code refactoring (special values; version_updated() etc.).
  • Dev - Admin settings minor restyling (and small fixes).
  • Dev - "WC tested up to" added to plugin header.
  • Dev - Plugin URI updated.

1.0.0 - 12/09/2017

  • Initial Release.

Free vs Pro

This plugin is a premium version of free "Product Price by Formula for WooCommerce" plugin.

Free VersionPro Version
Enable for all productsnoyes
Use same formulanoyes
ShortcodesAll except:
  • [if_value],
  • [if_product_id],
  • [if_product_meta],
  • [if_product_category],
  • [if_product_tag],
  • [if_product_taxonomy],
  • [if_regular_price],
  • [if_sale_price].
yes

Prices & Licenses

Single siteUnlimited sites
1 year[buy] $19.99 / year[buy] $29.99 / year
Lifetime[buy] $39.99[buy] $59.99

Installation and Updates

  • Buy the plugin 🙂
  • Download plugin's zip to your computer (you will receive an email with download link, or you can always download the plugin from your account).
  • Go to "Admin Dashboard > Plugins > Add New > Upload Plugin" and browse for downloaded zip file.
  • If plugin is successfully installed - you should see it added to the Plugins list.
  • To keep WPFactory items up to date, please install WPFactory Helper plugin and enter your site key.

Refunds

We want to ensure that you are 100% happy with your purchase, so if you feel the product(s) you purchased are not the best fit for your requirements and you attempted to resolve issues with product's author, we are offering 30 day money back guarantee refund policy.