• Resolved mikeapm

    (@mikeapm)


    The coupons are working, but they are applying the discounts on default pricing rather than the price set for users in our custom user role “wholesale customer”.

    We are using Wholesale Suite Plugin

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mikeapm

    (@mikeapm)

    We were able to create a php snippet that fixes the problem.

    add_filter('wt_sc_alter_giveaway_product_price', 'fix_giveaway_price', 10, 2);
    function fix_giveaway_price($product_price, $product) {

    if(class_exists('WWP_Wholesale_Prices')) {
    $pricesInstance = WWP_Wholesale_Prices::getInstance();
    $rolesInstance = WWP_Wholesale_Roles::getInstance();

    $user_wholesale_role = $rolesInstance->getUserWholesaleRole();

    if ( ! empty( $user_wholesale_role ) )
    {
    $product_price = $pricesInstance->get_product_raw_wholesale_price( $product->get_id(), $user_wholesale_role );
    }
    }

    return $product_price;
    }
    Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @mikeapm ,

    Greetings from WebToffee Support!

    Thank you for sharing the code snippet. We’re glad to hear that you were able to resolve the issue with your custom user role pricing. After reviewing the snippet, it looks well-implemented and should ensure that the giveaway product price is based on the wholesale price for users with the “Wholesale Customer” role.

    If you require any further assistance or have additional queries, feel free to reach out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.