Product Price by Formula for WooCommerce

Rated 5.00 out of 5 based on 2 customer ratings
(2 customer reviews)

Set formula for automatic WooCommerce product price calculation.


Author: Tom Anbinder SKU: N/A Category: Tags: , Version: 2.2.1; Last updated: 1 week ago; Requires WordPress version: 4.4; Tested up to: 5.1


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

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
Use same formula
Enables same formula for all products. Possible values: No; Yes (with individual params); Yes (with same params).
Default: No

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

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

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


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


[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).



[math_floor] – Rounding down (floor).



[math_min] – Min value.


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

[math_max] – Max value.


[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.


[product_meta key="_weight"]

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



[product_stock] – Retrieves product’s stock.



[product_weight] – Retrieves product’s weight.



[product_length] – Retrieves product’s length.



[product_width] – Retrieves product’s width.



[product_height] – Retrieves product’s height.



[product_id] – Product’s ID.


[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.


[product_attr attribute="size"]

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


[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.


[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.


[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.


[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_product_category] – Price by product’s category.


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.


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).


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.


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.


[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_regular_price] – Apply formula to regular product price.



[if_sale_price] – Apply formula to sale product price.



[option] – Site option.


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]

Free vs Pro

Free Version Pro Version
Enable for all products no yes
Use same formula no yes
Shortcodes All except:

  • [if_value],
  • [if_product_category],
  • [if_product_tag],
  • [if_product_taxonomy],
  • [if_product_id],
  • [if_regular_price],
  • [if_sale_price].

Prices & Licenses

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


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.

2 reviews for Product Price by Formula for WooCommerce

  1. Rated 5 out of 5


    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 (product author)

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

  2. Rated 5 out of 5

    Ajay Maharjan

    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 (product author)


      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.

Add a review

46 thoughts on "Product Price by Formula for WooCommerce"

  1. djmfxp January 13, 2018 at 11:19 am #

    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?


    • djmfxp January 15, 2018 at 6:49 pm #


    • Tom Anbinder January 16, 2018 at 10:11 am #


      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,

  2. David March 30, 2018 at 10:48 am #

    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 ???


    • Tom Anbinder October 25, 2018 at 5:02 pm #


      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.

  3. Wolfi June 21, 2018 at 1:05 pm #

    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.


    • Tom Anbinder October 24, 2018 at 10:23 pm #


      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]
  4. gooran July 13, 2018 at 5:51 pm #

    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.


    • Sten Rosendahl October 19, 2018 at 11:12 pm #

      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).

    • Tom Anbinder October 23, 2018 at 3:26 pm #


      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)?

    • Sten Rosendahl October 23, 2018 at 4:02 pm #

      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.

    • Tom Anbinder October 24, 2018 at 10:14 pm #


      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.

  5. Ms September 28, 2018 at 3:18 pm #

    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..


    • Tom Anbinder October 2, 2018 at 9:23 pm #


      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.

  6. Harris Karanikolas December 4, 2018 at 6:11 pm #


    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!


  7. Larry December 29, 2018 at 5:21 pm #

    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!


  8. M F January 10, 2019 at 6:41 pm #

    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?


  9. Ajay January 16, 2019 at 12:11 am #

    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.


    • Tom Anbinder January 16, 2019 at 12:28 am #

      x is what is always replaced by price.

  10. Ajay January 16, 2019 at 1:01 am #

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


    • Tom Anbinder January 16, 2019 at 10:52 am #

      Hi Ajay,

      You just enter it as a standard price.

    • Ajay January 16, 2019 at 11:05 am #

      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?

    • Tom Anbinder January 16, 2019 at 3:17 pm #

      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.

  11. Anish January 25, 2019 at 6:23 am #

    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??


    • Tom Anbinder February 1, 2019 at 12:42 am #


      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).

  12. Neilybob January 25, 2019 at 3:20 pm #

    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.


  13. Soco January 30, 2019 at 8:24 pm #


    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!


    • Tom Anbinder February 3, 2019 at 11:55 pm #


      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)?

  14. erkitcoil February 8, 2019 at 1:50 pm #

    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.


    • Tom Anbinder February 8, 2019 at 2:18 pm #


      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.

    • erkitcoil February 8, 2019 at 6:32 pm #

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

    • Tom Anbinder February 8, 2019 at 7:48 pm #

      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.

  15. Barak Cohen February 17, 2019 at 8:43 am #

    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?
    Thank you in advance,


  16. Dragos February 22, 2019 at 8:27 am #

    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


  17. tommullaneyjr March 1, 2019 at 2:45 pm #

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


  18. SAMUEL MENDEZ March 7, 2019 at 9:31 pm #

    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


    • Tom Anbinder March 7, 2019 at 11:55 pm #

      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:


      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.

  19. Zack April 3, 2019 at 3:38 pm #

    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?


    • Tom Anbinder April 3, 2019 at 5:09 pm #

      Hi Zack,

      Please try:

      [product_meta key="attribute_pa_number-of-prints"]
    • Zack April 3, 2019 at 5:19 pm #

      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?

    • Zack April 3, 2019 at 5:56 pm #

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

    • Tom Anbinder April 3, 2019 at 6:39 pm #

      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]
    • Zack April 3, 2019 at 6:52 pm #

      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)

      [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 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’}

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

    • Tom Anbinder April 3, 2019 at 7:06 pm #

      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 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"]

      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.

    • Zack April 3, 2019 at 7:21 pm #

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

    • Tom Anbinder April 8, 2019 at 3:57 pm #

      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).

Leave a Reply


= 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.


  • 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.