Booking Price Calculation Bug

Hi,

We have a problem with the calculation of price in booking, it have a default value.

For example we have a listing like this:

It have a price of 50€ hour.

When I book for one hour, it appears like this on booking:

This value is an old price value.

I explain, I deactivated all plugins and custom code, and the bug still happens.

For example when I deactivate Booking plugin and I apply Buy now of the same listing, 50€ hour, I go to woocommerce checkout and appear correct, 50€ to pay:

I activate Booking plugin again and book for one hour, it will appear correct 50€ on price:

When I go to other listing and book it, it will have the 50€ on price even if is different, it block this value on price forever, is not changing even if I change the listing.

As you can see I book a gig for one hour, it should refresh to the value of this new booking 750€, but it have the old value of the old booking.

Hope it is clear for you, any question tell me please.

Regards

Hi,

Please send temporary WP access to support@hivepress.io with details for reproducing this issue, and we’ll check it (please send only the link, without login and password). You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org.

Hi,

I gave access to support@hivepress.io for three days, can you check if you find the problem?

Regards,
Bernardo Barradas

Hi,

Unfortunately, we did not receive a temporary link to our email, please check and resend.

Hi,

Sent again.

Regards.

Hi,

Unfortunately, we did not receive a temporary link to our email. Please make sure that you send links manually, as automatic ones may not be received.

Hi,

Sent manually.

Regards.

Hi,

We have checked this issue and everything is working correctly on our side, so we could not reproduce it locally. Most likely, this is due to customization of the theme or child theme files directly. Also, there may be caching on the part of the hosting provider. I recommend checking this in more detail.

Hello Andrii,

I cannot find the problem anyway, I removed my child theme, I changed to another theme without my code and I’m having the same problem.

I’m testing in local so is not problem of the server provider the problem is still happening.

It seems there is happening some conflict between Woocommerce and Hivepress, if I make the book and advance to paying but don’t pay because the problem is only in booking page, the value of price in booking is updated with the correct value, it seems that this field price booking is only updated if I go to paying first, thats weird.

I tryed another approach, I installed a fresh installation of Taskhive with theme and all plugins, but this field Price is not appearing on booking, do you know what I need to it appears?

Another way we can solve this is using a snippet and make the calculation ourselves and updated the value manually, can you provide me this snippet?

Hope we find a solution to this, if not I will have to hide this field.

Regards

Hi,

Any news about this?

Regards

Hi,

I have been checking on my website, and on booking, the price field is missing, did you changed anything?

Regards

Thank you for waiting. The price field in the booking confirmation form is still present. The bug with the price field is quite complex, so we have several options to fix this issue which we will check today. So we hope this issue will be solved today

Hi,

I tried to use this code snippet without success:

add_filter( 
	'hivepress/v1/models/listing/cart', 
	function ( $cart, $listing ) {
		if ( ! isset( $cart['meta']['booking'] ) && hivepress()->booking->is_booking_enabled( $listing ) ) {

			if ( isset( $cart['args']['_quantity'] ) && get_option( 'hp_booking_enable_quantity' ) ) {
				$cart['meta']['quantity'] = absint( $cart['args']['_quantity'] );

				unset( $cart['args']['_quantity'] );
			}

			list($start_time, $end_time) = hivepress()->booking->get_booking_times( $cart['args'], $listing );

			if ( $start_time && $end_time ) {

				$cart['args']['_quantity'] = hivepress()->booking->get_booking_quantity( $start_time, $end_time, $listing );
				$cart['meta']['price'] = hivepress()->booking->get_average_price( $start_time, $end_time, $listing );
			}
		}

		return $cart;
	}, 
	1000, 
	2 
);

Anyway, the bug is on page make-booking/details/ the price field is not getting the correct field.

How can I hide this field price?

Regards

Thank you for waiting. Please try this PHP code snippet to hide the price field.

add_filter(
	'hivepress/v1/forms/booking_confirm',
	function($args){
		unset($args['fields']['_price']);
		
		return $args;
	},
	1000
);

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.