Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM › WCFM Commision
- This topic has 1 reply, 2 voices, and was last updated 4 years, 3 months ago by
WCFM Forum.
Viewing 1 reply thread
- AuthorPosts
- September 8, 2019 at 1:04 pm #80722
admin-7940
ParticipantHi,
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. - September 9, 2019 at 11:14 am #80787
WCFM Forum
KeymasterHI,
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
- AuthorPosts
Viewing 1 reply thread
- The topic ‘WCFM Commision’ is closed to new replies.