Charge vendors monthly and Payment details on Woocommerce "thank you page"

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 WCFM – Ultimate Charge vendors monthly and Payment details on Woocommerce "thank you page"

Viewing 3 reply threads
  • Author
    Posts
    • #69311
      GM
      Participant

      We want to use WCFM as platform for Multi vendor stores.

      1. We want to charge vendors every month based on sales each month is that possible?

      2. We want all payments to go to vendors. Is that possible to manage in your system?

      3. If number 2 is not possible. Is there a way to get the vendors PayPal email adress and present it on woocommerce “thank you page”. So
      clients can get the payment details there.

      4. If we can manage nr 2 or 3. I also want to add a new payment option in vendor Payments. Called swish and then a phone number. It is like pay pal but uses mobile number instead.

      Best regards,

      /Timo

    • #69817
      WCFM Forum
      Keymaster

      HI,

      1. We want to charge vendors every month based on sales each month is that possible?

      – It’s possible to payout commission in schedule basis, monthly, weekly etc …

      2. We want all payments to go to vendors. Is that possible to manage in your system?

      – It’s only possible using Stripe. Not using PayPal

      3. If number 2 is not possible. Is there a way to get the vendors PayPal email adress and present it on woocommerce “thank you page”. So
      clients can get the payment details there.

      – Possible. You have to add this code to your child theme’s functions.php –

      add_action( 'end_wcfm_vendor_settings', function( $vendor_id ) {
      	global $WCFM, $WCFMmp;
      	$wcfm_customer_payment_options     = get_user_meta( $vendor_id, 'wcfm_customer_payment_options', true );
      	?>
      	<!-- collapsible -->
      	<div class="page_collapsible" id="wcfm_settings_form_min_order_amount_head">
      		<label class="wcfmfa fa-cart-plus"></label>
      		<?php _e('Customer Pay Option', 'wc-frontend-manager'); ?><span></span>
      	</div>
      	<div class="wcfm-container">
      		<div id="wcfm_settings_form_vendor_invoice_expander" class="wcfm-content">
      			<?php
      			$WCFM->wcfm_fields->wcfm_generate_form_field(  array(
      																														"wcfm_customer_payment_options" => array('label' => __('Payment Options', 'wc-frontend-manager'), 'type' => 'textarea', 'class' => 'wcfm-textarea wcfm_ele wcfm_full_ele', 'label_class' => 'wcfm_title wcfm_ele wcfm_full_ele_title', 'value' => $wcfm_customer_payment_options ),
      																														) );
      	    ?>
      		</div>
      	</div>
      	<div class="wcfm_clearfix"></div>
      	<!-- end collapsible -->
      	<?php
      }, 500 );
      
      add_filter( 'wcfm_marketplace_settings_fields_billing', function( $setting_fields, $vendor_id ) {
      	if( !wcfm_is_vendor() ) {
      		$wcfm_customer_payment_options     = get_user_meta( $vendor_id, 'wcfm_customer_payment_options', true );
      		$wcfm_customer_payment_options_field = array(
      																		"wcfm_customer_payment_options" => array('label' => __('Customer Payment Options', 'wc-frontend-manager'), 'type' => 'textarea', 'class' => 'wcfm-textarea wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $wcfm_customer_payment_options ),
      																		);
      		$setting_fields = array_merge( $wcfm_customer_payment_options_field, $setting_fields );
      	}
      	return $setting_fields;
      }, 50, 2 );
      
      add_action( 'wcfm_vendor_settings_update', function( $vendor_id, $wcfm_settings_form ) {
      	global $WCFM, $WCFMmp;
      	if( isset( $wcfm_settings_form['wcfm_customer_payment_options'] ) ) {
      		$wcfm_customer_payment_options = $wcfm_settings_form['wcfm_customer_payment_options'];
      		update_user_meta( $vendor_id, 'wcfm_customer_payment_options',  $wcfm_customer_payment_options );
      	}
      }, 500, 2 );
      
      function wcfmmp_vendor_order_customer_payment_options( $order ) {
      	global $WCFM, $WCFMmp;
      	
      	echo "<br /><br />";
      	echo "<h2 style='font-size: 18px; color: #17a2b8; line-height: 20px;margin-top: 6px;margin-bottom: 10px;padding: 0px;text-decoration: underline;'>" . __( 'Payment Details:', 'wc-frontend-manager-ultimate' ) . "</h2>";
      	echo "<table width='100%' style='width:100%;'><tbody>";
      	$order_items           = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
      	foreach ( $order_items as $item_id => $item ) {
      		$product_id = $item->get_product_id();
      		$vendor_id           = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );
      		if( !$vendor_id || !wcfm_is_vendor( $vendor_id ) ) continue;
      		$wcfm_customer_payment_options     = get_user_meta( $vendor_id, 'wcfm_customer_payment_options', true );
      		if( !$wcfm_customer_payment_options ) continue;
      		?>
      		<tr>
      			<td colspan="3" style="background-color: #eeeeee;padding: 1em 1.41575em;line-height: 1.5;font-weight:600;"><?php echo get_the_title( $product_id ); ?></td>
      			<td colspan="5" style="background-color: #f8f8f8;padding: 1em;"><?php echo wpautop($wcfm_customer_payment_options); ?></td>
      		</tr>
      		<?php
      	}
      	echo "</tbody></table>";
      	echo "<br /><br /><br /><br />";
      }
      add_action( 'woocommerce_order_details_after_order_table', 'wcfmmp_vendor_order_customer_payment_options', 50 );
      add_action( 'woocommerce_email_order_meta', 'wcfmmp_vendor_order_customer_payment_options', 50 );

      Thank You

    • #69965
      GM
      Participant

      Hi,

      I tried the code above, I got the text “Payment details” in green on woocommerce “thank you page” and in the e-mail sent to client.
      But I can’t see vendors PayPal email adress.

      Best regards,

      /GM

    • #70239
      WCFM Forum
      Keymaster

      Hi,

      Can you please show me screenshot, what you are getting?

      Between, do you have added Vendor’s PayPal email from Vendor Setting -> Customer Pay Option

      Thank You

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