Skip to content

Instantly share code, notes, and snippets.

@hivepress
Last active January 23, 2025 05:51
Show Gist options
  • Select an option

  • Save hivepress/c25a48d50dfeac2ba01512e680aebcf3 to your computer and use it in GitHub Desktop.

Select an option

Save hivepress/c25a48d50dfeac2ba01512e680aebcf3 to your computer and use it in GitHub Desktop.
Make the budget field optional in the request form #hivepress #requests
<?php
add_filter(
'hivepress/v1/models/request/attributes',
function( $attributes ) {
if ( isset( $attributes['budget'] ) ) {
$attributes['budget']['edit_field']['required'] = false;
}
return $attributes;
},
1000
);
@cotasson

Copy link
Copy Markdown

This throws an error (something went wrong) when the vendor makes an offer and it's accepted by the client, even though the vendor has set a price.

@hivepress

Copy link
Copy Markdown
Author

Please describe the steps to reproduce this issue, we tested the snippet with a test request and accepted the offer (creating an order via checkout), no errors were logged

@cotasson

Copy link
Copy Markdown

https://community.hivepress.io/t/commission-rate-set-to-0-throws-an-error/14688/6
(throws an error when a request with not set price, a vendor does an offer, and the customer accepts it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment