Plugin Author
alekv
(@alekv)
Hi @acehobojoe
Could I add this in somehow?
Yes, there’s a filter for this:
https://docs.woopt.com/wgact/#/filters?id=conversion-value-filter
Regards
Aleks
Thank you,
I’ve added it as a snippet.
Plugin Author
alekv
(@alekv)
Hi @acehobojoe
I renamed the filter from wgact_conversion_value_filter to wooptpm_conversion_value_filter.
Your filter with the older filter name will keep working. But I recommend switching to the new one.
After adding this snippet, I get a syntax error related to the “public” function. Is that correct?
add_filter( 'wooptpm_conversion_value_filter', array( $this, 'filter_conversion_value' ), 10, 2 );
public function filter_conversion_value( $order_total, $order ) {
/**
This is 90% of the order value as an estimate
**/
return $order_total * 0.9;
}
Plugin Author
alekv
(@alekv)
Oh, my bad. I should have quickly tested the example…
Following the correct code:
add_filter('wooptpm_conversion_value_filter', 'filter_conversion_value', 10, 2);
function filter_conversion_value($order_total, $order)
{
/**
* This is 90% of the order value as an estimate
**/
return $order_total * 0.9;
}
-
This reply was modified 5 years ago by
alekv.
Thanks Alek, it works now.
I meant to try leaving it on, but I couldn’t get to it til recently.
Plugin Author
alekv
(@alekv)
Great. Thanks for the feedback!