Change Tier Description field

Hey,

Could you please provide a snippet to customise the Description field that’s found as part of setting up Tiers.

E.g when I’m creating a tier, there’s a Title, Price and Description field for each tier. I’d like to change the text inside one of the fields that says Description to Description (optional).

The field is already optional, I just want to make it more obvious for users.

Cheers,
Chris :victory_hand:

Update: It took a few tries, but I got there eventually. In case I want to update this in the future, or if someone else finds it useful, you can use this snippet.

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if(isset($form['fields']['price_tiers']['fields']['description'])){
			$form['fields']['price_tiers']['fields']['description']['placeholder'] = 'Description (optional)';
		}
		return $form;
	},
	1000
);

add_filter(
	'hivepress/v1/forms/listing_submit',
	function( $form ) {
		if(isset($form['fields']['price_tiers']['fields']['description'])){
			$form['fields']['price_tiers']['fields']['description']['placeholder'] = 'Description (optional)';
		}
		return $form;
	},
	1000
);

Cheers,
Chris :victory_hand:

1 Like

Hi @ChrisB,

Thank you for the solution! This will be very helpful for our community.

1 Like

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