How to enable more decimals in discounts

Hello,

Is it possible to get more decimals to discount percentages? I tried snippet:

add_filter(
	'hivepress/v1/forms/hp_discounts',
	function( $form ) {
		$form['fields']['percentage']['type']      = 'number';
		$form['fields']['percentage']['decimals']  = 4;
		$form['fields']['percentage']['min_value'] = 0;

		return $form;
	},
	1000
);

Hi,

Unfortunately there’s no easy way to do this because even if decimals are allowed in the form fields, the discount percentage will be rounded anyway in other places within the extension code.

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