Title: How to overwrite dokan commision file code using function.php
Last modified: July 8, 2023

---

# How to overwrite dokan commision file code using function.php

 *  Resolved [akaygaur](https://wordpress.org/support/users/akaygaur/)
 * (@akaygaur)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/how-to-overwrite-dokan-commision-file-code-using-function-php/)
 * Dear Team,
 * I hope this message finds you well. I am seeking your guidance regarding overriding
   the commission calculation in Dokan plugin using the function.php file in my 
   WordPress theme.
 * I need to modify the commission calculation formula by replacing $earning = (
   $product_price * $commission_rate ) / 100; with $earning = ( $product_price *
   $commission_rate ) / 110;.
 * The relevant code snippet from the Dokan plugin’s file that requires modification
   is as follows:
 *     ```wp-block-code
       if ( 'percentage' === $commission_type ) {
           $earning = ( $product_price * $commission_rate ) / 110;
           $earning = $product_price - $earning;
   
           // vendor will get 100 percent if commission rate > 100
           if ( $commission_rate > 100 ) {
               $earning = $product_price;
           }
       }
       ```
   
 * As I would like to avoid modifying the plugin directly, I am seeking guidance
   on how to implement this change through the function.php file in my theme.
 * I would greatly appreciate it if you could provide the necessary instructions
   or code snippet to override the calculation logic successfully.
 * Thank you for your attention and support. I look forward to your prompt response.
   😊

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Md Fayeakuzzaman](https://wordpress.org/support/users/fayeakuzzaman/)
 * (@fayeakuzzaman)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/how-to-overwrite-dokan-commision-file-code-using-function-php/#post-16880623)
 * Hi [@akaygaur](https://wordpress.org/support/users/akaygaur/),
 * You wish to customize the commission calculation of the Dokan plugin. It would
   involve advanced customization. 
   Please note that according to our [support policy](https://wedevs.com/support-policy/),
   we are unable to provide further assistance regarding this custom work.
 * To achieve your specific requirements, we recommend hiring a professional WordPress
   developer who can help you with the necessary customization.
 * Thanks for understanding.
 *  [Tanvir Hasan](https://wordpress.org/support/users/tanvirh/)
 * (@tanvirh)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/how-to-overwrite-dokan-commision-file-code-using-function-php/#post-16893985)
 * Hi [@akaygaur](https://wordpress.org/support/users/akaygaur/)
 * As we haven’t heard back from you for a while, we’ll consider this topic resolved.
   If you encounter any further issues, please don’t hesitate to open a new topic.
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to overwrite dokan commision file code using function.php’ is closed
to new replies.

 * ![](https://ps.w.org/dokan-lite/assets/icon-256x256.gif?rev=3239229)
 * [Dokan: AI Powered WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy](https://wordpress.org/plugins/dokan-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dokan-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dokan-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/dokan-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dokan-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dokan-lite/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Tanvir Hasan](https://wordpress.org/support/users/tanvirh/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/how-to-overwrite-dokan-commision-file-code-using-function-php/#post-16893985)
 * Status: resolved