• Resolved vipersleeves

    (@vipersleeves)


    First, a thank you from my affiliate teams for the addition of the Details Panel under the commissions table. This is a great addition.

    My team has asked me to place a feature request on this panel. A lot of my affiliates are also my independent sales force. They would like to see the client/purchaser information as well on the Details Panel. Is there a possibility to get this information updated in the future? This will help them to know which clients are placing orders so they can keep in closer contact with them.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @vipersleeves,

    Thank you for reaching out! Also, I’m glad to hear that you’re enjoying the new features!

    As for the feature you’ve requested, I have added it to our development log. In the meantime however, you can use this code snippet to add the customer’s name and email address in the details panel:

    function slicewp_custom_output_list_table_commissions_customer( $item ) {

    if ( empty( $item['customer_id'] ) ) {
    return;
    }

    $customer = slicewp_get_customer( absint( $item['customer_id'] ) );

    if ( is_null( $customer ) ) {
    return;
    }

    echo '<h4 style="margin-top: 1.5rem;">Customer Details</h4>';

    echo '<table class="slicewp-list-table">';

    echo '<thead>';
    echo '<tr>';
    echo '<th class="slicewp-column-name" style="width: 50%;">Name</th>';
    echo '<th class="slicewp-column-email" style="width: 50%">Email</th>';
    echo '</tr>';
    echo '</thead>';

    echo '<tbody>';
    echo '<tr>';
    echo '<td class="slicewp-column-name">' . esc_html( $customer->get( 'first_name' ) . ' '. $customer->get( 'last_name' ) ) . '</td>';
    echo '<td class="slicewp-column-email">' . esc_html( $customer->get( 'email' ) ) . '</td>';
    echo '</tr>';
    echo '</tbody>';

    echo '</table>';

    }
    add_action( 'slicewp_list_table_output_item_details_affiliate_account_commissions', 'slicewp_custom_output_list_table_commissions_customer', 100 );

    Please copy the code and add it to your website. If you’re not sure how to add code snippets to your site, you can use the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/).

    Also, if you have any additional feature requests, I’m glad to add them to our development log for research and possible development.

    Thank you and best wishes,

    Mihai

    • This reply was modified 2 months, 3 weeks ago by iova.mihai.
    Thread Starter vipersleeves

    (@vipersleeves)

    Mihai,

    Thank you for the fast response. I was able to get this implemented today. It works perfectly. It appears that it may also be working on historical data, which was a nice added bonus.

    Maybe you can help with this one. I’m not sure how giving general affiliates the customers email address may effect privacy laws. Perhaps giving them Customer Name and Order Total may be better? Having the order total would also help them double-check they are receiving the correct commission amounts for transparency. Having the option to include or exclude tax and or shipping from the order total would be great too. It could be linked to Commissions Settings box and turned on/off based on the current status of Exclude Shipping and Exclude Taxes settings.

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @vipersleeves,

    I’m happy to hear the code snippet worked perfectly! Also, wasn’t sure what kind of information you were looking to share with your affiliates, so I included the customer’s name and email. If you just want to include the name, please replace the previous snippet with this one:

    function slicewp_custom_output_list_table_commissions_customer( $item ) {

    if ( empty( $item['customer_id'] ) ) {
    return;
    }

    $customer = slicewp_get_customer( absint( $item['customer_id'] ) );

    if ( is_null( $customer ) ) {
    return;
    }

    echo '<h4 style="margin-top: 1.5rem;">Customer Details</h4>';

    echo '<table class="slicewp-list-table">';

    echo '<thead>';
    echo '<tr>';
    echo '<th class="slicewp-column-name">Name</th>';
    echo '</tr>';
    echo '</thead>';

    echo '<tbody>';
    echo '<tr>';
    echo '<td class="slicewp-column-name">' . esc_html( $customer->get( 'first_name' ) . ' '. $customer->get( 'last_name' ) ) . '</td>';
    echo '</tr>';
    echo '</tbody>';

    echo '</table>';

    }
    add_action( 'slicewp_list_table_output_item_details_affiliate_account_commissions', 'slicewp_custom_output_list_table_commissions_customer', 100 );

    Also, to showcase the order’s amount, please add this code snippet to your website:

    function slicewp_custom_list_table_columns_affiliate_account_commissions_reference_amount( $columns ) {

    if ( ! function_exists( '_slicewp_array_assoc_push_after_key' ) ) {
    return $columns;
    }

    $columns = _slicewp_array_assoc_push_after_key( $columns, 'amount', array( 'reference_amount' => 'Order Total' ) );

    return $columns;

    }
    add_filter( 'slicewp_list_table_columns_affiliate_account_commissions', 'slicewp_custom_list_table_columns_affiliate_account_commissions_reference_amount' );


    function slicewp_custom_list_table_row_item_affiliate_account_commissions_reference_amount( $item ) {

    if ( isset( $item['reference_amount'] ) ) {
    $item['reference_amount'] = slicewp_format_amount( $item['reference_amount'], $item['currency'] );
    }

    return $item;

    }
    add_filter( 'slicewp_list_table_row_item_affiliate_account_commissions', 'slicewp_custom_list_table_row_item_affiliate_account_commissions_reference_amount', 25 );

    The above snippet will register a new column, named “Order Total”, which will display the order’s total amount.

    Currently, I’m afraid that there’s no easy way of showcasing if the commission’s calculations took into account taxes and shipping. For the moment, the only thing that I can recommend is to use this following code snippet as a template to add a note for your affiliates, letting them know how the commission was calculated.

    function slicewp_custom_output_list_table_commissions_custom_extra_notes( $item ) {

    echo '<h4 style="margin-top: 1.5rem;">Notes</h4>';
    echo '<p>Add your custom notes here to add extra context to your affiliates.</p>';

    }
    add_action( 'slicewp_list_table_output_item_details_affiliate_account_commissions', 'slicewp_custom_output_list_table_commissions_custom_extra_notes', 200 );

    The above content will show up for all commissions however. I’m not sure if it’s a practical solution for you, but I wanted to share it nonetheless, just in case it’s helpful.

    Also, I have added your feedback to our development log for more research. Offering even more context to affiliates would indeed be beneficial.

    Thank you and best wishes,

    Mihai

    • This reply was modified 2 months, 3 weeks ago by iova.mihai.
    Thread Starter vipersleeves

    (@vipersleeves)

    Mihai,

    Again, thank you for the lightning fast response and a perfect answer. This worked flawlessly and was super easy to implement.

    For the order total, showing the way the commission was calculated is less important than just showing the total amount eligible for commission.

    For instance, I have an order with a total of $100 of product. Shipping is $5 and Taxes are $8. The total the customer pays is $113.

    The order total the affiliate sees on the details tab is one of multiple situations. The affiliate is set to 10% commissions in these scenarios.

    1. Exclude Shipping and Exclude Taxes are turned off. Affiliate earns $11.30 and sees order total of $113.00
    2. Only Exclude Shipping is turned on. Affiliate earns $10.80 and sees order total of $108.00
    3. Only Exclude Taxes is is turned on. Affiliate earns $10.50 and sees order total of $105.00
    4. Exclude Taxes and Exclude Shipping are turned on. Affiliate earns $10.00 and sees order total of $100.
    5. $50.00 of products are items that are not eligible for commissions. Affiliate earns $5.00 and sees order total of $50. This may be less important. Perhaps a note on the commission heading of the table indicates commission based on eligible amount.

    Thanks again for all you do, and this amazing plugin. I’m waiting to hear back from my sales team, but I believe we’re good for now, and possibly these ideas can go into a future release.

    -Doc

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @vipersleeves,

    Glad to hear the code snippets worked nicely! Also, thank you for all of this feedback! I’ve added it to our development log for more research.

    Also, if it’s not too much to ask, if you’re happy with SliceWP, would you be willing to help us with a quick review for the plugin (here: https://wordpress.org/support/plugin/slicewp/reviews/)?

    Lastly, if you ever have any questions about SliceWP, just let us know.

    Wishing you all the best!

    Mihai

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

You must be logged in to reply to this topic.