Tagged: commission, coupons, Membership
- This topic has 6 replies, 2 voices, and was last updated 2 years, 1 month ago by
Sangita Support Squad.
-
AuthorPosts
-
-
November 8, 2023 at 10:59 PM #204113
Justin Harrison
ParticipantHi Support, I am having an issue with commissions being calculated properly when an admin coupon is used with vendor products under a membership. I have tested the scenario of identical products with 2 different vendors – one on a membership with an 86% commission, one not on a membership with an 86% commission. I apply an admin created coupon of 10% discount to orders where each contains a single $100 product from the two separate vendors. The end result is a commission of $86 for the non-membership vendor (that is the correct amount which is 86% of $100) and a commission of $77.40 for the membership vendor (that is the incorrect amount which is 86% of $90 which means the commission is calculated after the coupon is applied). Coupons are configured to be on the vendor except when created by the admin. That is indeed working correctly on non-membership vendors, just not on vendors with a membership.
Here is a video documenting this on a test site with everything updated and the only plugins active are MultivendorX, MultivendorX Pro, WooCommerce, My Private Site (to keep private), and User Switching (to allow to jump between admin and vendor): https://www.loom.com/share/01ac8a00cfe24f17974ea017c2b747d9?sid=cbc2a514-7b56-4d64-ae31-b3d50993cf31
Please let me know if you have any questions or how I can help resolve this bug.
-
November 8, 2023 at 11:09 PM #204114
Justin Harrison
ParticipantAs a quick follow up after digging into the code, it looks like the Membership module does not have the following lines in the commission calculation function but this code is from the standard commission calculation function in MultivendorX which would explain the different results during my testing (it doesn’t account for the admin_coupon_excluded setting):
if ($MVX->vendor_caps->vendor_payment_settings(‘admin_coupon_excluded’) && !$order_counpon_author_is_vendor) {
$line_total = $order->get_item_subtotal($item, false, false) * $item[‘qty’];
} -
November 8, 2023 at 11:13 PM #204115
Justin Harrison
ParticipantSorry for blowing up this support ticket, but also realized the $order_counpon_author_is_vendor variable was being set above it too and was left out of the Membership module code:
// Check order coupon created by vendor or not
$order_counpon_author_is_vendor = false;
if ($order->get_coupon_codes()) {
foreach( $order->get_coupon_codes() as $coupon_code ) {
$coupon = new WC_Coupon($coupon_code);
$order_counpon_author_is_vendor = $coupon && is_user_mvx_vendor( get_post_field ( ‘post_author’, $coupon->get_id() ) ) ? true : false;
}
} -
November 9, 2023 at 5:29 PM #204140
Sangita Support Squad
KeymasterHello @Justin Harrison. Thanks for informing and explaining this to us.
I have informed the dev team and we will add a fix for this in our next update. -
November 10, 2023 at 7:47 AM #204163
Justin Harrison
ParticipantThank you. I did make the code change in my dev environment to confirm that adding the code above to the Membership module did fix the commission issue and it did.
-
November 10, 2023 at 12:53 PM #204173
Sangita Support Squad
Keymaster@Justin Harrison Thank you very much for keeping us updated about this. We will add a fix for the issue in our next MultiVendorX Pro update.
-
April 24, 2024 at 9:45 AM #219204
Sangita Support Squad
KeymasterWe have added a fix for this issue in our latest update. Kindly update the MultiVendorX Pro plugin to it’s latest version and check.
-
-
AuthorPosts
- The topic ‘Vendor Commission Not Calculated Correctly with Membership and Admin Coupon’ is closed to new replies.




