Home Forums Theme Support Dokan Saving User Profile sets Seller Commission to 0%

This topic is: resolved

This topic contains 8 replies, has 2 voices, and was last updated by  Carlos 3 years, 7 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #71715

    Carlos
    Participant
    Post count: 66

    When saving a Seller's profile via WP Admin > Users, it automatically sets the Seller Commission % to 0 when saving, even when you leave it blank. This should not be happenining.

    It should allow us to save the field as blank and automatically use the % we set through the Dokan settings. Instead, it is automatically inserting a 0 in the % field when we save the User Profile and setting the Seller Commission % to 0.

    This is occuring on multiple installations and has been verified on a Default WP theme with only Dokan and Woocommerce plugins enabled.

    Please advise how this can be fixed.

    #72231

    towhid
    Participant
    Post count: 4505

    Hello Carlos,

    Suppose, you have entered a particular Seller Commission is 90%. Then you do not have to enter Seller Commission % manually in that User Profile. That seller will get 90% commission automatically. But if you want to assign different seller for a different commission then you have to assign commission manually.

    Assume, you have assigned commission 80% for Seller A. Then Seller A will get 80% commission but not 90%. But all other sellers will get 90% commission though it still showing all seller user profile 0%.

    If you still have any confusion please let me know.

    Thanks

    #72236

    Carlos
    Participant
    Post count: 66

    Hi Towhid,

    We have set the Dokan Seller Commission.

    If you edit the User Profile, it sets the individuall seller's commission to 0% automatically – even if it is blank and it is saving that value to the database.

    Any time a Seller's user profile is edited, their commission is being set to 0, even when we leave it blank. This shouldn't be happening.

    #72529

    towhid
    Participant
    Post count: 4505

    Please provide your login details by using this form: http://wedevs.com/provide-login-details/. I will have a look what is going wrong.

    Thank you ๐Ÿ™‚

    #72534

    Carlos
    Participant
    Post count: 66

    Hello,

    Information has been submitted. Thanks.

    #72565

    towhid
    Participant
    Post count: 4505

    Hello Carlos,

    It will not effect for the seller commission calculation. Probably it is showing empty. But already the “0” is assign to the database. So there will be no wrong calculation at all. If you now assign a commission percentage then it will overwrite the dokan_seller_percentage meta value in the database.

    Still if you are not clear enough please let me know.

    Thanks

    #72663

    Carlos
    Participant
    Post count: 66

    Hi Towhid,

    When the admin edits a Seller's User profile, and leaves their percentage blank (because we want to use the default commission,) Dokan is automatically saving dokan_seller_percentage as 0. This changes the Seller's commission to 0 even though we want it to be default.

    We need to be able to save a Seller's User Profile so that it uses the default commission.

    Thanks.

    #72673

    towhid
    Participant
    Post count: 4505

    Hello Carlos,

    The meta key saving dokan_seller_percentage as 0 but it does not override the global commission. When admin manually set the seller commission over then 0, seller commission only override at that time.

    Here is the code where the commission is process: check this code than you will understand:

    Please navigate to plugins/dokan/includes/functions.php

    Now find this block of code:

    /**
     * Get store seller percentage settings
     *
     * @param int $seller_id
     * @return int
     */
    function dokan_get_seller_percentage( $seller_id = 0 ) {
        $global_percentage = (int) dokan_get_option( 'seller_percentage', 'dokan_selling', '90' );
    
        if ( ! $seller_id ) {
            return $global_percentage;
        }
    
        $seller_percentage = (int) get_user_meta( $seller_id, 'dokan_seller_percentage', true );
        if ( $seller_percentage ) {
            return $seller_percentage;
        }
    
        return $global_percentage;
    }

    Hope you will understand now.

    Thanks

    #72908

    Carlos
    Participant
    Post count: 66

    Hi Towhid,

    I understand now. Thank you for explaining.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Saving User Profile sets Seller Commission to 0%’ is closed to new replies.