WooCommerce Product Price by Formula

WooCommerce Product Price by Formula

Set formula for automatic WooCommerce product price calculation

Description

WooCommerce Product Price by Formula module lets you set formula for automatic WooCommerce product price calculation. Best way to explain how this module works, is to examine an example. Let’s say you want to automatically calculate final product price: you have product which purchase cost is and you always pay $10 fee when buying it. You also want to add 50% profit margin to the final price. In that case the formula for final price calculation would be (x + 10) * 1.50

You can set one formula for all products:
WooCommerce Product Price by Formula - Admin Settings

After that you need to visit product’s edit page, and enable price by formula calculation for current product:
WooCommerce Product Price by Formula - Admin per Product Settings

Then you set default WooCommerce product price to (e.g. 100), and final price on the frontend is changed according to the formula you set earlier (e.g. (100 + 10) * 1.50 = $165):
WooCommerce Product Price by Formula - Frontend

Accessible through:

  • WooCommerce > Settings > Booster > Prices & Currencies > Product Price by Formula

Tested on WooCommerce 4.0.0 and WordPress 5.3.2Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

WooCommerce Booster ModulesWooCommerce PricesWooCommerce Product Price by Formula

#comment>

#comment>

#comment>#comment>#comment>

Leave a Reply Click here to cancel reply.

#comment>

Comments

36 Comments

  1. Cujo February 11, 2020 at 10:16 am#comment>

    Hi,

    I have tried the round options in Price Formats Module Options (round, round up, round down) with different precision values from 1 to 5.
    They do not work.
    I could change P1 in formula and when I refresh the page, it reflects the value changes but not round options.

    Thank you,

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • Cujo February 11, 2020 at 10:44 am#comment>

      Sorry for confusing. The round up and down does not work with large values, 450390 to 450000.

      #comment>#comment>Avatar#comment>

    • #comment>

    • RokasJ February 11, 2020 at 3:36 pm#comment>

      Hi Cujo,

      You can’t round up whole numbers to whole numbers yet, but we have added it to our to do list.

      This module is used to round numbers to decimal points.

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  2. #comment>

  3. Uroš Žagar February 9, 2020 at 12:38 pm#comment>

    Hi,

    can somebody explain how is value writen to database.
    On document export to csv _wcj_product_price_by_formula_param_1 and _wcj_product_price_by_formula_param_2 value in document is date.
    Than i change type of the cell to general and i get 5digit number (43831) Is this ok?
    Export was made via classic woocommerce export and some with wp all export. Same resoult.

    Kind regards,
    M.

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  4. #comment>

  5. jalla January 30, 2020 at 6:29 am#comment>

    Hi
    When I use booster price formula, sorting in not working for prices!
    please help me.

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • RokasJ February 2, 2020 at 5:14 pm#comment>

      Hi Jalla,

      Please contact us directly via email [email protected]

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  6. #comment>

  7. Miha Z. January 8, 2020 at 9:02 am#comment>

    Hi,
    i am using this plugin “Product price by Formula”, but i am also using sinhronisation with suppliers file for price and stock.
    With every sinhronisation price field gets empty value ()

    Is it possible, that this accoures becouse of the plugin?

    Kind regards…

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • RokasJ January 8, 2020 at 6:38 pm#comment>

      Hi Miha,

      Could you expand on how the synchronisation works? Usually Product Price by Formula is applied on top of the price, not actually changing it in the backend so I’m not sure why it would be erased.

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  8. #comment>

  9. carlos January 4, 2020 at 8:11 pm#comment>

    Half a half product, pizza half a half, prevails the price of the most expensive, is it possible this condition? Here in Brazil, the pizzas bought with 2 flavors come at the price of the most expensive pizza … I need a plugin that does this, does it serve? Ex. Pizza Mussarela 15 half Pizza Peperoene 30 other halftotal pizza Price 30, highest half prevailsis it possible in your plugin?
    I would also like to know if I put an additional field on pizza for example bacon if one chooses bacon on half pizza costs 6 if one chooses bacon on whole pizza costs 12

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • RokasJ January 5, 2020 at 11:52 am#comment>

      Hi Carlos,

      Unfortunately that would not be possible yet but we have added it to our todo list.

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  10. #comment>

  11. Aissam Hidoussi November 25, 2019 at 5:38 pm#comment>

    Hello,

    I appreciate if you could add more options to this module in future release:

    1) Set formula for regular_price and on_sale_price
    2) Using special function, I don’t now if this is possible or not, for example, the user define special PHP functions in function.php file and call them in the formula [ calculate_regular_price(x,p1), and calculate_on_sale_price(x,p1) ], where calculate_regular_price and calculate_on_sale_price are customer functions defined in the file function.php

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  12. #comment>

  13. muhammad farhan rafique August 15, 2019 at 11:54 am#comment>

    how to configure sale and regular prices in one formula . i want to show both prices on product page

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • RokasJ August 29, 2019 at 6:01 pm#comment>

      Hi Muhammad,

      Unfortunately that is not possible yet but we have added it to our todo list.

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  14. #comment>

  15. Sven February 22, 2019 at 9:42 pm#comment>

    Hi,

    preliminary questions:

    1.) Does WooCommerce Product Price by Formula work in Woo’s product bundles?
    2.) can I show a formula variable to the customer (e. g. the variable reflects a written agreement on pricing and should appear in invoice)?

    Regards,

    Sven

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  16. #comment>

  17. DJ Porter February 16, 2019 at 2:14 pm#comment>

    Can I calculate the price of other products based on the price of a single base product?

    Ie. Product X = 12

    Product Y = ( Product X ) x 4.5

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • RokasJ February 16, 2019 at 2:48 pm#comment>

      Hi,

      Unfortunately that’s not possible yet but we have added it to our todo list.

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  18. #comment>

  19. Amedix December 17, 2018 at 7:38 am#comment>

    Hi,

    This plugin for Woocommerce is excellent. Congratulations. This module (woocommerce product price formula) is good but it is more perfect if a small addition is made. Adding an exchange rate as a parameter is perfect. Because some products are being purchased with foreign currency instead of local currency.
    It’s the plug-in I’m looking for. I found it as a coincidence. I’m hoping you can help us with making small additions. I’il be on track. Thanks. Good work.

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  20. #comment>

  21. H. Juffri November 19, 2018 at 12:43 am#comment>

    Hello, does this plugin works on variable products? Thank you.

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • RokasJ November 19, 2018 at 1:10 pm#comment>

      Hi,

      It does but you can only set one formula per product yet, meaning that all variations will be calculated the same.

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  22. #comment>

  23. Alexander October 8, 2018 at 4:30 pm#comment>

    Hello Dear module creators!
    I need your help!
    I bought full version of booster plus for online store in Kazakhstan. We had 3 devaluations last years in our Republic, and that’s why our prices in our money precision are too high! I need to round my prices by formula in hundreds and sometimes southand, but can’t do this! Can you give me information, how to do it?
    Thank you beforehands!

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • RokasJ October 8, 2018 at 7:35 pm#comment>

      Hi Alexander,

      You would need to set the “Rounding precision” to 2 for hundreds and 3 for thousands (3 decimals). To display the final price in this precision you would also need to enable “Price Formats” module and set “Number of decimals” to your currency to 2 or 3.

      Best regards,
      Rokas – Support Team

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  24. #comment>

  25. Orcin September 29, 2018 at 2:40 pm#comment>

    There is a kind of serious bug with Product Price by Formula plugin.

    If I create a price formula, for examle x*p1 and p1 is 10 and if I edit any of my products later than activating this plugin, calculation method saves automaticly as “Use values below” in product edit page.

    So, if I will need to change my formula in the future, for example as x-p1, I will need to change all product formulas of edited products manually.

    Because formula in edited products are saved as “x*p1” and there is no bulk reset option.

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  26. #comment>

  27. Daniel April 21, 2018 at 2:38 pm#comment>

    Is there a way to round up to the nearest decimal?

    Eg:

    13.64 to 13.7
    19.92 to 20.0

    Or is there a way to have the values stored as a separate product custom field so that we could manually enter the preferred price in the regular price field?

    Thanks again!

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • Booster Support Team April 23, 2018 at 9:09 pm#comment>

      Hi Daniel,

      1. Custom field – as you can use shortcodes in “Product Price by Formula” formula and/or params, you can for example use Booster’s shortcode (https://booster.io/shortcodes/wcj_product_meta/) to retrieve any custom field’s value.

      2. Rounding – wasn’t possible, but I’ve just added it to the plugin. Please download the development version here – https://booster.io/dev/. You will need to uninstall the old plugin version first (don’t worry your saved settings won’t disappear). If you are a Booster Plus user – please let me know (at [email protected]) your order number, and I will send you the development version for Plus.

      Now in “WooCommerce > Settings > Booster > Prices & Currencies > Product Price by Formula” you will find new “Rounding” options. If I understood you correctly – you need to select “Round up” there, and set “rounding precision” to “1”.

      Please let me know if it’s not working as expected.

      P.S. If you like Booster, please leave us a rating

      Best regards,
      Tom

      #comment>#comment>Booster Support Team#comment>

    • #comment>

    • Marc July 25, 2018 at 1:01 pm#comment>

      Just tried the “new” round function but nothing happens ( I’ve activated global discount at the same time) .

      What i would appreciate the most would be If I could add some parameters to the global discount like :
      PHP-CODE: floor( $newDiscountPrice / 0.05 ) * 0.05;

      We are running a Shop in Switzerland and it’s actually a pain in the ass with the global discount.

      #comment>#comment>Avatar#comment>

    • #comment>

    • Booster Support Team July 28, 2018 at 4:53 am#comment>

      Hi Marc,

      I’ve just tested on my server and rounding options in “Product Price by Formula” module seem to be working fine, however I think I know why you didn’t see any difference. As you mentioned, you also have “Global Discount” module enabled – “Product Price by Formula” makes changes to the price first (i.e. before the “Global Discount”), so price is first rounded by “Product Price by Formula” and only then “Global Discount” is applied. Could that be the reason?

      By the way – as you suggested, I’ve added new rounding options to the “Global Discount” module.

      Hope that helps.

      Best regards,
      Tom

      #comment>#comment>Booster Support Team#comment>

    • #comment>

    #comment>

  28. #comment>

  29. Juan January 25, 2018 at 8:11 pm#comment>

    Is it possible to use a product variable/attribute in the formula? I need to calculate the price according to the weight of the product. The product price field shows the per kg price. If the products weights 3kgs, the final calculated price should be (price per kg)*3

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  30. #comment>

  31. Martin December 3, 2017 at 9:43 pm#comment>

    Hi,
    I am trying to get the product price by formula option to work for me, Could you tell me if the following problem is solvable with this?

    I sell carpets, a product is priced at £10 per sq meter, however it comes on a 4 Metre roll

    If someone buys 2.5 x 4 (10m2) it would cost £100.

    I was thinking the usual price of 10 * 4 with the customer entering in the length of 2.5 in P1??

    Please help, is it maybe not possible with this plugin??

    Many thanks in advance

    With a P1 (length) user defined would work but its saying

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  32. #comment>

  33. Charles Lamb November 29, 2017 at 12:03 am#comment>

    This formula is a good idea but I need to be able to test my profit after calculating a new price. For this there would need to be some if/then/while support to allow iterative calulations based on various tests. Also being able to add parameters that are product fields/variables would be useful. For example an Ebay final value fee is based on 10% of selling price and I dont know the selling price until after your formula has completed. Also can a parameter value be a formula?

    I would pay for this functionality…… can you offer it?

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  34. #comment>

  35. Aashif October 7, 2017 at 5:59 am#comment>

    My formula is x+p1. The value of p1 is 10. After substituting 100 in place of x the final price preview is showing 0.00 instead of 110 and the frontend is unable to display the price. Please provide solution to solve this.

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  36. #comment>

  37. Mac September 2, 2017 at 12:02 pm#comment>

    I will like to see the round up feature so formula prices are rounded to the nearest hundred. E.g 19,925 rounded to 19,900

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

    • Mac September 2, 2017 at 12:44 pm#comment>

      I understand the formula and variable can be overwritten for each product;

      But It’ll be great if just the formula can be edited for each product and each variable obtainable (called) from module setting.
      In this case when a particular variable is changed in module settings it only affects products with that variable in their fomula.

      #comment>#comment>Avatar#comment>

    • #comment>

    #comment>

  38. #comment>

  39. Neil Jones June 13, 2017 at 2:43 am#comment>

    Hi,

    This is a great feature but I think it could be better if you could link it with your product cost of goods module as the base price for the formula from that field.

    Hope it helps.

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  40. #comment>

  41. Tuby February 6, 2017 at 4:41 pm#comment>

    Hello,

    Our offer is: if you buy 3 Products , the product, which cost low is again reduced to 50%.
    How to calculate this ?
    [x+x+{min(x)/2}]

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  42. #comment>

  43. Hemal Patel June 28, 2016 at 3:07 pm#comment>

    How to use percentage in this formula ? Basically i want to add Some percentage as admin fees and add shipping charges to base price ,so how will i use this type of formula?

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  44. #comment>

  45. Suresh June 24, 2016 at 2:22 am#comment>

    how to calculate this ? can you share some example to do this? is there any proper documentation

    Reply to thread

    #comment>#comment>#comment>Avatar#comment>

  46. #comment>

#comment>#comment>#comment>#comment>

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.

This site uses Akismet to reduce spam. Learn how your comment data is processed.