Commission settings not working correctly – please help!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WC Marketplace Commission settings not working correctly – please help!

Tagged: 

This topic contains 15 replies, has 4 voices, and was last updated by WCFM Forum WCFM Forum 2 days, 5 hours ago.

  • Author
    Posts
  • #66294
    Avatar
    Craig
    Participant

    Hi there – I’m adding to a closed conversation as I have discovered that the solution provided did not work.
    in this thread
    https://wclovers.com/forums/topic/commission-settings-not-working-correctly-please-help/
    you recommended code snipet but I need further assistance.

    My commission settings are intended to recover the paypal fees which in Canada are 2.9%+ $0.30 / transaction:
    So I’m using the “Percent + Fixed” commission setting

    And with the code snippet you provided what appears to be happening is that the “fixed” portion is being doubled.

    See the attached screenshots:

    the transfer to the vendor should have been:
    1.05 – .33 = .72
    2.10 – .36 = 1.74
    3.15 – .39 = 2.76
    total = 5.22
    minus .32
    total transfer = 4.90 paid to recipient
    not 3.99

    it looks like the formula is charging 2 x 0.30 in each transaction?
    because the fees reflected were
    .63 (should be .33)
    .66 (should be .36)
    .69 (should be .39)

    Attachments:
    You must be logged in to view attached files.
  • #66557
    Avatar
    Craig
    Participant

    I’m wondering instead of a code snipet if there can be an option where the commission setting can be applied on a
    “per item” basis
    or “per vendor total” basis

  • #66833
    WCFM Forum
    WCFM Forum
    Keymaster

    HI,

    Please add this line to your site for the purpose –

    add_filter( 'wcfmmp_is_allow_commission_fixed_per_unit', '__return_false' );

    Thank You

  • #68210
    Avatar
    Craig
    Participant

    Hi there,

    This new code did not quite work. it is closer though. I hope you can please help with this.

    It looks like the tax portion of the sale is being captured in the commission because the commission based on the formula and what is actually deducted differs exactly but the tax amount.

    My commission settings are intended to recover the paypal fees which in Canada are 2.9%+ $0.30 / transaction (I have commission sets at 3% + 0.30 see screenshot)
    AND set “tax goes to vendor” (see screenshot)

    $3.15 is 3.00+.15 tax commission should = .39 actually deducted = .54 diff .15 (same amount as tax?)
    $2.10 is 2.10+.10 tax commission should = .36 actually deducted = .46 diff .10 (same amount as tax?)
    $1.05 is 1.00+.05 tax commission should = .33 actually deducted = .38 diff .05 (same amount as tax?)

    Attachments:
    You must be logged in to view attached files.
  • #70189
    WCFM Forum
    WCFM Forum
    Keymaster

    HI,

    $3.15 is 3.00+.15 tax commission should = .39 actually deducted = .54 diff .15 (same amount as tax?)
    $2.10 is 2.10+.10 tax commission should = .36 actually deducted = .46 diff .10 (same amount as tax?)
    $1.05 is 1.00+.05 tax commission should = .33 actually deducted = .38 diff .05 (same amount as tax?)

    – This calculation is right, as “Tax Goes to vendor”, so it’s adding “Tax cost” with calculated commission.

    Now, you may apply commission rule on “Tax Cost” as well by adding this line to your child theme’s functions.php –

    add_filter( 'wcfmmp_is_allow_commission_on_tax', '__return_true' );

    Thank You

  • #70393
    Avatar
    Craig
    Participant

    Hi, thanks for providing your snippets but we have been trying to fix this for over 2 months. and i think the original post message has been lost.

    All I want to do for commission on our site is recover the merchant services costs (we are using paypal)
    PayPal charges 2.9%+0.30 on every transaction total (weather it has taxes, for shipping costs – paypal does not care. they just charge the transaction fee on the total).

    We also have settings that the tax and shipping all go to the vendor.

    Basically our site revenue is membership fees only and to recover the costs of the merchant service fees for “shopping cart transactions” and “payout requests”.

    I’m not confident the code you have provided me is correct. can you please confirm.

    Thanks

  • #70918
    WCFM Forum
    WCFM Forum
    Keymaster

    HI,

    That code is right.

    These two line required to apply commission rule on shipping and tax cost –

    add_filter( 'wcfmmp_is_allow_commission_on_tax', '__return_true' );
    add_filter( 'wcfmmp_is_allow_commission_on_shipping', '__return_true' );

    But, still there will be an issue for commission amount – 2.9% + .3

    Problem will come for “Fixed Part” of the commission rule.

    Fixed part calculated for “per item” basis. So you will see Admin commission is generated 2.9% + .9 (if shipping and tax both are there), or 2.95 + .6 (if only tax or shipping is there)

    Now, if you think tax and shipping will be there for all orders, then set commission rule – 2.9% + .1

    Thank You

  • #81408
    Avatar
    Makers
    Participant

    I would personally welcome something like this as an added feature for commission settings.

    add_filter( ‘wcfmmp_is_allow_commission_on_tax’, ‘__return_true’ );
    add_filter( ‘wcfmmp_is_allow_commission_on_shipping’, ‘__return_true’ );

  • #81411
    Avatar
    Makers
    Participant

    What is the final code solution to this issue? I’ve read through this thread and Craig’s previous thread regarding this issue, but don’t really see a final code snippet solution…

    I’d also like to charge the exact same commission structure that Craig has explained in his previous posts/threads.

    With regards to the .30 fixed portion of the commission once per vendor per order so each vendor that has sold items in a specific order would only be charged once for the .30 fixed portion per order no matter how many items that vendor sold in that specific order. The thinking behind this is, because Stripe and Paypal both charge 2.9% plus .30 per transaction.

    I pieced this code below together from the two threads regarding this issue I could find. Can you please paste a complete code that would accomplish what both Craig and I are explaining? Thank you!

    https://wclovers.com/forums/topic/commission-settings-not-working-correctly-please-help/
    https://wclovers.com/forums/topic/commission-settings-not-working-correctly-please-help-2/

    add_filter( ‘wcfmmp_is_allow_commission_on_tax’, ‘__return_true’ );
    add_filter( ‘wcfmmp_is_allow_commission_on_shipping’, ‘__return_true’ );

    add_filter( ‘wcfmmp_order_item_quantity’, function( $quantity, $product_id, $variation_id, $item_price, $vendor_id, $order_id ) {
    return 1;
    }, 50, 6 );

  • #81419
    Avatar
    Makers
    Participant

    Some initial testing… With one vendor and one product for now… I ran several transaction tests. Commissions set to Percentage and fixed

    When I added the code below to my functions.php file the percentage calculated correctly for everything, but the fixed rate of .30 tripled for some unknown reason.

    add_filter( ‘wcfmmp_is_allow_commission_on_tax’, ‘__return_true’ );
    add_filter( ‘wcfmmp_is_allow_commission_on_shipping’, ‘__return_true’ );

    adding this code below did nothing that I could tell.

    add_filter( ‘wcfmmp_order_item_quantity’, function( $quantity, $product_id, $variation_id, $item_price, $vendor_id, $order_id ) {
    return 1;
    }, 50, 6 );

    This is actually a major issue because these little bits could add up to a whole lot of missing revenue and potentially angry vendors. I feel the community would benefit greatly if you guys were to come up with a comprehensive solution for this issue, because in a micro transaction situation the miscalculations add up very quickly.

    Best Regards

  • #82198
    WCFM Forum
    WCFM Forum
    Keymaster

    Hi,

    You require this code for the purpose-

    function wcfmmp_commission_rule_fix( $commission_rule ) {
    	if( isset( $commission_rule['fixed'] ) ) $commission_rule['fixed'] = 0;
    	return $commission_rule;
    }
    add_filter('wcfmmmp_shipping_commission_rule', 'wcfmmp_commission_rule_fix');
    add_filter('wcfmmmp_tax_commission_rule', 'wcfmmp_commission_rule_fix');

    Thank You

  • #82199
    Avatar
    Makers
    Participant

    Thank you for your response I appreciate this. @Craig might find this code helpful.

    After testing regarding this we’re leaning towards using the commission structure in combination with the withdrawal methods already provided to us with WCFM. Still testing the best methods to be honest.

    Thanks again!

  • #82469
    WCFM Forum
    WCFM Forum
    Keymaster

    You are welcome:)

    Feel free to as me if you have any confusion or queries.

    Thank you and have a great day 🙂

  • #85835
    Avatar
    CommunityCorals
    Participant

    Hello, there are so many code lines that I missed the correct one to solve the issue. I also would like to charge % + fixed to cover paypal fees. I charge my admin commission just on product not on shipping. No tax calculation.

    So what I need: Calculation of fixed part of the commission once per vendor and order.

    What would be the snippet for this please?

    Thanks
    Dominique

  • #85967
    Avatar
    CommunityCorals
    Participant

    I guess I also have to mention that shipping cost goes to admin. Maybe that´s the reason why the presented snippets don´t work for me?

  • #86487
    WCFM Forum
    WCFM Forum
    Keymaster

    HI,

    So what I need: Calculation of fixed part of the commission once per vendor and order.

    – You do not require that code for the purpose. Use this code snippet –

    add_filter( 'wcfmmp_is_allow_commission_fixed_per_unit', '__return_false' );

    Thank You

You must be logged in to reply to this topic.