rudy
September 29, 2022, 4:12pm
1
Hello,
how to set a minimum price for offers, so vendors cant add a lower price than that? I am trying to use this snippet for a price of 10, but doesnt work ( i used the code that was for listings just change it to offers):
add_filter(
'hivepress/v1/models/offers/attributes',
function( $attributes ) {
if ( isset( $attributes['price'] ) ) {
$attributes['price']['edit_field']['min_value'] = 10;
}
return $attributes;
},
1000
);
yevhen
September 30, 2022, 9:39pm
3
Please try this PHP snippet
add_filter( 'hivepress/v1/models/offer', 'change_offer_price_field' );
add_filter( 'hivepress/v1/forms/offer_make', 'change_offer_price_field' );
function change_offer_price_field($model){
if ( hivepress()->get_version( 'marketplace' ) && get_option( 'hp_offer_allow_bidding' ) ) {
$model['fields']['price']['min_value'] = 10;
}
return $model;
}
3 Likes
rudy
September 30, 2022, 10:41pm
4
Thank you @yevhen
Works perfectly!
system
Closed
October 30, 2022, 10:41pm
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.