WCFM Commision

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 1 reply thread
  • Author
    Posts
    • #80722
      admin-7940
      Participant

      Hi,

      Is there an option to calculate the commision on top of the product price in the shop, so the buyer pays and the vendor get his asked price?

      Like the tax, it shows in the shop on top of the asking price of the vendor, now the vendor have to calculate every time he puts a product online.
      Would nice if this would me automated.

    • #80787
      WCFM Forum
      Keymaster

      HI,

      Please add this code to your site –

      add_action( 'after_wcfm_products_manage_pricing_fields', function( $product_id ) {
      	global $WCFM, $WCFMmp;
      	
      	echo '<p class="description" style="color:#f86c6b; font-size:15px;">Estimated Commission: ';
      	if( $product_id ) {
      		$product         = wc_get_product( $product_id );
      		$regular_price   = $product->get_regular_price();
      		$sale_price      = $product->get_sale_price();
      		$commission_rule = $WCFMmp->wcfmmp_product->wcfmmp_get_product_commission_rule( $product_id );
      		if( $sale_price ) {
      			$item_commission = $WCFMmp->wcfmmp_commission->wcfmmp_generate_commission_cost( $sale_price, $commission_rule );
      		} else {
      		  $item_commission = $WCFMmp->wcfmmp_commission->wcfmmp_generate_commission_cost( $regular_price, $commission_rule );
      		}
      		
      		echo wc_price( $item_commission );
      	} else {
      		echo "Please save the product first!";
      	}
      	echo "</p>";
      }, 9 );

      Add this code to your child theme’s functions.php
      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

      Thank You

Viewing 1 reply thread
  • The topic ‘WCFM Commision’ is closed to new replies.