How to remove add image option in request form

Hello,

  1. How to remove add image option in request form
  2. How to add placeholder in location field & title in request form only. (Not in listing form).
  3. Make description optional in request form.
  4. How to edit Request search form?
  5. Request form short code required.
  6. How to add Price field in offer form?
    offer

Hi,

  1. PHP snippet to remove “Add image” option in request form
 add_filter(
	'hivepress/v1/forms/request_update',
	function( $form ) {
		$form['fields']['location']['placeholder'] = 'custom text here';

		return $form;
	},
	1000
);
add_filter(
    'hivepress/v1/models/request',
    function( $form ) {
        $form['fields']['description']['required'] = false;

        return $form;        
    },
    1000
);
  1. If you want to change fields, you’ll need PHP snippets: Search · user:hivepress · GitHub
    If you want to override the whole template, then you’ll need to use HivePress Templates: How to customize templates - HivePress Help Center

  2. Unfortunately, we do not use shortcodes.

  3. It would require custom implementation.

Hope it helps.

Kindly find the attachment

How to get price option? Please explain

Hi,

Sorry for the confusion.

Please enable the Bidding function in the HivePress - Settings - Offers. Then the price field will be available.

Hope it helps.

Hello Again,

Bidding option is already enabled, but still price field option in not activated.
kindly find the attachment.

Hi,

Please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.

Hello,

I did everything, but its dose-not work, please help. & i don’t have caching plugin.
also i deactivate all plugin and checked but nothing is happening.

Please send temporary WP access to support@hivepress.io with details for reproducing this issue and we’ll check it. You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org

Hi,

Sorry for the confusion. This feature doesn’t work because you don’t have the Marketplace extension installed.

1 Like

Any snippet to add additional field on offer form? I have buy this extension because of this function, now you are asking me to buy marketplace? it was not expected. sad life :roll_eyes:

Hi,

Please provide more details. Do you need just add a field to show the price? So, other features of the Marketplace are unnecessary?

Yes, I just want to add Price field as a primary, for my website no use of marketplace.

Please try this PHP code snippet

add_filter( 'hivepress/v1/models/offer', 'add_offer_fields', 1000);
add_filter( 'hivepress/v1/forms/offer_make', 'add_offer_fields', 1000);

function add_offer_fields($model){
	if ( get_option( 'hp_offer_allow_bidding' ) ) {
		$model['fields']['price'] = [
			'label'     => hivepress()->translator->get_string( 'price' ),
			'type'      => 'currency',
			'min_value' => 0,
			'required'  => true,
			'_external' => true,
			'_order'    => 5,
		];
	}
	return $model;
}

add_filter( 
	'hivepress/v1/templates/offer_view_block/blocks', 
	function($blocks, $template){
		$offer = $template->get_context('offer');
		
		if(!$offer){
			return $blocks;
		}
		
		if ( get_option( 'hp_offer_allow_bidding' ) ) {
			return hivepress()->template->merge_blocks(
				$blocks,
				[
					'offer_attributes_primary' => [
						'blocks' => [
							'offer_price' => [
								'type'   => 'content',
								'content'   => '<div class="hp-offer__attribute hp-offer__attribute--price">'.esc_html($offer->get_price()).'</div>',
								'_order' => 10,
							],
						],
					],
				],
			);
		}
		
		return $blocks;
	}, 
	1000,
	2
);

Thank you sir, but what to do for currency symbol?
currency symbol missing

i have concern about my offer look, why its look different compare to yours?

Hi,

Please use this PHP snippet:


add_filter( 'hivepress/v1/models/offer', 'add_offer_fields', 1000);
add_filter( 'hivepress/v1/forms/offer_make', 'add_offer_fields', 1000);

function add_offer_fields($model){
	if ( get_option( 'hp_offer_allow_bidding' ) ) {
		$model['fields']['price'] = [
			'label'     => hivepress()->translator->get_string( 'price' ),
			'type'      => 'currency',
			'min_value' => 0,
			'required'  => true,
			'_external' => true,
			'_order'    => 5,
		];
	}
	return $model;
}

add_filter( 
	'hivepress/v1/templates/offer_view_block/blocks', 
	function($blocks, $template){
		$offer = $template->get_context('offer');
		
		if(!$offer){
			return $blocks;
		}
		
		if ( get_option( 'hp_offer_allow_bidding' ) ) {
			return hivepress()->template->merge_blocks(
				$blocks,
				[
					'offer_attributes_primary' => [
						'blocks' => [
							'offer_price' => [
								'type'   => 'content',
								'content'   => '<div class="hp-offer__attribute hp-offer__attribute--price">$'.esc_html($offer->get_price()).'</div>',
								'_order' => 10,
							],
						],
					],
				],
			);
		}
		
		return $blocks;
	}, 
	1000,
	2
);

Unfortunately, a free theme cannot stylize additional blocks as well as a paid one, because they have completely different designs.

​I hope this is helpful to you.

Thank you for solution, its working perfectly fine now,

I have one question, we have added currency symbol manually in the code, but what if i publish my website in all country? Currency symbol should change automatically right? in both form (request & offer form) is this possible ?

Hi,

Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work https://fvrr.co/32e7LvY

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