I would like to set it so that I cannot make an offer if the amount is lower than the amount set in the Requests. How can I do this?
For example, I have a Requests for $500, and I cannot make a Request for $400. However, if it is $500 or more, I can make a Request.
I am sorry to trouble you, but I would appreciate it if someone could enlighten me.
Please try this PHP snippet
add_filter(
'hivepress/v1/forms/offer_make/errors',
function( $errors, $form ) {
$request = HivePress\Models\Request::query()->get_by_id( $form->get_value('request') );
if($request && hivepress()->get_version( 'marketplace' ) && get_option( 'hp_offer_allow_bidding' ) && $request->get_budget() && $request->get_budget() > $form->get_value('price')){
$errors[] = 'The offer price should be equal to or more than '.$request->get_budget();
}
return $errors;
},
1000,
2
);
2 Likes
system
Closed
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.