The Bookings extension adds the price field to all listings

Hello,

I have one category that is free, but since I added the booking extension it has price like the others.

My settings:

Hivepress configuration > Listings> Selling> categories selected and left out the one I dont want to have price, so it is not selling.

Bookings> Booking Categories> selected the categories that should have booking and left out the one I dont want to have price.

I deactivated plugins and snippet codes and nothing. I deleted and created again the category that should have no price, deactivated and activated again the marketplace extension and saved again the settings. No success.

But when I deactivated the booking extension the price was correctly removed from that category.

This morning I followed the tutorial to improve site with litespeed, but I deactivated the plugin and it didnt change.

Could one of the reccomended settings for litespeed have create this conflict?

Can you help me? I am not sure what I am doing wrong

Thanks

Thanks for the details, this is known restriction with both Bookings and Marketplace extensions when they are enabled at the same time. The Price field is required in this case, but there may be a snippet to keep but hide the price field for specific category IDs, please let me know if this works for you. Also, make sure that there are no booking categories that are not selected in Selling because if both extensions are enabled then bookings rely on marketplace features.

Thank you @ihor

Maybe I can find some work around If I could hide the price for the free listing as you say. It is not a booking, it is a nornal listing.

I would need it to be hidden on the listing block and page, also when the user is submitting the listing the price attribute option should not be there because the user would be creating a free listing.

Is this possible? Thank you

Hi @ihor sorry again, I was thinking if your solution would keep the buy now button on the listing page that was supposed not to be for sale. If so, the buy now button should also be hidden for the free listing as well, otherwise it doesnt work.

Thank you

Please try this PHP snippet. Please change 1,2,3 on the listing categories id where you want to hide the price

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset($attributes['price']) ) {
			$attributes['price']['categories'] = [1,2,3];
		}

		return $attributes;
	},
	1000
);
1 Like

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