Created
March 13, 2024 12:44
-
-
Save plugin-republic/0fa0a31e30ae48dc3deedd4d47c1192a to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Filter Bookings discount rates | |
*/ | |
function prefix_discount_rates( $rates, $product_id ) { | |
$rates = array( | |
array( | |
'rate' => 3, | |
'after' => 10, | |
'from' => 'all' | |
), | |
array( | |
'rate' => 4, | |
'after' => 30, | |
'from' => 'all' | |
), | |
array( | |
'rate' => 5, | |
'after' => 90, | |
'from' => 'all' | |
) | |
); | |
return $rates; | |
} | |
add_filter( 'bfwc_discount_rates', 'prefix_discount_rates', 10, 2 ); | |
function prefix_discount_type( $type, $product_id ) { | |
return 'perunit'; | |
} | |
add_filter( 'bfwc_discount_type', 'prefix_discount_type', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment