Shipping goes to Admin amount not declared as fee

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!

Viewing 12 reply threads
  • Author
    Posts
    • #68732
      CommunityCorals
      Participant

      Hi,

      The admin commission that is shown to the vendor is excluding the shipping amount. If setting is “Shipping goes to admin” the shipping amount needs be added to the fee amount as shipping amount is deducted from vendors total order amount.

      Thanks
      Dominique

    • #68733
      CommunityCorals
      Participant

    • #69012
      WCFM Forum
      Member

      HI,

      If setting is “Shipping goes to admin” the shipping amount needs be added to the fee amount as shipping amount is deducted from vendors total order amount.

      – But in that case vendor’s total order cost shown without Shipping Cost.

      Thank You

    • #69029
      CommunityCorals
      Participant

      That´s exactly the issue. You should change that or implement an additional “shipping goes to admin config”. Do you really have a customer where the vendor sells the products and the admin sells the shipping to a customer? So Customer would receive two seperate invoices one for products from vendor and one from admin for shipping? That doesn´t make sense.

      In my mind correct setup is: Vendor sells products and shipping to the customer. And admin sells shipping to vendor. Admin deducts the total order amount by admin commission and shipping at withdrawal.

      This is be very important topic. What do you think?

      BR
      Dominique

    • #69738
      WCFM Forum
      Member

      Hi,

      So Customer would receive two seperate invoices one for products from vendor and one from admin for shipping?

      – Off course not, Store Invoice does not consider this commission condition. Shipping will be part part vendor’s store invoice.

      But, vendor’s shipping should be enabled, otherwise vendor wise separate shipping package will not generate.

      Thank You

    • #69747
      CommunityCorals
      Participant

      I think that is actually the problem. In the scenario where zone wise shipping is enabled and shipping goes to admin, admin does not make any revenue and just generates commission. This is financially not correct. Vendor does not have any document for cost of shipping. Please let me know if you guys plan to provide a correct financial documentation for this setting because this is a legal issue I am facing and a justified point of complaint for several of my vendors.

    • #70129
      CommunityCorals
      Participant

      Hi, I added the informations that are required to make all financial flows and fees transparent in a graphic. I hope this helps to understand what kind of information would be very very valuable to all involved parties.

      Looking forward to your response.

      Thanks
      Dominique

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

      HI,

      OK, so want to show “Admin commission” part under vendor’s order detail and invoice.

      As I remember, we had created code for this. You are not using that code anymore?

      Thank You

    • #70334
      CommunityCorals
      Participant

      Hi,

      yes, I am using below snippet. Unfortunately we never finalized it so it does not completly cover the requirement I posted before.

      add_filter( ‘wcfm_order_details_shipping_line_item’, function( $is_allow ) {
      if( !defined(‘DOING_AJAX’) ) {
      $is_allow = true;
      }
      return $is_allow;
      }, 50 );

      add_action ( ‘wcfm_order_totals_after_total’, function( $order_id ) {
      global $WCFM, $wpdb, $WCFMmp;
      remove_action ( ‘wcfm_order_totals_after_total’, array( $WCFM->wcfm_marketplace, ‘wcfmmp_order_total_commission’ ) );

      $admin_fee_mode = apply_filters( ‘wcfm_is_admin_fee_mode’, false );
      $vendor_id = $WCFM->wcfm_marketplace->vendor_id;
      $gross_sale_order = $WCFM->wcfm_vendor_support->wcfm_get_gross_sales_by_vendor( $vendor_id, ”, ”, $order_id );
      $order = wc_get_order( $order_id );
      $order_currency = $order->get_currency();

      $sql = ”
      SELECT SUM(commission_amount) as line_total,
      SUM(item_total) as item_total,
      SUM(item_sub_total) as item_sub_total,
      SUM(shipping) as shipping,
      SUM(tax) as tax,
      SUM( shipping_tax_amount) as shipping_tax_amount,
      SUM( refunded_amount) as refunded_amount
      FROM {$wpdb->prefix}wcfm_marketplace_orders
      WHERE order_id = ” . $order_id . ”
      AND vendor_id = ” . $vendor_id . ”
      AND is_refunded != 1″;
      $order_due = $wpdb->get_results( $sql );
      if( !$order_due || !isset( $order_due[0] ) ) return;

      $total = 0;
      $calculated_total = 0;
      $refund_total = 0;

      $total = $order_due[0]->line_total;
      $calculated_total = $order_due[0]->item_total;
      $calculated_total += ( float ) $order_due[0]->tax;
      $calculated_total += ( float ) apply_filters( ‘wcfmmmp_gross_sales_shipping_cost’, $order_due[0]->shipping, $vendor_id );
      $calculated_total += ( float ) $order_due[0]->shipping_tax_amount;
      $refund_total = $order_due[0]->refunded_amount;
      if ( $get_shipping = $WCFMmp->wcfmmp_vendor->is_vendor_get_shipping( $vendor_id ) ) {
      $total += ( float ) $order_due[0]->shipping;
      }
      if ( $get_tax = $WCFMmp->wcfmmp_vendor->is_vendor_get_tax( $vendor_id ) ) {
      $total += (float) $order_due[0]->tax;
      if( $get_shipping ) {
      $total += ( float ) $order_due[0]->shipping_tax_amount;
      }
      }

      $tax_percent = 19;
      ?>
      <?php if( !$admin_fee_mode ) { ?>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Line Total’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php if ( $WCFMmp->wcfmmp_vendor->is_vendor_deduct_discount( $vendor_id ) ) { echo wc_price( $order_due[0]->item_total, array( ‘currency’ => $order_currency ) ); } else { echo wc_price( $order_due[0]->item_sub_total, array( ‘currency’ => $order_currency ) ); } ?></div>
      </td>
      </tr>
      <?php } ?>
      <?php if ( $get_tax ) { ?>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Tax’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( $order_due[0]->tax, array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <?php } ?>
      <?php if ( $get_shipping ) { ?>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Shipping’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( apply_filters( ‘wcfmmmp_gross_sales_shipping_cost’, $order_due[0]->shipping, $vendor_id ), array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <?php if( $get_tax ) { ?>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Shipping Tax’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( $order_due[0]->shipping_tax_amount, array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <?php } ?>
      <?php } ?>
      <?php if( apply_filters( ‘wcfm_is_allow_gross_total’, true ) ) { ?>
      <tr class=”total_cost”>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Gross Total’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”>
      <?php
      if( $refund_total ) {
      echo “” . wc_price( $calculated_total, array( ‘currency’ => $order_currency ) ) . ““;
      echo “<ins>” . wc_price( $gross_sale_order, array( ‘currency’ => $order_currency ) ) . “</ins>”;
      } else {
      echo wc_price( $gross_sale_order, array( ‘currency’ => $order_currency ) );
      }
      ?>
      </div>
      </td>
      </tr>
      <?php } ?>
      <?php if( $refund_total ) { ?>
      <tr>
      <td class=”label refunded-total” colspan=”2″ style=”text-align:right;”><?php _e( ‘Refunded’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total refunded-total” style=”text-align:center;”>-<?php echo wc_price( $refund_total, array( ‘currency’ => $order_currency ) ); ?></td>
      </tr>
      <?php } ?>
      <?php
      if( apply_filters( ‘wcfm_is_allow_view_commission’, true ) ) {
      if( $admin_fee_mode ) {
      $total = $gross_sale_order – $total;
      if ( !$get_shipping ) {
      $total += ( float ) $order_due[0]->shipping;
      }
      $tax_amount = ($total/100)*19;
      ?>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Net Fees’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( ($total-$tax_amount), array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php echo __( ‘Tax’, ‘wc-frontend-manager’ ) . ‘ (‘.$tax_percent.’%)’; ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( ($tax_amount), array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Total Fees’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”>
      <?php
      echo wc_price( $total, array( ‘currency’ => $order_currency ) );
      ?>
      </div>
      </td>
      </tr>
      <?php
      } else {
      $tax_amount = ($total/100)*19;
      ?>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Net Earning’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( ($total-$tax_amount), array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php echo __( ‘Tax’, ‘wc-frontend-manager’ ) . ‘ (‘.$tax_percent.’%)’; ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( ($tax_amount), array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <tr>
      <td class=”label” colspan=”2″ style=”text-align:right;”><?php _e( ‘Total Earning’, ‘wc-frontend-manager’ ); ?>:</td>
      <td class=”total” style=”text-align:center;”>
      <div class=”view”><?php echo wc_price( $total, array( ‘currency’ => $order_currency ) ); ?></div>
      </td>
      </tr>
      <?php
      }
      }
      }, 9 );

    • #70336
      CommunityCorals
      Participant

      Hi,

      below I made some screenshots of order view based on different settings.

      – If Commission view not active shipping is not part of order total (As it goes to admin I guess)
      – If Commission view is active shipping is not part of total but part of commission so the sum does not fit together
      – If shipping goes to vendor there are a lot of figures but they do not make 100% sense like e.g. shipping amount.

      Maybe you can review on the requirement that I posted in the screenshot as I think this would work for all settings.

      Thanks & BR
      Dominique

      Attachments:
      You must be logged in to view attached files.
    • #70827
      CommunityCorals
      Participant

      I have some further remarks.

      1. I tested store invoice vs order view without above code beeing active. Here it seems like in invoice shipping is displayed correctly. In order view it is not shown. So there is a different sum. See screenshots.

      2. The above code creats following error which also is visible on store invoice.

      WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘AND is_refunded != 1′ at line 11] SELECT SUM(commission_amount) as line_total, SUM(item_total) as item_total, SUM(item_sub_total) as item_sub_total, SUM(shipping) as shipping, SUM(tax) as tax, SUM( shipping_tax_amount) as shipping_tax_amount, SUM( refunded_amount) as refunded_amount FROM gxRTKcRxwcfm_marketplace_orders WHERE order_id = 66837 AND vendor_id = AND is_refunded != 1

      Can you confirm that you plan to work on the described issues? That would help a lot as I today have a new request from vendor who needs store invoice.

      Thanks
      Dominique

      Attachments:
      You must be logged in to view attached files.
    • #71989
      CommunityCorals
      Participant

      Hello, it seems like this conversation is dead 🙁

      Could you please just let me know if you are planning to address this issue or not? If yot I will urgently have to find a custom solution. I just would like to avoid customizing things that you are planning to fix anyways.

      Thanks
      Dominique

    • #72463
      CommunityCorals
      Participant

      I just received another complaint. A vendor can not show his tax consultants in a consolidated format how the orders, the fees and the withdrawn amounts are belonging together.

      Has anyone of the other marketplace owners a tip how you guys make those thinks transparent?

      BR
      Dominique

Viewing 12 reply threads
  • The topic ‘Shipping goes to Admin amount not declared as fee’ is closed to new replies.