Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Shipping goes to Admin amount not declared as fee
- This topic has 12 replies, 2 voices, and was last updated 5 years, 5 months ago by CommunityCorals.
- AuthorPosts
- June 20, 2019 at 9:14 am #68732CommunityCoralsParticipant
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 - June 20, 2019 at 9:15 am #68733CommunityCoralsParticipant
–
- June 22, 2019 at 5:25 am #69012WCFM ForumMember
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
- June 22, 2019 at 7:03 am #69029CommunityCoralsParticipant
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 - June 26, 2019 at 12:47 pm #69738WCFM ForumMember
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
- June 26, 2019 at 1:09 pm #69747CommunityCoralsParticipant
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.
- June 28, 2019 at 12:36 pm #70129CommunityCoralsParticipant
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
DominiqueAttachments:
You must be logged in to view attached files. - June 29, 2019 at 2:24 pm #70217WCFM ForumMember
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
- June 30, 2019 at 7:31 am #70334CommunityCoralsParticipant
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 . ”
ANDvendor_id
= ” . $vendor_id . ”
ANDis_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 ); - June 30, 2019 at 7:47 am #70336CommunityCoralsParticipant
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
DominiqueAttachments:
You must be logged in to view attached files. - July 3, 2019 at 3:53 pm #70827CommunityCoralsParticipant
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 ANDvendor_id
= ANDis_refunded
!= 1Can 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
DominiqueAttachments:
You must be logged in to view attached files. - July 11, 2019 at 6:53 am #71989CommunityCoralsParticipant
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 - July 14, 2019 at 5:01 pm #72463CommunityCoralsParticipant
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
- AuthorPosts
- The topic ‘Shipping goes to Admin amount not declared as fee’ is closed to new replies.