Saving User Profile sets Seller Commission to 0%

This topic contains 8 reply and 2 voices, and was last updated by Carlos 9 years, 3 months ago
Viewing 8 Posts - 1 through 8 (of 8 total)
Author Posts
September 14, 2015 at 1:26 pm 71715
Carlos 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.
September 17, 2015 at 4:06 pm 72231
towhid towhid

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

September 17, 2015 at 4:16 pm 72236
Carlos Carlos

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.

September 20, 2015 at 10:25 am 72529
towhid towhid

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 🙂

September 20, 2015 at 11:02 am 72534
Carlos Carlos

Hello,

Information has been submitted. Thanks.

September 20, 2015 at 3:09 pm 72565
towhid towhid

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

September 21, 2015 at 5:58 am 72663
Carlos Carlos

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.

September 21, 2015 at 10:56 am 72673
towhid towhid

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

September 23, 2015 at 7:33 am 72908
Carlos Carlos

Hi Towhid,

I understand now. Thank you for explaining.

Viewing 8 Posts - 1 through 8 (of 8 total)