Home Support Extensions Marketplace Marketplace functionality for one category but not the other in ListingHive

Marketplace functionality for one category but not the other in ListingHive

  • Author
    Posts
  • nlpais

    Hello Igor and team,

    I have three categories in my ListingHive site. One category is ‘Lessons’ which has a price and can be bought through the ‘Buy Now’ button provided through the Marketplace extension.

    The other two categories are ‘Students’ and ‘Teachers’, which serve as a directory more than a marketplace. Is there a way to deactivate the Marketplace functionality for just these two categories, such that there is no Price field or ‘Buy Now’ in the Listing.

    Thanks in advance.
    Nigel

    ihor developer

    There’s no such feature at the moment, but it’s on the roadmap. If it’s urgent please try using this code snippet, replace 1,2,3 with category IDs:

    add_filter(
    	'hivepress/v1/models/listing/fields',
    	function( $fields, $listing ) {
    		if ( array_intersect( [ 1, 2, 3 ], (array) $listing->get_categories__id() ) ) {
    			$fields['price']['required']     = false;
    			$fields['price']['display_type'] = 'hidden';
    		}
    
    		return $fields;
    	},
    	1000,
    	2
    );
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.