1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Pricing
  5. Set field and option prices using formulas
  1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Set field and option prices using formulas

Set field and option prices using formulas

You can set prices for add-on fields and fields options by entering fixed values in the ‘Field Price’ or option ‘Price’ setting. You can also set these prices as a percentage of the main product price. See this article for how to set standard prices for add-on fields.

With the Pro version of the plugin, you can also using formulas to set prices for add-on fields and options. You can add formulas using the same tags that are available in the Calculation field type. For example, you can define field or option prices using formulas based on:

  • The value of another add-on field
  • The price of another add-on field
  • The value of a selected option in another field
  • The number of files uploaded to a field
  • Product dimensions, like weight, height, width, etc

You can also use the calculation field type to set the overall product price. This article specifically covers setting individual field and option prices with formulas.

To use this feature, you first need to enable this feature using the following snippet:

<?php
add_filter( 'pewc_enable_formulas_in_prices', '__return_true' );

Then to set a field price using a formula, just enter the formula in the ‘Field Price’ setting.

Add-on field price formula

To set the price of an option (e.g. in a radio group or select field), just enter the formula in the ‘Price’ setting for that option:

Add-on field options price formula

Was this article helpful?

Related Articles