WPprodigy / woocommerce-product-fees

Add additional fees at checkout based on products that are in the cart.
https://wordpress.org/plugins/woocommerce-product-fees/
Other
26 stars 19 forks source link

Decimals #57

Open agenceldp opened 3 years ago

agenceldp commented 3 years ago

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

WPprodigy commented 3 years ago

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

agenceldp commented 3 years ago

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

WPprodigy commented 3 years ago

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

agenceldp commented 3 years ago

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

WPprodigy commented 3 years ago

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.

agenceldp commented 3 years ago

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

WPprodigy commented 3 years ago

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

agenceldp commented 3 years ago

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

WPprodigy commented 3 years ago

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.