Okay
  Public Ticket #2949071
Functionality not working
Closed

Comments

  •  5
    Greg started the conversation

    Hello,

    I trust you are well.

    Please assist me with the below issues.

    1. The main dashboard is not updating the total sales, commission earned, order details, the amount of orders received, nor the order statistics.

    2. I cannot manage orders from within the dashboard, when I click on Manage Order, it gives me "Sorry, your request cannot be accepted."

    3. Will the agent be automatically reset to the lower agent group every month? I need this functionality, as we pay commissions based on their sales on a monthly basis, but they begin from 0 every month.

    4. Email notifications when new orders are placed is not working.

    5. How do I change the tab icon from your icon, to my own icon?

    Many thanks
    Greg

  •  2,219
    WebWizards replied

    Hi Greg,

    Thank you for purchasing the plugin.


    On those points:

    1. and 2. Would you be able to share a backend login to the site or a staging clone site? I'd like to check and troubleshoot those issues to see what's causing these error.

    4. What notifications are you referring to? Any WooCommerce notifications such as the "new order" email that should let admin know they received a new order?

    5. The favicon can be changed with a PHP snippet:

    add_filter('salesking_favicon_url', function($url){
        return 'yourimagelink';
    });

    You would need to replace yourimagelink with a link to an icon.


    Kind regards,

    Stefan

  •   Greg replied privately
  •  2,219
    WebWizards replied

    Thank you,

    For login credentials you can use our email at [email protected]


    4. Regarding this notification, please make sure this setting is enabled in SalesKing -> Settings -> Agent capabilities:

    2789791489.png


  •   Greg replied privately
  •   Greg replied privately
  •   Greg replied privately
  •   WebWizards replied privately
  •   Greg replied privately
  •  5
    Greg replied

    Hello,

    Is there any feedback? This is becoming really frustrating to say the least!
    I need this working asap please!

    Thank you

  •  2,219
    WebWizards replied

    Hi Greg,

    I apologize for the delay in getting back to you - we're still working with limited staff after the holidays and not able to resolve tickets as fast as we'd like.


    1)

    I looked into the "request cannot be accepted" error. This is coming from the IP GEO BLOCK plugin.

    1464924433.png

    When that plugin is disabled, the issue also goes away.

    I went to that plugin's Settings -> Admin Area -> and disabled "Zero-Day Exploit". The plugin was basically blocking any requests to the admin side. Now it appears to work in my tests.


    2) Regarding features such as showing all order details to reps, without having them be able to edit these details, I'm sorry but this feature does not exist in our plugin.

    If you find that the plugin is not compatible with your project and you no longer want to go forward with it in your setup, we can provide a refund. In that case, please make a request via https://codecanyon.net/refund_requests/new and we will accept it.


    Let us know how you'd like to proceed. Thank you.


    We're currently looking into the issue with the dashboard orders and I will get back to you once I know more.

  •  5
    Greg replied

    Hello Stefan,

    Okay I see, not a problem, was just getting a bit frustrated because I need to roll this out to my sales team as soon as possible.

    1. The IP GEO BLOCK is important to us because we keep getting hack attempts from other countries and we found this is the only way to try prevent them. So it was the "Zero-Day Exploit", that was causing the "Manage Order" function error?

    2. Would this be a feature that you would look into at all? Just having a details button and it only loads the order details on a screen and having the "Manage Order" as a separate feature.

    I do like your plugin as it has some great features, such as the upgradable tiers, which is important to us. I do wish they rest every month, or had an option to reset, but this can be done manually.

    Having said this, I am happy to keep trying with your plugin and seeing if we can get it to work but if we cant, we might have to go down the refund route unfortunately.

    Will the dashboard show the sales agents total sales as well, and not just the commission earned?

    Thank you very much, I will wait for your feedback. 
    Many thanks
    Greg

  •  2,219
    WebWizards replied

    1. Yes, as soon as I disabled that setting the error was gone. I think their feature blocked all admin area requests, so ours couldn't work either.

    2. Our plan is to improve the plugin and add additional features and options, per customers' feedback. Of course, it depends on what kind of time we have available, and what the most requested features are. Right now we're working on releasing a new plugin - once that's ready, we'll be able to dedicate more time to new features and options for existing plugins.

    We definitely plan to add a monthly reset option as we've received a lot of requests for this.

    3. Sales Totals are only visible indirectly through the My Orders panel where each order's totals can be seen.


    4. I believe I found the issue with the dashboard. A hook was not firing for some reason, perhaps an incompatibility with something else in the site. I changed this hook in our plugin and made an update to SalesKing.

    After testing, it seems to be working now:

    4251661920.png
    5604767406.png


    Please note that balances and charts only show for orders that have the "Completed" status - for pending orders they will show as 0.


  •  5
    Greg replied

    Hello,

    1. Okay great thank you very much.

    2. Okay that's great to hear and I understand time being a major factor. May I please suggest the below features in the mean time.

    2a. A copy of the Earnings widget, for Total Sales displayed on main dashboard. Reason for this, is because with us, our sales agents sales start from 0 each month and we payout commission each month as well but it might be cool for them to see what their sales have been year to date.

    2b. Added option for admins to only allow agents/reps to view order details, and not be able to change statuses, etc.

    3. Okay that's cool for now, thank you.

    4. This is great news, I am glad you have found the problem. I will also run a couple of tests today before rolling it out to my sales team. Okay that's noted thank you and also makes sense, because clients cancel orders all the time, so pointless adding it to figures until the order is completed and paid for.

    I really appreciate yourself and your teams hard work and getting to the bottom of the problem for us, I wish you all the best with your plugins and I do hope you will take my suggestions into consideration.

    Have a great day
    Many thanks
    Greg 

  •  5
    Greg replied

    Hello,

    Thank you again for sorting out the errors we were experiencing, everything seems to be working correctly now.

    Another thing though. Are the below things possible?

    1. Am I able to disable/hide the "Manage Order" button from my sales reps, but still have the setting enabled, so that they receive the new order emails and I can see who the rep is for that customer on the backend, but they are unable to see/click on the "Manage Order" button?

    2. Am I able to download the "My Order" or "Earnings" for each of my reps from the backend? This would be useful for my reports.

    Many thanks
    Greg

  •  2,219
    WebWizards replied

    Hi again, 

    Glad to hear things seem to be working correctly now, and thank you for the kind words.

    Regarding these questions:

    1. You can enable the email, but disable "Manage Orders":

    9054576412.png

    With this config, the orders panel is not visible - orders can be seen only in the earnings panel.

    Alternatively, we could also simply hide the Manage Order button with CSS if that helps - I can help add that.

     

    2. The info can be seen in the backend in SalesKing -> Earnings -> View Earnings, but there's no download feature for now.

    We will take in your suggestions for the plugin's future updates. Thank you for the feedback!


    Have a good week ahead!

  •  5
    Greg replied

    Hello,

    I hope you had a good weekend?

    1. I tried these settings but what I found it that when the "Allow agents to manage their assigned order", it doesn't assign an agent to the orders and therefore they don't receive the emails, only when I re-enabled the mange their orders setting, were the orders assigned and then the order emails came through. I'm not sure if this is a glitch?

    I looked at hiding with CSS, but the "Actions" column remains and the hide columns option resets every time the page is refreshed. Is there a way to hide the entire column with CSS? I tried to find the element but using inspect, as I have before, but couldn't quite find the element that affects all the manage order buttons and/or the entire column, without affecting the spacing of the table itself.

    I would really appreciate your assistance in this regard.


    2. Okay yes I saw that option on the backend, but it would be great to be able to download the sales that my reps have done for the month, in CSV format from the backend. For now I will get them to send me their CSV files.

    Have a good week
    Many thanks
    Greg

  •  2,219
    WebWizards replied

    Hi there,

    I'm sorry, I think you're right - I didn't realize that the emails won't work because the orders don't actually get assigned without that setting.

    To hide the actions column there, the best way would be to add the following PHP snippet - it should hide the entire column:

    add_filter('salesking_show_actions_my_orders_page', function($val){
        return false;
    }, 10, 1);

    Have a good week,

  •  5
    Greg replied

    Hello,

    Thank you very much, that snippet worked like a charm.
    Please may you provide me one for the Earnings page as well?

    Have a great week
    Many thanks
    Greg

  •  2,219
    WebWizards replied

    Hi,

    You can add the following for the earnings page:

    add_filter('option_salesking_agents_can_manage_orders_setting', function($val){
        if (get_query_var('dashpage') === 'earnings'){
            $val = 0;
        }
        return $val;
    });
    
  •  5
    Greg replied

    Hello,

    Thank you for the snippet.
    Unfortunately it seems to be causing a critical error on my site. Do you have an idea as to why this may be?

    Many thanks
    Greg 

  •  2,219
    WebWizards replied

    I'm sorry, seems to be my error. It was working when I tested it, but I forgot some configurations need it written in a stricter way. I believe the following should work:

    add_filter('option_salesking_agents_can_manage_orders_setting', function($val){
        if (get_query_var('dashpage') === 'earnings'){
            $val = 0;
        }
        return $val;
    }, 10, 1);
    
  •  5
    Greg replied

    Hello,

    Thank you very much.
    Unfortunately its still causing a critical error on my side.

    Many thanks
    Greg

  •  2,219
    WebWizards replied

    I can't understand why...are you sure you copied it fully? Please make sure to clear caches as well. I think the error may still be related to the previous snippet / cache.

    If not, please try with this as well:

    add_action('wp_loaded', function(){
        add_filter('option_salesking_agents_can_manage_orders_setting', function($val){
            if (get_query_var('dashpage') === 'earnings'){
                $val = 0;
            }
            return $val;
        }, 10, 1);
    });
    


  •  5
    Greg replied

    Thank you very much, this snippet worked to disable the "Manage Order" button on the "Earnings" page, however now when I click on "Earnings" to navigate to the earnings page, the "My Orders" menu option disappears.

    I have to go to another page, and then the "My Orders" menu option comes back.

    If I deactivate the snippet, it solves the issue.

    Very strange.

  •  5
    Greg replied

    Sorry another thing I just noticed.
    If an order is placed the Store Statistics updates accordingly, which is perfect, however, should an order be cancelled and deleted, the Store Statistics doesn't update accordingly and subtract those cancelled/deleted orders from the total orders.

    Many thanks

  •   WebWizards replied privately
  •   Greg replied privately
  •   WebWizards replied privately
  •   Greg replied privately
  •   Greg replied privately
  •   WebWizards replied privately
  •   Greg replied privately
  •   Greg replied privately
  •  2,219
    WebWizards replied

    Glad to hear that worked!

    If there's anything else I can assist with, please let me know,

    Have a great day!

  •   Greg replied privately
  •   Greg replied privately
  •   WebWizards replied privately
  •   Greg replied privately
  •   WebWizards replied privately
  •   Greg replied privately
  •   Greg replied privately
  •   Greg replied privately
  •  2,219
    WebWizards replied

    Hi,

    You can set all agents' account balance to 0, by running the following PHP code snippet:

    // get all agents
    $agents = get_users(array(
        'meta_key'     => 'salesking_group',
        'meta_value'   => 'none',
        'meta_compare' => '!=',
        'fields' => 'ids',
    ));
    foreach ($agents as $agent){
        update_user_meta($agent,'salesking_outstanding_earnings', 0);
    }
    

    Regarding the issue with the incorrect calculation, it's hard to say.

    If there are subagents, please make sure to add up earnings from subagents (if any) as well.


    Regarding the orders for which commission is not calculated, please make sure that your commission rules apply for all orders, not just orders placed by agent:

    2303972223.png

    I tested this locally with the latest version but am not seeing a similar issue.


    I'm also happy to test and check the above issues if you can share a login to the site. 


  •   Greg replied privately
  •   Greg replied privately
  •  2,219
    WebWizards replied

    Hi,

    You can run this PHP code snippet in the site:

    add_action('wp', function(){
        // get all agents
        $agents = get_users(array(
            'meta_key'     => 'salesking_group',
            'meta_value'   => 'none',
            'meta_compare' => '!=',
            'fields' => 'ids',
        ));
        foreach ($agents as $agent){
            $earnings = get_posts( array( 
                'post_type' => 'salesking_earning',
                'numberposts' => -1,
                'post_status'    => 'any',
                'fields'    => 'ids',
                'date_query' => array(
                    'after' => date('2022-01-01')  // format is YYYY-MM-DD
                ),
                'meta_key'   => 'agent_id',
                'meta_value' => $agent,
            ));
            $total_agent_commissions = 0;
            foreach ($earnings as $earning_id){
                $order_id = get_post_meta($earning_id,'order_id', true);
                $orderobj = wc_get_order($order_id);
                if ($orderobj !== false){
                    $earnings_total = get_post_meta($earning_id,'salesking_commission_total', true);
                    if (!empty($earnings_total) && floatval($earnings_total) !== 0){
                        $status = $orderobj->get_status();
                        if (in_array($status,apply_filters('salesking_earning_completed_statuses', array('completed')))){
                            $total_agent_commissions+=$earnings_total;
                        }
                    }
                }
            }
            update_user_meta($agent,'salesking_outstanding_earnings', $total_agent_commissions);
        }
    });
    


    It recalculates all earnings, for all agents, starting with January 1 2022. (you can change the date in the above code).

    It only adds up earnings for orders that are completed. 


    It's working in my tests.

    Feel free to try the snippet - if it doesn't work well for you for whatever reason, you can always reset earnings back to 0 with the previous code, so there's nothing to lose.



  •   Greg replied privately
  •  2,219
    WebWizards replied

    Hi Greg,

    That snippet was working in my tests, so it's hard to say why it didn't work for you.

    Could you give more details on what happens with the dashboard and earnings pages?


    Or if it's simpler, maybe just send us a login and a brief description of the issue, and I can check directly,

    Kind regards,

    Stefan

  •   Greg replied privately
  •   Greg replied privately
  •  2,219
    WebWizards replied

    Hi,

    Commissions would be higher from there on, after the group change - previous commissions would not be recalculated when group is changed. I don't have a way for this to be recalculated. Perhaps the simplest solution would be to manually give a 1-time bonus to account for this (2% x R80K), when a user group changes.


    I received the login link, and I was able to login on Feb 5 - I wasn't able to find the issue then and I was hoping to look more into this now. But the login is no longer working for me now for some reason. Could you check please? I don't know if it's because of my IP / geo block / link expiry. I tried with a USA IP which seemed to work better but it still did not log me in.

  •   Greg replied privately
  •  5
    Greg replied

    Hello,

    I hope you are well?

    Is there a chance that you are looking to show total sales on the dashboard, as well as commission earned?
    This way, if earnings is disabled, agents can still see their total sales.

    I know this would help me a lot, because then I could work out the commission myself from the total sales.

    Many thanks
    Greg

  •  5
    Greg replied

    Sorry I'm sending multiple messages here.

    Is there a way for an agent to receive the new order emails and have access to the customers account etc, but not earn commission on any of their orders?

  •  2,219
    WebWizards replied

    Hi Greg,

    1) It is possible for the agent to receive new order emails and have access to customers' accounts, without earning commissions.

    In SalesKing -> Settings -> Agent Capabilities enable "Allow agents to edit customer profiles" and "Agents receive new order emails".


    The customers / orders would need to be assigned to the agent. That can be done manually, or if the customers use an agent coupon or link.


    2) Normally you can see the total sales of an agent by going to SalesKing -> Earnings (in the site backend) and seeing the "Total Orders Value" column.

    But it shows the total only for orders that have earnings (commission).


    If you go to SalesKing -> Settings-> Main and deactivate "enable earnings",  then the earnings panel is replaced with an "Orders" panel:

    7590028758.png

    and here it will show total order value for all.



    3) To give agents a bonus, you'd have to tie it to a specific order. 

    You could for example create a new order, then edit it, and scroll down to "Sales Agents Commission" to add the commission to an agent.


    4) Looking at the dashboard of the Tamaryn Pope user, I see that for this user earnings and data are showing in my account:

    1083943402.png


    I am looking at other agents and their orders. But from what I can see there are no commissions for other orders. E.g. here I can see no commission: https://optoderm.com/wp-admin/post.php?post=23532&action=edit&ip-geo-block-auth-nonce=efde4cd229

    So it appears as if there's just nothing to calculate.

  •   Greg replied privately
  •  5
    Greg replied

    Hello,

    I hope you are well?

    I have just thought of another suggestion.
    It would be helpful if my agents could see which province/state their customers were from and be able to search/sort by province/state.

    Is this something you would consider implementing?

    Many thanks
    Greg

  •  2,219
    WebWizards replied

    Hi Greg,

    1) Regarding allowing agents to check by province / state:

    It is harder to add a separate column, but you can add it to the customer column. To do that, add this PHP code snippet:

    add_filter('salesking_customers_page_name_display', function($name, $customer_id){
        $customer = new WC_Customer($customer_id);
        $state = $customer->get_billing_state();
        if (!empty($state)){
            $country = $customer->get_billing_country();
            $state = WC()->countries->get_states( $country )[$state];
            $name = $name.' ( '.$state.' )';
        }
        return $name;
    }, 10, 2);
    

    The name of the state or province shows like this between ( ):

    8931099839.png

    (it is also searchable)


    2) We are interested in adding a setting to the plugin that allows everything to be calculated on a monthly basis: agent upgrades, total sales, etc. We have received a lot of requests for this.

    But as it is now with the plugin, there's no option for this by default. If you can wait for the next major update, I think you can see this feature soon.


    3) You mentioned there is an issue with the commission. I understand that only 10% is applied - I see you have 12% and 13% rules as well.

    I see that the 12% is for group 120K-250K and 13% for 250K+

    However there are no agents in these groups:

    7682369905.png



    I tested now, by adding my user to the 250K & above group (13% commission)

    I placed an order as a customer:

    3344876530.png

    The order total is 1727 ( 1502 + VAT ). I calculate 1502*13% = 195.26 , which is the number I see in the earnings.


    Have a good weekend,

    Kind regards,

    Stefan

  •   Greg replied privately
  •  5
    Greg replied

    Hello,

    Sorry again for the multiple messages.

    Is there any way to exclude tax/VAT from the total sales amount as well?
    I know I can do it for the comm calculation, but it would really help me to exclude tax from total sales amount as well.

    Many thanks
    Greg 

  •   WebWizards replied privately
  •   Greg replied privately
  •   WebWizards replied privately
  •   Greg replied privately
  •  2,219
    WebWizards replied

    Great to hear that seemed to work! And I'm glad I could help!

    If there's anything I can do, please let me know.


    Have a nice day,

    Stefan


  •   Greg replied privately
  •  2,219
    WebWizards replied

    Hi Greg,

    I tested this now but actually this seems to be working for me,

    I go the user payouts panel and I enter an amount with decimals here this way:

    5871224475.png

    I tested values like 0.87, 1.5, 0.4 and all seem to work for me,


    Are we looking at different things, or perhaps I misunderstood what you're saying?


  •   Greg replied privately
  •  2,219
    WebWizards replied

    That does help! I think I know what it is - we are probably using a different browser / different browser settings.

    I will send you an update shortly.

  •   WebWizards replied privately
  •   Greg replied privately
  •   Greg replied privately
  •   WebWizards replied privately
  •   Greg replied privately