Show Last Offer Price on Requests Listing Page

Hello HivePress Community,
Hope you’re all doing well! I wanted to ask support about our transportation directory. Users can easily make transport requests, and our transporters can then offer their bids to fulfill these requests.

Currently, all transport bid pricings are neatly displayed on the user request page. However, we’re keen on making things even better. We aim to show the last transporter bid price right under all request listings, making it more convenient for everyone.

I’ve highlighted in green the specific area in the screenshot where we plan to replace “Last Transport Bid Price.” We’ve also got the user budget already visible.

Your thoughts and ideas on this are super important to us, so feel free to share any suggestions or comments you may have!

Best,
Dilan.

Hi,

Sorry, there’s no simple code snippet for this, it would require a custom implementation. You would need to create a function that would fetch the last offer and embed it in the template, as well as additional CSS tweaks.

Can you give me litle help for creating this kind of function. Because l am Also looking That feature.

Hello HivePress Team,
I added the following code block to the above file in order to fetch the current request ID and display the Request Title. However, I would like to only display the latest Offer Price. I’m not sure how to achieve this. Can you please provide some guidance?

I also realize that this may not be the correct page to implement this code, so I would appreciate any assistance in adding this code as a snippet or to a child theme. Here is the code I added:

Location:

hivepress-requests/templates/request/view/block/request-attributes-primary.php

Code:

<?php
	// Get the current request ID
	$request_id = get_the_ID ();
 	echo '<p>Post Number:' . $request_id .'</p>';
	?>		

				
<?php 	
	$requests = HivePress\Models\Request::query()->get_by_id($request_id);

	if ( $requests ) {
	// Get the Request Title.
		echo 'Title: ';
		echo $title = $requests->get_title();
	//Get the offer Price 
		echo $lastoffer = $requests->get_price();
		
		
		
	}
?>

Screenshot:

Thank you in advance for your help! @andrii

iDK what kind site you want to build,
i think it doesn’t make sense to show only latest Offer/bidder Price in request list page,
because purpose of request is to showing owners budget,
and i think the request flow is right,
but if u ask to add feature to show request owners budget in range (min-max budget) it make sense…

anyway, hivepress request had a good flow, if you wanna add latest offer price, it saved in comment/meta its good flow so u can retrive it using buildin wp query easily if you want, or you can using hivepress buildin Offer function to get latest price…

Hi,

Sorry, there’s no simple code snippet for this, it would require a custom implementation. Also, we recommend that you do not modify our product files directly, as updates from our side will automatically update them to our version (all your changes will be removed). For changes, we recommend using PHP snippets or a child theme, please check these docs: How to add custom code snippets - HivePress Help Center, How to override template parts - HivePress Help Center. Additionally, note that offers are comments to a post type of hp_request, comment is hp_offer, you can try to customize this using the WP function get_comments.

I believe this will be useful to you.

1 Like

Thank you for your helpful guidance! I was able to successfully build the function using the resources you provided. Your assistance is greatly appreciated. :pray:

1 Like

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