How to remove price attribute

I noticed this listing requires a price, but the others on my website do not. I tried emptying the field but get this when trying to post.


These are the examples downloaded directly from hivepress.

I just do not want the price and rate to appear twice.

Hi @robrojas,

Use this snippet:

add_filter(
	'hivepress/v1/models/listing/attributes',
	function($attributes){
		if(isset($attributes['price'])){
			$attributes['price']['editable'] = false;
			$attributes['price']['display_areas'] = [];
		}
		
		return $attributes;
	},
	1000
);

Cheers,
Chris :victory_hand:

Awesome Chris! It worked, removed from the profile, thanks!!

As a follow up, would you happen to know how to get rid of this price filter here and just keep the rate filter below?

Hi @robrojas,

Please try this snippet to remove the Price field from the filter section.

add_filter(
	'hivepress/v1/forms/listing_filter',
	function( $form ) {
		unset($form['fields']['price']);

		return $form;
	},
	1000
);

I hope this helps!

Cheers,
Chris :victory_hand:

So awesome! Thanks Chris, that worked!

1 Like

Pleased to hear it, @robrojas!

Hi,

Please note that price is the default field in the Marketplace extension. If you installed Marketplace, the price will always appear for listings since it’s required for processing payments.

Nevertheless, glad that your request is resolved.

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