Affirm Banner | Q2 2024

added by Latoya

Flash sale: Get up to 30% off themes and extensions. Ends April 26 at 3 pm UTC. Shop the sale.
Product Icon

Product Vendors

Trasforma il tuo negozio in un mercato multifornitore

Allow for decimals in comissions

Can you please allow for decimals in commissions of the vendor plugin?

As far as I can see the only thing which should be adjusted is in class-wc-product-vendors-utils.php:164

This line:
return absint( str_replace( ‘%’, ”, trim( $commission ) ) );

should actually be:
return abs( floatval( str_replace(‘%’, ”, trim( $commission ) ) ) );

Autore

Current Status

Closed

Last updated: August 15, 2022

1 commento

Log in to comment on this feature request.

  1. Marco Betschart says:

    Actually it should even be something like the following, to also allow a comma as decimal separator:

    return abs( floatval( str_replace( ‘,’, ‘.’, str_replace(‘%’, ”, trim( $commission ) ) ) ) );