Bestseller Documented

Product Price by Formula for WooCommerce

(8 customer reviews)

From: $19.99 / year

Set formula for automatic WooCommerce product price calculation.

$19.99 Single site1 year of updates and support30-day money-back guaranteeBuy
$29.99 Unlimited sites1 year of updates and support30-day money-back guaranteeBuy
$59.99Unlimited sitesLifetime updates and support30-day money-back guaranteeBuy
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.

8 reviews for Product Price by Formula for WooCommerce

  1. Stijn van der Pol (verified owner)

    Does this only calculate prices for simple products? Or also for product variations of variable products?

  2. Martin Wolff

    Hey, I got a pre buy question as well: Would it be possible to calculate a categories or products average price for the last 30 days or the last year? A client of mine wants such a feature in his marketplace and I have no idea how to realise that…

  3. jon

    I think your product is the right one for me and think I should buy it but can’t seem to get it working.

    We sell roller blinds so product price depends on the width and drop of the blind. This is entered by the customer.

    I have already added these field (i.e. width and drop) using the “extra product option plugin” and have the fields named as width and drop on the front end.

    What I can’t seem to do is link these fields to the formula in your plugin.

    I have called p1 [width] and p2 [drop] and have just for a test tried the formula p1*x. I was hoping it would pick up the value of the width entered by the customer but I probably have this completely wrong.

    I get the message Error in $p1*$x formula: Undefined Value [width].

    So the actual width is entered by the customer on the product page and is not a fixed unit. Is this something that your plugin can work with. In other words can it respond to user input on the [product page and if so would you please tell me how so I can test this before I buy it.

  4. Ramiro Iriñiz

    Hi this is a PRE BUY question.
    We are using DIVI THEME with WOOCOMMERCE and we would like to know if this plugin let us make this kind of formulas.
    – PRODUCT PRICE / 10
    – PRODUCT PRICE with 10% discount.

    How should we put this Result Variables in the PRODUCT PAGE?
    With SHORTCODE?

    Thanks

  5. Slavcho Georgiev

    I ask support if the plugin have very specific functionality that I need.

    I got an answer that it can be added to next release and 24 hours later that next release was available to download!!!

    Thank you!!!

  6. masterez

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

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

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

Changelog

2.3.2 - 26/09/2019

  • Dev - Shortcodes - [if_date] - Shortcodes are now processed in attributes.
  • Dev - Shortcodes - [product_date] shortcode added.
  • Dev - Code refactoring.

2.3.1 - 24/09/2019

  • Dev - [product_meta] - use_parent_product attribute (defaults to no) added (same in [product_weight], [product_length] and all other shortcodes that use product_meta()).
  • WC tested up to: 3.7.

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

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.