I activate the booking plugin, the quantity option disappears

In the hivepress preferences and ads tab, I check the option for sellers to set the quantity limit for each ad.
I also set the option for buyers to select the desired quantity when booking.
But when a user enters an advert to book it, the quantity does not appear. Only the option to choose the date and then the time of booking appears.
If I deactivate the booking plugin then it appears correctly.
But when I activate the booking plugin again, the quantity option disappears again.
I have installed the hivepress, booking and marketplace plugins.

Please try enabling the Multiple bookings option instead in HivePress/Settings/Bookings section, this should add the Places field (the Quantity option is related to the purchase form and it’s overridden by the booking one).

Thank you yevhen,

Is there a way to get only the quantity option to appear in some categories that I have created?

I say this because in the “courses” category it is great that the option to choose attendees appears, but in the option of “make-up for party” the amount does not have to appear.

Thank you for your advice.

Unfortunately, there is no simple snippet for it. But It is possible to set booking functionality for certain categories in HivePress/Settings/Bookings

Thank you yevhen.
I have solved it as you say, but now I have the following problem.
I want to charge customers who sign up and book only 15% of the price of the published product or service.
But I need a text to appear in front of the price that appears on the screen. Currently it only shows the example price 100$ and I want to put “Your payment is 15%” and then put the 100$.
I have added the following snippet so that I charge using an 85% discount to get it:

add_action('woocommerce_cart_calculate_fees', function() {
	if (is_admin() && !defined('DOING_AJAX')) {
		return;
	}
	
	$percentage = -0.85; // Percentage (85%) in float
	$percentage_fee = (WC()->cart->get_cart_contents_total() + WC()->cart->get_shipping_total()) * $percentage;
 
	WC()->cart->add_fee(__('Discount of 85% of the amount invoiced and charged by the Expert on the day of booking', 'txtdomain'), $percentage_fee);
});

Please help me with the problem, Thanks a lot yevhen for your great help.

Translated with DeepL Translate: The world's most accurate translator (free version)

Unfortunately, there is no simple snippet to do it, it requires custom customization. But as a workaround, you can try this PHP snippet which will add text at the bottom of the booking form

add_filter(
	'hivepress/v1/forms/booking_make',
	function( $form ) {
		$form['footer'] = '<p>Custom text here</p>';
		return $form;
	},
	1000
);
1 Like

Thank you very much yevhen, you are very kind.
I have done so and I have almost solved it. The problem is that I know absolutely nothing about programming and I’m trying to put the text I need to appear in the $form[‘header’] but I can’t get it. I’m looking in tutorials and I’m doing something wrong.
I need the value of the $percentage variable to appear in the $form[‘header’] area but it doesn’t show it.
I have put in code snippets the php code snippet that I have seen in tutorials but I can’t get it.
Please give me some help.
Surely I have made some syntax error.
Thank you.

This is what I have written:

add_action('woocommerce_cart_calculate_fees', function() {
	if (is_admin() && !defined('DOING_AJAX')) {
		return;
	}

	$percentage = -0.85; // Percentage (85%) in float
	$percentage_fee = (WC()->cart->get_cart_contents_total() + WC()->cart->get_shipping_total()) * $percentage;
 	
	
	WC()->cart->add_fee(__('El importe restante descontado IVA no incluido ni gastos de desplazamiento deberan ser abonados al experto y facturados por el mismo en el momento de la prestación del servicio.', 'txtdomain'), $percentage_fee);

});

		add_filter('hivepress/v1/forms/booking_make', function( $form ) { 
		
		$form['footer'] = '<p><h1>El importe de la reserva es del 15% del coste total</h1><br/></p>';
		$form['header'] = $percentage;
		
		return $form;
	
	},
	1000
);

Sorry yevhen I made a mistake.
It is the value of $percentage_fee that I need to appear in the $form [‘header’].

The first part of the php snippet is to get an 85% discount applied and that’s what I want to bill. That works fine.
The only thing I can’t get is to show the $percentage value in the header.
Thanks Yevhen.

Unfortunately, there is no such posibility as this part $percentage_fee = (WC()->cart->get_cart_contents_total() + WC()->cart->get_shipping_total()) * $percentage; works if some items are in cart. In other cases it will show zero. So please try to use some static data to display on $form [‘header’] if it is needed

But when I apply this snippet … I get the price of the ad I add to the cart to be 15% of the total only. Which is my commission only.
This works perfectly for me.

add_action('woocommerce_cart_calculate_fees', function() {
	if (is_admin() && !defined('DOING_AJAX')) {
		return;
	}

	$percentage = -0.85; // Percentage (85%) in float
	$percentage_fee = (WC()->cart->get_cart_contents_total() + WC()->cart->get_shipping_total()) * $percentage;
 	
	
	WC()->cart->add_fee(__('The remaining amount excluding VAT and travel costs must be paid to the expert and invoiced by the expert at the time of service provision.', 'txtdomain'), $percentage_fee);

What I need is to show in the “Header” or “footer” the value of the price of the ad before applying the above discount of 85%.
And that’s why I apply the following snippet text in code snipets …

add_filter('hivepress/v1/forms/booking_make', function( $form ) { 
		
		$form['footer'] = '<p><h1>El importe de la reserva es del 15% del coste total</h1><br/></p>';
		$form['header'] = $percentage;
		
		return $form;
	
	},
	1000
);

but I need it to display the amount and I don’t know how to do it.

Translated with DeepL Translate: The world's most accurate translator (free version)

Sorry, there’s no simple code snippet - this requires advanced customizations. Please consider using a static text notice like “You’ll pay 15% now, and the rest at the property…” using the snippet suggested above.

If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fwd.cx/hLhc73mQCD9R

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