I would like to limit the maximum allowed number of Tiers for a listing to 3.
Ideally, I would like it to be impossible for the vendor to even create more than 3 tiers when submitting and updating a listing, but if it’s not possible, I would still like the form to show an error if the vendor tries to submit a listing with more than 3 levels of tiers.
How can I achieve this?
add_filter(
'hivepress/v1/forms/listing_update/errors',
function ($errors, $form){
if(count((array)$form->get_value('price_tiers')) > 3){
$errors[] = 'Please set no more than three price tiers';
}
return $errors;
},
1000,
2
);
P.S. If you purchased a theme or extension, please enter the license key in the forum profile settings, this will enable the Premium Support badge and ensure a 24-hour turnaround time.
Hi, thank you for the solution.
About the Premium badge, I added my license keys yesterday and nothing happened. Is it possible the premium support is only valid for a certain period of time? Mine is older than a year.