Skip to content

Instantly share code, notes, and snippets.

@bentasm1
Last active March 9, 2020 06:22
Show Gist options
  • Save bentasm1/d0b30c43475faf87434fb39dccb40e85 to your computer and use it in GitHub Desktop.
Save bentasm1/d0b30c43475faf87434fb39dccb40e85 to your computer and use it in GitHub Desktop.
WC Vendors Pro -- Require a minimum, and a maximum price for vendors when adding/editing a product
/* WC Vendors Pro -- Require a minimum, and a maximum price for vendors when adding/editing a product */
add_filter( 'wcv_product_price', 'price_min_max' );
function price_min_max( $args ){
$args[ 'custom_attributes' ] = array(
'data-rules' => 'decimal|range[1,20]',
'data-error' => __( 'Price should be a number and between $1 and $20', 'wcvendors-pro' )
);
return $args;
}
@marwah1212
Copy link

if for the sale price
how to limit selling prices for vendors?

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