To set minimum prices so the sellers can not set any lower than that when they upload their service?

Hi I want to set a minimum price for listings and also input the minimum price into the price field so users don’t have to change it unless they want more

Please try this PHP snippet Set the minimum price for marketplace listings #hivepress #marketplace · GitHub

Thanks yevhen That will work also how do I input my minimum price into price input field so price when creating a listing starts at my minimum price? and how do I change the text “price” to
“hourly rate”

  1. Unfortunately there is no simple code snippet to do it. It will require custom customization

  2. If price is not a custom attribute then please try to use Loco Translate. Here is the tutorial How to translate an extension - HivePress Help Center

1 Like

Thank you

Hi yevhen sorry I was meaning change this text to “Hourly rate”

You could try to use Loco Translate to change this text. Please check HivePress or HivePress Marketplace in Loco/Plugins locations to change this text

1 Like

Hi, I have a similar question regarding the minimum prices.

After setup the minimum prices, how do I display an error message when a user inputs the price value lower than the min price? Because when I do so, it doesn’t return an error message saying that the price value needs to be at least xx or something like that.

Please try to remove Minimum Value for the number attribute and use this PHP snippet. Please change your_attribute_slug text on the attribute slug which you use for the minimum price. This code snippet will show an error when the user try to save the listing and if the minimum price is lower than set in this code snippet (now it is number 5 but you can change it to your requirements)

add_filter(
	'hivepress/v1/forms/listing_update/errors',
	function( $errors, $form ) {
		if($form->get_value('your_attribute_slug') && $form->get_value('your_attribute_slug') < 5){
			$errors[] = 'Attribute value can not be less than 5';
		}
		
		return $errors;
	},
	1000,
	2
);

tryed to target the price tier price here with price_tiers but couldn’t get it to work. Could you help me/us out? :slight_smile:

The price_tiers attribute is a bit more complex, it contains an array of tiers so iterating over this array (e.g. with foreach ) and checking each item price may work.

Awesome that worked but now getting stuck on being able to change the display price can I do this through loco translate? I cannot seem to find the $ symbol to edit to hourly rate $(amount) I changed in inspector for demo with image supplied

If you use WooCommerce please try changing the currency symbol in WooCommerce/Settings section. I also recommend removing the Hourly Rate attribute since it may duplicate the price (if you use Marketplace & WooCommerce the Price field is added automatically).

I’m happy with the symbol “$” being in AUD but I want to add “Hourly rate” to left of $ symbol but can’t figure out how to do it with loco translate .
I was thinking I would be able to go loco translate and translate “$” to “Hourly rate $”

If the Hourly Rate is a custom listing attribute, please edit its display format in Listings/Attributes section, you can make any changes to it, for example:
$%value%

No it’s not a custom listing attribute I just edited it in the inspector for example purpose in the photo above, I would like all listings on platform to say “Hourly rate $” instead of just $

If it is not a custom attribute then please try this PHP snippet Change the price display format for marketplace listings #hivepress #marketplace · GitHub
Please just change %value% / item in this code snippet by your requirements to change the display format of the attribute

1 Like

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