Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Commission creation for the Stripe Split payment gateway
Tagged: Commission, price, total
- This topic has 2 replies, 2 voices, and was last updated 4 years, 7 months ago by Sushobhan.
- AuthorPosts
- April 11, 2020 at 5:00 pm #117986japerezParticipant
Hello team! First of all, congratulations on the good product you have.
We are creating a marketplace for local products, and businesses are being added to our platform, all payments are made through Stripe Split, where the payment division automatically arrives and we take a commission, but instead of being charged to sellers, we charge it to the end customer with a percentage increase, created with a payment increase plugin per payment gateway. In this way, each seller receives the amount of their products and we take X% of the total account, but the sellers receive 100% (less commissions) of their sale.
So, since we wanted to make the product 100% free for sellers, we decided to increase Stripe’s commission (1.4% + 0.25 cent) per transaction to products. We achieve this with the following code:
function return_custom_price( $price, $product ) { global $WCFM, $WCFMmp, $post, $blog_id; $vendor_id = wcfm_get_vendor_id_by_post( $product->get_id() ); if( $vendor_id ) { $price += ( $price * (1.425/100) + (0.35) ); } return $price; } add_filter( 'woocommerce_product_get_price', 'return_custom_price', 10, 2 );
But we realized that it was wrong, as this would only work for 1 single product from each seller. When more products are added, it would no longer work, because the commission is being doubled.
In addition, this function does not work for variable products either, and we are a bit lost, in case they can help us generate an increase in commission for the total sale of each client. That is, a commission increase is added to the cart, and it is distributed among the products in the total cart or it appears as a concept of each store as “Payment gateway commissions: € XX” and each store is collect those commissions.
Thank you very much and greetings!!
- April 12, 2020 at 6:22 pm #118443japerezParticipant
Any help? Ty!!
- April 21, 2020 at 4:50 pm #121333SushobhanKeymaster
Hi,
The way you want to solve this, may add confusion from your customers end. As The price of a product will change based on the numbers of items added to the cart.
You could use WooCommerce Fees API to add a transaction charge fee to the whole order (without changing individual product price). Read more about this from here – https://docs.woocommerce.com/document/add-a-surcharge-to-cart-and-checkout-uses-fees-api/
- AuthorPosts
- You must be logged in to reply to this topic.