WordPress Affiliate Manager

Affiliates Management Plugin for WordPress

  • Home
  • Features
    • Screen Shots
  • Download
  • Documentation
  • Addons
  • Support
    • Support Forum
    • Forum Login
    • Forum Registration
    • Contact
    • Premium Addon/Plugin Support

[Resolved] Show woocommerce product commission in the shop and product page

by

WordPress Affiliate Manager › Forums › Affiliate Manager Plugin › Show woocommerce product commission in the shop and product page

Tagged: woocommerce roduct based commission

  • This topic has 2 replies, 2 voices, and was last updated 4 years, 7 months ago by brandsload.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • December 5, 2020 at 1:33 pm #7098
    brandsload
    Participant

    The plugin is great and solves all most of my problem as a dropshipping suppliers, good job

    I purchased the Woocommerce product based commission, it is working fine, my question is

    How to show the product commission in the shop page and in the product page, as I have different commission for each product and need my affiliates to be able to see the commission of each product

    Thanks

    December 7, 2020 at 3:11 am #7100
    Shadow Labs
    Keymaster

    @brandsload, our plugin doesn’t have an option to do this at the moment.

    December 7, 2020 at 11:48 am #7101
    brandsload
    Participant

    Well, I beleive you have to consider it, however, I did some researches and I did it, here is how you can do it

    The product commission is stored in a woocommerce product custom field called “wpam_woo_product_specific_commission”

    To display this field value in the products loop in shop and archive pages you need to add this function to your child theme functions.php

    —–
    add_action( ‘woocommerce_after_shop_loop_item_title’, ‘wpam_woo_product_specific_commission’, 35 );

    function wpam_woo_product_specific_commission() {
    global $post;
    if ( is_home() || is_shop() || is_product_category() || is_product_tag() ) {
    echo ‘<span class=”woocommerce-breadcrumb”>’;
    echo “Commission ” . get_post_meta( $post->ID, ‘wpam_woo_product_specific_commission’, true ) . ” $ “;
    echo ‘</span>’;
    }
    }
    —–

    To display the commission in the product page you need to add this code to the end of the price.php file in the woocommerce templates folder under single-product (woocommerce/templates/single-product/price.php)

    —–
    <?php
    echo “Commission ” . get_post_meta( get_the_ID(), ‘wpam_woo_product_specific_commission’, true ) . ” $ “;
    ?>
    —–

    Finally, as you edited one of the woocommerce core files, you may need to use this tool “WordPress child plugin tool” to avoid losing the modifications you made when woocommerce update
    https://github.com/ThomasDepole/wordpress-child-plugin-tool

    Hope this help

    Thanks

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Featured Addons

  • WooCommerce Coupon Tracking
  • WooCommerce Product Specific Commission

Copyright © 2025 | WordPress Affiliate Manager | Privacy Policy