Created
October 24, 2023 08:07
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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