How to remove the /night or /day on the listing

how do Iremove the /night or /day on my listings. I sell retreats, prices should be and are per retreats not per day or night. After I install the Bookings Extension, this shows on every listing, which is not correct. See image. I want to eliminate that.

Thanks

Hi @Mau,

You can customise the /night text using the Loco Translate plugin.

Follow the example given in the video linked above, but inside Loco Translate, select the HivePress Bookings plugin. Be careful to select the same set-up options shown in the video to ensure your custom text is displayed on the front end. Then search for string you’d like to change “night” and in the box below you can enter your preferred text. Like so:

I hope this helps!

Cheers,
Chris :victory_hand:

Hi ChrisB,

thanks for you replay.
I what I meant was, I don’t want anything to show, but just the price. Is there a CSS way not to show it?

Thanks

Hi @Mau,

You can try this PHP snippet to remove the / night part:

<?php
add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset( $attributes['price'] ) ) {
			$attributes['price']['display_format'] = '%value%';
		}

		return $attributes;
	},
	1000
);

Cheers,
Chris :victory_hand:

appologies my ignorance, but where do I add it, to which file?

Hi @Mau,

See this article on how to add each type of snippet:

Basically, use this plugin to add the code snippet above.

Note: when you’re entering a PHP snippet in the Code Snippets plugin; you don’t need to add “<?php” at the beginning of the snippet, as the plugin does this for you.

There’s other ways to add the snippet, but this approach is easiest for non-coders, and makes it easy to undo or update in the future.

Cheers,
Chris :victory_hand:

hi, thanks. I tried it but didn’t work. can’t understand why

Hi,

Please try this code snippet. Keep only “%value%” and remove “/ night” part.

This one should do the trick.

P.S. Please note that we have to move this topic to the Bookings forum category. Since it’s related to a premium extension, the forum category is restricted — please add the license key to the account settings or consider renewing support if you still need assistance related to the premium themes or extensions Renew Support | HivePress

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