Support » Plugins » WooCommerce exclude sale price per user role

  • I’m using WooCommerce and the Dynamic Pricing extension. I’ve set pricing discounts for 2 user roles, Dealers and Distributers. Currently, if I set a sale price on a product, the sale price is reflected for all users, and the discount for Dealers and Distributors is then compounded on top of it.

    How would I conditionally state that if the user is a Dealer or Distributor, remove the sale price but still apply the price discount that’s set in Dynamic Pricing?

    Thanks for any help.

    http://wordpress.org/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Were you able to figure this out? I am running into this exact same issue.

    Give this a shot. Add it to your functions file. Adding the role names to current_user_can() worked, but the WP docs warned that it may not.

    //////////////////////////////////////////////////////////////
    // Remove Sales Flash if Dealer/Distributor/Reseller
    //////////////////////////////////////////////////////////////
    
    if ( current_user_can('dealer') || current_user_can('distributor') || current_user_can('reseller')) {
    	add_filter('woocommerce_sale_flash', 'woo_custom_hide_sales_flash');
    	function woo_custom_hide_sales_flash() {
    	    return false;
    	}
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WooCommerce exclude sale price per user role’ is closed to new replies.