Hello!
I have used the bellow code snippet to disable price on some specific subcategories, but it seems that it does not apply to all of them. I still see the field within the listing.
add_filter(
'hivepress/v1/forms/listing_update',
function( $form_args, $form ) {
// Categories where field should be hidden.
$categories_id = [ 43, 53 ];
$listing = $form->get_model();
if ( isset( $form_args['fields']['price'] ) && array_intersect((array)$listing->get_categories__id(), $categories_id) ) {
unset($form_args['fields']['price']);
}
return $form_args;
},
1000,
2
);
Second, I would like to hide the filter and sort by price option for this specific categories where I have disabled it as a field.