Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PluginRepublicSupport/003465ed23faf6fde2527bef6a83ccaf to your computer and use it in GitHub Desktop.
Save PluginRepublicSupport/003465ed23faf6fde2527bef6a83ccaf to your computer and use it in GitHub Desktop.
If both Product Add-Ons Ultimate and Fees and Discounts are installed, and "Apply User Role Pricing to add-on field prices" is enabled, you can override this on a per-field basis using the "wcfad_pewc_adjust_field_prices" filter
<?php
add_filter( 'wcfad_pewc_adjust_field_prices', 'custom_wcfad_pewc_adjust_field_prices', 10, 3 );
function custom_wcfad_pewc_adjust_field_prices( $adjust, $item, $product_id ) {
// if field price is a percentage of the product price, do not adjust
if ( $item['field_percentage'] ) {
$adjust = false;
}
return $adjust;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment