Okay
  Public Ticket #3388460
Suggestions and amendments
Closed

Comments

  •  13
    Rui started the conversation

    Hello,

    I would like to make some observations and suggestions on the following topics

    1. How Agents can manage their orders
    When they enter the back office of the orders, the Agent MUST not be able to make "Refunds" to the orders. But I ask, if the Agent makes edits to an order the Administrator knows how? by email or some alert?

    The fields below should be suppressed, they are of no use to the Agent and the Agent can make accidental changes.

    2. For when the affiliate links, can be included banners or logos, in code for example, as I have seen in some Affiliate plugins. That is the suggestion.

    3. When the Agent opens a customer will it be possible to show the data as the customer checkout? Like the mandatory fields and labels.
    It is fine, but I think it can be improved.

    Attached files:  sugestao1.PNG

  •  1,906
    WebWizards replied

    Hello Rui,

    1) You can hide those areas and the Refund button for agents, by adding this PHP code snippet to your site:

    add_action('admin_head', function(){
        $agentgroup = get_user_meta( get_current_user_id(), 'salesking_group', true );
        if ( ! wp_doing_ajax() ){ 
            if (!empty($agentgroup) && $agentgroup !== 'none' && !current_user_can( 'manage_woocommerce' )){
                ?>
                <style>
                    .refund-items, #postcustom{
                        display:none !important;
                    }
                </style>
                <?php
            }
        }
    });
    

    A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/


    2) We will look at adding an option for assets like images, logos etc directly in the dashboard to make it easier for affiliates - however, it is possible for an agent or affiliate to simply take the standard link and add it to an image on their site, blog, etc.


    3) I am not sure if I understand where you are looking at - It might help if you can share a screenshot to clarify please.


    Kind regards,

    Stefan

  •  13
    Rui replied

    Point 1

    resolved

    Point 2
    a suggestion that I saw in other plugins, before I bought this one, at the time I had doubts, because besides the image, they also generated a QRcode, to paste in a page or print as pdf to put in paper support.
    I understand your solution, but it's just a suggestion.

    Point 3 is that in the checkout I have other fields, with another plugin, I do not know if it is possible to put the same conditions for the Agent to checkout as the Client, putting the same data *required or not
    See attached images (you can consider a suggestion, but in my case it would help)

    Attached files:  cli_agente.PNG
      cli_chkout.PNG

  •  1,906
    WebWizards replied

    Regarding 3)

    It is possible to add custom fields during the creation of a customer.


    We can add a field with this PHP code:

    add_action('salesking_add_customer_custom_fields', function(){
        ?>
        <div class="form-group">
            <label class="form-label"><?php esc_html_e('Vat Number','salesking'); ?></label>
            <div class="form-control-wrap">
                <input type="text" class="form-control" id="salesking_field_new_field" name="new-field">
            </div>
        </div>
        <?php
    });
    add_filter('salesking_custom_fields_code_list_comma', function($val){
        $val = 'new_field';
        return $val;
    }, 10, 1);
    add_action('salesking_after_customer_created', function($user_id){
        if (isset($_POST['new_field'])){
            $value = sanitize_text_field($_POST['new_field']);
            update_user_meta($user_id,'vat_number', $value);
        }
    }, 10, 1);
    

     It would add a new field there like this:

    https://prnt.sc/CuV1YdVxz-v_


    That is just an example for a vat number field. In your example, we need to know the slug / key of the fields you are using. We need to replace 'vat_number' with the key of your custom fields.


    Kind regards,

    Stefan