Hello all
I have a Word Press site I'm trying to tinker with at the moment but we're having trouble with one of our filters...
To briefly explain, we have a booking calender on our site that calculates booking on a per-day basis, we don't want it to do this and instead want it to use the Regular Price as setup on the product.
In short, we're adding the below filter to our functions.php file:
Now, it does what it's meant to do, in the sense of removing the calculation from the calender, and when you add the item to the cart it displays the correct Regular Price, however the problem we have now is that where it would normally show the calculated price per-day, it now just shows £0.00....
Can anyone think of how to counteract this? Or if anything just get that part of the page removed/amended to only show the set price? Might be a long shot
Hope someone can shed some light, the original option was to add the code below in the spoiler tags, but this completely borks the product page and removes the pop-up calender all together along with the cart button:
Thanks all
I have a Word Press site I'm trying to tinker with at the moment but we're having trouble with one of our filters...
To briefly explain, we have a booking calender on our site that calculates booking on a per-day basis, we don't want it to do this and instead want it to use the Regular Price as setup on the product.
In short, we're adding the below filter to our functions.php file:
add_filter('easy_booking_get_new_item_price', 'easy_booking_remove_price_calculation', 10, 4);
{
// Product price (Regular or sale)
return $price;
}
Now, it does what it's meant to do, in the sense of removing the calculation from the calender, and when you add the item to the cart it displays the correct Regular Price, however the problem we have now is that where it would normally show the calculated price per-day, it now just shows £0.00....
Can anyone think of how to counteract this? Or if anything just get that part of the page removed/amended to only show the set price? Might be a long shot

Hope someone can shed some light, the original option was to add the code below in the spoiler tags, but this completely borks the product page and removes the pop-up calender all together along with the cart button:
add_filter('easy_booking_get_new_item_price', 'easy_booking_remove_price_calculation', 10, 4);
function easy_booking_remove_price_calculation( $booking_price, $product, $_product, $duration ) {
$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
$price = $tax_display_mode === 'incl' ? $_product->get_price_including_tax() : $_product->get_price_excluding_tax(); // Product price (Regular or sale)
return $price;
}
function easy_booking_remove_price_calculation( $booking_price, $product, $_product, $duration ) {
$tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
$price = $tax_display_mode === 'incl' ? $_product->get_price_including_tax() : $_product->get_price_excluding_tax(); // Product price (Regular or sale)
return $price;
}
Thanks all