Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Subscriptions › Renewal Subscription Commission calculation issues/bug
- This topic has 28 replies, 2 voices, and was last updated 5 years ago by Makers.
- AuthorPosts
- September 14, 2019 at 8:37 am #81550MakersParticipant
Please see image attachment for an example of calculation issue I am having.
The renewal subscription itself is having a calculation issue regarding commissions/withdrawal charges calculating incorrectly. Correct amount is charged to customer during renewal, but calculation goes haywire for commission/withdrawal charges for vendor/admin.
The initial subscription transaction works as expected including commissions/withdrawal charges.
my setup:
I am using the regular stripe payment gateway currently
I have commission set for admin at 10%
I also have Withdrawal Charges set at percent and fixed at 2.9% and .30
Thank you for you help!!
Attachments:
You must be logged in to view attached files. - September 14, 2019 at 9:22 am #81554MakersParticipant
Please see the attached two screenshots. initial and renewal
These are the withdrawal invoice screenshots for the correct initial subscription charge and incorrect renewal charge. These screenshots show the miscalculations and what seems to be happening for the renewal and what the correct initial charge looks like.
Please assist with solving this bug, because it’s a critical feature breaking issue regarding the way subscription renewal commissions work.
Attachments:
You must be logged in to view attached files. - September 14, 2019 at 9:41 am #81561
- September 15, 2019 at 6:44 am #81775
- September 16, 2019 at 8:56 pm #81997MakersParticipant
Hello WC Lovers!
Both automatic renewal subscriptions and manual renewal subscriptions are effected by this bug, but to different extents. Please see my findings below.
Automatic subscription renewal: Vendor should get shipping $, but gets nothing.
Manual subscription renewal by Admin: Commissions go haywire for vendor/admin resulting in vendor/admin receiving wrong commission amount. Vendor should get shipping $, but gets nothing.
Thanks for helping to resolve this issue it is very much appreciated.
- September 18, 2019 at 2:39 pm #82283WCFM ForumMember
Hi,
Please add this code to your site for now. We will take care of this in WCFM Marketplace core next update, 3.2.2. Then you may remove this code.
add_filter( 'wcfm_is_admin_fee_mode', function( $is_admin_fee ) { $wcfm_commission_options = get_option( 'wcfm_commission_options', array() ); $vendor_commission_for = isset( $wcfm_commission_options['commission_for'] ) ? $wcfm_commission_options['commission_for'] : 'vendor'; if( $vendor_commission_for == 'admin' ) $is_admin_fee = true; return $is_admin_fee; }, 500 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- September 18, 2019 at 9:01 pm #82328MakersParticipant
Hi,
So you are aware… The shipping is still not going to the vendor for the renewal as expected with this added code.
However, the code did seem to correct the commission issue so we’re half way there.
Thank you!
- September 19, 2019 at 6:53 pm #82511WCFM ForumMember
Hi,
The shipping is still not going to the vendor for the renewal as expected with this added code.
– As you mentioned in another thread? Simple product shipping added to subscription renewal!
Thank You
- September 19, 2019 at 7:12 pm #82520MakersParticipant
No, it’s a separate issue from what I mentioned in the other thread.
It’s regarding withdrawal for the vendors. They are not getting any shipping $ as expected upon subscription renewal. it works correctly for the initial order, but no shipping $ for renewal. much like the commission bug in this thread how it only was effecting renewals.
Can you add additional code to what you’ve provided above to include shipping?
I appreciate your help very much
Thank you!
- September 21, 2019 at 9:21 pm #82823WCFM ForumMember
OK, we are checking this.
Between, is this also happening if one order contains one subscription form one vendor?
Thank You
- September 21, 2019 at 9:51 pm #82834MakersParticipant
Yes correct, this is happening for a single subscription renewal. No shipping $ upon renewal.
Thank you!!
- September 22, 2019 at 3:27 pm #82942WCFM ForumMember
Can you please show an order’s details and it’s renewal order’s details screenshot?
Thank You
- September 22, 2019 at 7:00 pm #82968MakersParticipant
Please see attached images. The shop name is missing for shipping on the order detail page for the renewal order.
I have also shown the stripe transaction log for both transactions. The Stripe transaction log shows the renewal not getting the shipping money as expected. It’s going to the admin instead of the vendor it appears.
Thank you!
Attachments:
You must be logged in to view attached files. - September 24, 2019 at 9:29 am #83315WCFM ForumMember
HI,
Can you please test this once with latest WCFM Marketplace version, 3.2.2
Thank You
- September 24, 2019 at 9:57 am #83332MakersParticipant
Yes I tested with the latest version 3.2.2 and get the same result. No shipping $ upon renewal order is the problem I’m still having.
Thank you for the help!
- September 25, 2019 at 8:57 pm #83591WCFM ForumMember
OK, we have tested this but not able to generate yet!
Between, we have tested this using WooCommerce Stripe Gateway.
Which payment gateway you are using ?
Thank You
- September 25, 2019 at 9:21 pm #83592MakersParticipant
Yes, we are using the Stripe gateway.
Can you provide a code snippet that might help reinforce your existing code that controls this aspect?
We are not using stripe split pay due to major limitations with WC subscriptions.
Thank you!
- September 26, 2019 at 4:07 pm #83780WCFM ForumMember
Hi,
Can you provide a code snippet that might help reinforce your existing code that controls this aspect?
– We didn’t test this using any additional code, tested with default WCFM Marketplace plugin.
Here is our test process – https://www.loom.com/share/06aa322cbf064126ad8c308da1b89225
Thank You
- September 29, 2019 at 8:45 pm #84370MakersParticipant
Thanks for this video, I appreciate that.
I have sent you an email with a video link also showing my process as well and replicating the issue I’m having. if you’d be able to come to my site it would be very much appreciated, because I’ve not been able to figure out what’s causing it.
Thank you very much!
- September 30, 2019 at 3:35 pm #84526WCFM ForumMember
OK, we are checking that.
Thank you for your cooperation 🙂
- October 11, 2019 at 8:47 pm #86355MakersParticipantThis reply has been marked as private.
- October 14, 2019 at 11:41 am #86768WCFM ForumMember
Well, certainly there is no other subscription plugin for WooCommerce.
IN such case I will suggest you to restrict one vendor products for one order. (https://docs.wclovers.com/tweaks/#single-vendor-checkout)
Thank You
- October 14, 2019 at 9:02 pm #86887MakersParticipant
This solution you’ve provided in the post above doesn’t help my situation, because it’s not relevant to my specific issue unfortunately.
My tests involved only one vendor with only the one subscription.
The issue: Shipping goes to the vendor the first time when a customer first orders, but no shipping money goes to the vendor for the renewal order. The shipping money for the renewal order(s) is going to the admin instead of the vendor.
How can I fix this issue?
Thanks you for your help!
- October 16, 2019 at 11:46 pm #87291MakersParticipant
Hello again,
Please see attached image for explanation of what could be causing the issue I’m having.
The meta data for the subscription renewal order’s shipping is being mixed up with another meta source? For the “vendor_id” it is containing additional meta data and not just the vendor id for the renewal order. Not sure if this is normal?
if not normal is there a way to fix this?
Thank you!
Attachments:
You must be logged in to view attached files. - October 17, 2019 at 12:43 am #87306MakersParticipant
In addition to what I mentioned above in my previous post there is also missing meta data for the item on the renewal order as well? Both _vendor_id and _wcfmmp_order_item_processed isn’t in the item meta data for renewal order. Please see attached image for example.
Thank you for helping!
Attachments:
You must be logged in to view attached files. - October 21, 2019 at 9:34 pm #88111MakersParticipantThis reply has been marked as private.
- October 24, 2019 at 5:28 am #88730MakersParticipant
Hello,
I’ve asked for some help from my developer friend to look further into this issue and they said I can pass this information to you. They’ve been able to isolate what is causing the issue and have replicated it in their own environment.
I’m hoping WC Lovers can implement a fix in the next update?
Here is the trace for first bug. You can copy this block and send to the developer:
———-Begin block——-
In the class WCFMmp_Shipping, function wcfmmp_add_meta_date_in_shipping_package, they set the vendor_id to $package_key, which isn’t a vendor ID:$item->add_meta_data( ‘vendor_id’, $package_key, true );
Later, when calculating commission, in class WCFMmp_Commission, they get shipping data using this function:
$vendor_shipping = $WCFMmp->wcfmmp_shipping->get_order_vendor_shipping( $order );That function then calls this to get vendor id:
$shipping_vendor_id = $order_item_shipping->get_meta(‘vendor_id’, true);Since ‘vendor_id’ was assigned with package_key previously, this result in a string that isn’t vendor ID.
if ( !empty($vendor_shipping) && isset($vendor_shipping[$vendor_id]) && $product->needs_shipping() )That result in this condition is always false in WCFMmp_Commission->wcfmmp_checkout_order_processed.
That’s why the next payments, vendors don’t get the shipping.
———-End block——-Thank you!
- November 5, 2019 at 5:34 pm #90797WCFM ForumMember
We will check this.
- November 20, 2019 at 9:17 pm #93143MakersParticipant
Hello,
I’ve asked for some help from my developer friend to look further into this issue and they said I can pass this information to you. They’ve been able to isolate what is causing the issue and have replicated it in their own environment.
I’m hoping WC Lovers can implement a fix in the next update?
Here is the trace for first bug. You can copy this block and send to the developer:
———-Begin block——-
In the class WCFMmp_Shipping, function wcfmmp_add_meta_date_in_shipping_package, they set the vendor_id to $package_key, which isn’t a vendor ID:$item->add_meta_data( ‘vendor_id’, $package_key, true );
Later, when calculating commission, in class WCFMmp_Commission, they get shipping data using this function:
$vendor_shipping = $WCFMmp->wcfmmp_shipping->get_order_vendor_shipping( $order );That function then calls this to get vendor id:
$shipping_vendor_id = $order_item_shipping->get_meta(‘vendor_id’, true);Since ‘vendor_id’ was assigned with package_key previously, this result in a string that isn’t vendor ID.
if ( !empty($vendor_shipping) && isset($vendor_shipping[$vendor_id]) && $product->needs_shipping() )That result in this condition is always false in WCFMmp_Commission->wcfmmp_checkout_order_processed.
That’s why the next payments, vendors don’t get the shipping.
———-End block——-Thank you!
We’re still having this issue detailed in the thread above since September 14th. Is an update fixing this issue coming soon?
- AuthorPosts
- You must be logged in to reply to this topic.