Home Forums WC Vendors Pro Support Commissions and Coupons

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37825
    Maceo
    Participant

    I think there is an issue with how commissions are processed when there is discount applied. At least according to verbiage. So please forgive me if I am just not reading this right.

    In the options screeen it says in the description for the Coupon Action field, “Process the commission before or after the coupon has been applied to the price.”

    But when I read the logic in the code, it appears to be backwards.

    The values for the dropdown are:
    <option value=”yes” selected=”selected”>After</option> – “Meaning apply coupon then calculate commission”
    <option value=”no”>Before</option> – “Meaning calculate commission then apply coupon”

    The code shows:

    // Apply the coupon before the commission is taken out 
    	 	if ( 'no' == WCVendors_Pro::get_option( 'commission_coupon_action' ) ) {
    	 		$product_price = $product_price - $discount_amount; 
    	 	}

    and

    // Apply the coupon after the commission is taken out 
    	 	if ( 'yes' == WCVendors_Pro::get_option( 'commission_coupon_action' ) ) {
    	 		$commission = $commission - $discount_amount; 
    	 	}

    So it appears the code is basing this off of apply coupon before or after but the option in settings is asking to process commission before or after.

    So the way I read this code is if I choose that I want to process the commission AFTER the coupon, meaning any discounts will affect the commission given to vendor, the code is discounting the product amount then processing commission, so its backwards.

    Looking at the logic, it appears i would need to set the option to process the commission BEFORE the coupon is applied to get my desired effect which is not right. I want the coupon to apply first, then process commissions based off of the net total. so either the logic should be flipped on the yes/no switches or the description needs to be changed to say “Process the coupon before or after the commission is calculated” instead of “Process the commission before or after the coupon has been applied to the price.”

    #37983
    Jamie
    Keymaster

    Hello

    The logic is correct, my language is broken. I’ll update the language to your suggestion as it makes more sense. Thanks!

    cheers

    Jamie.

    #46604
    Shaan
    Participant

    Was this updated? it’s still confusing my client.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.