Renewal Subscription Commission calculation issues/bug

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WC Subscriptions Renewal Subscription Commission calculation issues/bug

Viewing 28 reply threads
  • Author
    Posts
    • #81550
      Makers
      Participant

      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.
    • #81554
      Makers
      Participant

      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.
    • #81561
      Makers
      Participant

      My commission and withdrawal settings for reference. please see images attached.

      Attachments:
      You must be logged in to view attached files.
    • #81775
      Makers
      Participant

      Please see attached images. I think this issue is being caused because the vendor store information isn’t being populated upon the renewal subscription order.

      Will you please help us to resolve this?

      Thank you!

      Attachments:
      You must be logged in to view attached files.
    • #81997
      Makers
      Participant

      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.

    • #82283
      WCFM Forum
      Keymaster

      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

    • #82328
      Makers
      Participant

      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!

    • #82511
      WCFM Forum
      Keymaster

      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

    • #82520
      Makers
      Participant

      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!

    • #82823
      WCFM Forum
      Keymaster

      OK, we are checking this.

      Between, is this also happening if one order contains one subscription form one vendor?

      Thank You

    • #82834
      Makers
      Participant

      Yes correct, this is happening for a single subscription renewal. No shipping $ upon renewal.

      Thank you!!

    • #82942
      WCFM Forum
      Keymaster

      Can you please show an order’s details and it’s renewal order’s details screenshot?

      Thank You

    • #82968
      Makers
      Participant

      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.
    • #83315
      WCFM Forum
      Keymaster

      HI,

      Can you please test this once with latest WCFM Marketplace version, 3.2.2

      Thank You

    • #83332
      Makers
      Participant

      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!

    • #83591
      WCFM Forum
      Keymaster

      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

    • #83592
      Makers
      Participant

      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!

    • #83780
      WCFM Forum
      Keymaster

      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

    • #84370
      Makers
      Participant

      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!

    • #84526
      WCFM Forum
      Keymaster

      OK, we are checking that.

      Thank you for your cooperation 🙂

    • #86355
      Makers
      Participant
      This reply has been marked as private.
    • #86768
      WCFM Forum
      Keymaster

      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

    • #86887
      Makers
      Participant

      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!

    • #87291
      Makers
      Participant

      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.
    • #87306
      Makers
      Participant

      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.
    • #88111
      Makers
      Participant
      This reply has been marked as private.
    • #88730
      Makers
      Participant

      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!

    • #90797
      WCFM Forum
      Keymaster

      We will check this.

    • #93143
      Makers
      Participant

      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?

Viewing 28 reply threads
  • You must be logged in to reply to this topic.