You could create a copy of your plan then under Integrations > PostAfPro try inputting an invalid affiliate id to see if it'll ignore that commission in PAP since the affiliate id won't be valid.
Alternatively you can try forcing the affiliate id in the basket to something invalid using CB Auto Actions to see if that'd work. Example as follows.
Global
Triggers: onCPayAfterPaymentBasketUpdated
Type: Code
User: Automatic
Access: Everybody
Action
Method: PHP
Code:
Code:
$integrationParams = $vars['var1']->getParams( 'integrations' );
$integrationParams->set( 'postafpro_affiliateid', 'INVALID' );
$vars['var1']->storeParams( 'integrations' );
The CBSubs PostAfPro integration stores the affiliate id on the before basket update trigger. By acting on the after update trigger and overriding it to something invalid it should store that to the basket and send the invalid affiliate id for affiliate tracking to PAP.
You've access to the entire basket from that point (var1). So if you need it to only apply to a basket with a specific coupon you'd have to do that parsing directly in the code, which might work as follows.
Code:
$integrationParams = $vars['var1']->getParams( 'integrations' );
$coupons = $integrationParams->get( 'promotions_coupons', null );
if ( ! $coupons ) {
return;
}
$coupon = array_shift( explode( '|*|', $coupons ) );
if ( ! in_array( 'COUPON_CODE_HERE', $coupon ) ) {
return;
}
$integrationParams->set( 'postafpro_affiliateid', 'INVALID' );
$vars['var1']->storeParams( 'integrations' );