Program Custom Condition

Develop your custom condition step-by-step:

  • Download this sample addons.
  • Unzip it and change the files. Note: Use hook “wdp_conditions” to append new condition + load new PHP class and html template.
  • Install changed addon to the site as usually through uploading .zip to the Plugins > Add New tab or copy to the ‘wp-content/plugins’ folder.
    Note: if you need many custom conditions, use one plugin anyway.
  • Create a new rule with the condition section. Find your custom condition name in the list and use it.

For example, there is custom product field “area” (different for each product).

Sample addon embeds new condition to section “Cart Conditions”.
Template custom-template-area-size.php describes supported operations and input for comparable value.

The addon uses method check (class WDP_Custom_Condition_Area_Size) to get total area and compare with defined value.