Commission creation for the Stripe Split payment gateway

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 Marketplace Commission creation for the Stripe Split payment gateway

Viewing 2 reply threads
  • Author
    Posts
    • #117986
      japerez
      Participant

      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!!

    • #118443
      japerez
      Participant

      Any help? Ty!!

    • #121333
      Sushobhan
      Keymaster

      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/

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