Join our new community forum for support & discussion

Join Now

Home Support Extensions Marketplace Pricing is required field – why?

Pricing is required field – why?

  • Author
    Posts
  • GoParkPlay

    After installing this extension it is requiring us to put in a price for our listings. This is a bit awkward as some of our listings are free places like a Park or a Playgrounds. Is there a way to disable this?

    serhii developer

    Please try using this PHP code snippet

    add_filter(
    	'hivepress/v1/models/listing/attributes',
    	function( $attributes ) {
    		if ( isset( $attributes['price'] ) ) {
    			$attributes['price']['edit_field']['required'] = false;
    		}
     
    		return $attributes;
    	},
    	1000
    );
    artshareco

    Hi. I’ve got the same question. Some of the listings in my website are free and I want to deactivate the price attribute for some of them. Did that code snippet work?

    ihor developer

    If you use the marketplace extension then yes, if you add this code snippet then the price field will be optional. If the price is not set then it’s hidden on the listing page.

    artshareco

    Ok. I’ve copied the code snippet above to hivepress-marketplace.php in the plugin editor and it works; price is now an optional attribute. However, the box in which the price attribute appears can still be seen (even though it’s empty). Is there any way of getting rid of that box when no price value is entered?

    ihor developer

    Sorry for the late reply.

    Hiding this field would make all listings free without a choice, if you leave this field then sellers can leave it empty if they want to hide the Buy Now button. Please don’t edit the plugin files directly, because any update will erase changes. You can keep custom PHP snippets using this plugin https://wordpress.org/plugins/code-snippets/

Viewing 6 posts - 1 through 6 (of 6 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.