woocommerce-product-fees icon indicating copy to clipboard operation
woocommerce-product-fees copied to clipboard

Decimals

Open agenceldp opened this issue 3 years ago • 9 comments

Hello,

I'm a french freelance and first of all thank you very much for your plug-in !

I installed the plug-in on a wordpress site and I have a problem. The site in pogress sells goods in consignment. Also, the plugin is used to enter a fee-consignment per product added to the cart.

For example a milk bottle, it is 0.50€ euro deposit.

The total does not take into account the amount of 0.5, is it too small?

How i can cure it ?

Thanks a lot

Julien

agenceldp avatar Jun 30 '21 17:06 agenceldp

Does the store maybe have it set to use comma's as the decimal place? May need to do 0,50 if so.

WPprodigy avatar Jul 01 '21 23:07 WPprodigy

Yes. About the calculation of the products works well. You can find the parameters below :

Options de devise : euro Position de la devise : droite Séparateur milliers : . Séparateur décimal : , Nombre de décimales : 2

agenceldp avatar Jul 02 '21 08:07 agenceldp

Gotcha. So if you enter a fee of 0,50, does it work?

WPprodigy avatar Jul 05 '21 23:07 WPprodigy

Exactly. the settings of the decimals is good but despite everything when i enter a fee : 0.50€ it does not calculate it.

agenceldp avatar Jul 06 '21 07:07 agenceldp

Sorry to keep asking, but I'm still a bit unclear so to clarify - you are using a COMMA when typing in the fee?

A screenshot of the settings area would help as well.

WPprodigy avatar Jul 06 '21 08:07 WPprodigy

When I enter 0,5€ (with a comma) it doesn't work, whereas if I enter 1€, the calculation is done.

Capture d’écran 2021-07-06 à 10 28 56

agenceldp avatar Jul 06 '21 08:07 agenceldp

Hmm, I see. I'm pretty sure something is conflicting with it, perhaps some rounding logic. If you have a test site/staging - trying disabling other plugins except for just WooCommerce & Product Fees. And switch to a default WordPress theme as well.

fee settings cart

WPprodigy avatar Jul 07 '21 04:07 WPprodigy

Really i don't understand, i change the theme and disable all the extensions and despite i don't see the 0,5 fee...

agenceldp avatar Jul 07 '21 08:07 agenceldp

I'm really not sure either then :/. Perhaps take a look at rounding settings / number of decimals, as well as the tax classes you may be applying too fees.

And then this is the simplest distilled version of adding a fee:

add_action( 'woocommerce_cart_calculate_fees', function( $cart ) {
	$cart->add_fee( 'Example Fee', '0.50', false, '' );
}, 15 );

Could put that in your theme's function.php file and see what happens.

WPprodigy avatar Jul 07 '21 16:07 WPprodigy