Hi Natasha,
thanks a lot, that works fantastic for bundles and single products! You should add that to your documentation, I think it is a helpful piece of code.
I customized it a little bit, here is my code if anyone is interested:
add_filter( 'easy_booking_new_price', 'wceb_set_maximum_booking_price', 99, 4 );
add_filter( 'easy_booking_new_regular_price', 'wceb_set_maximum_booking_price', 99, 4 );
function wceb_set_maximum_booking_price( $price, $data, $product, $_product ) {
$childProductId = $_product->get_id();
$max50EurosProducts = array(51687, 51428, 47201, 43500);
$max100EurosProducts = array(47216);
if (in_array($childProductId, $max50EurosProducts)) {
if ( $price > 50 ) {
$price = wc_format_decimal( 50 );
}
}
if (in_array($childProductId, $max100EurosProducts) ) {
if ( $price > 100 ) {
$price = wc_format_decimal( 100 );
}
}
return $price;
}
Best regards,
Christoph