1. Home
  2. Knowledge Base
  3. WooCommerce Product Add-Ons Ultimate
  4. Zero value for missing fields
  1. Home
  2. Knowledge Base
  3. Field Types
  4. Calculations
  5. Zero value for missing fields

Zero value for missing fields

If you include a tag in your calculation formula for a field that doesn’t exist on the page, the calculation will normally return an empty value.

This means that if you have a formula like {field_123} + {field_456} you’ll only get a result if you have fields with the IDs 123 and 456 present on the page.

However, you might prefer the calculation to ignore a field if it’s not present and still return a value for those fields that are present. To enable this, go to WooCommerce > Settings > Product Add-Ons > Calculations and check the ‘Zero value for missing fields’ option.

The benefit of this option is that it allows you to create a single global calculation field which includes values for multiple fields, not all of which might be present on a single product.

Was this article helpful?

Related Articles