Title: Reward points plugin
Last modified: May 24, 2023

---

# Reward points plugin

 *  Resolved [tanlaci](https://wordpress.org/support/users/tanlaci/)
 * (@tanlaci)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/)
 * I am trying to use the Wholesale plugin with a Reward plugin. The reward plugin
   is using the price to calculate the reward points. The calculated reward points
   are displayed in multiple places on the website. Unfotrunately some places display
   the reward points using the normal price some places the wholesale price as a
   base. The Reward plugin author is asking whether there is a price caching is 
   activated in the Wholesale plugin?

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

 *  Plugin Support [Jeff Alvarez](https://wordpress.org/support/users/superlemon1998/)
 * (@superlemon1998)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16766605)
 * Hi [@tanlaci](https://wordpress.org/support/users/tanlaci/) ,
 * We have a price caching feature but it’s only available for the Premium version
   of our plugin, see: [https://prnt.sc/WIZ2EUSuvx8M](https://prnt.sc/WIZ2EUSuvx8M)
 * So, if you are a premium user, please disable it and check if the issue is fixed.
   If you are a free user then it’s likely a partially compatible plugin or caching
   from somewhere else, like:
    - Plugin caching
    - Server caching (reach out to your host provider to check and disable)
 * Let me know if you have other questions.
 * Cheers,
 *  [welaunchio](https://wordpress.org/support/users/welaunchio/)
 * (@welaunchio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16769108)
 * Hi there,
 * we are the authors of the plugin: [https://codecanyon.net/item/woocommerce-reward-points/29123909](https://codecanyon.net/item/woocommerce-reward-points/29123909)(
   sold over 800 times).
 * We use standard function: wc_get_price_to_display to get the price for point 
   calculation. However your plugin does not seem to hook into any of these functions
   or woocommerce_product_get_price.
 * You just use “get_price_html” and add a text behind the product with the wholesale
   price. Is there any way to get your wholesale price with a hook or something?
   Or do you plan to follow WC default hooks?
 *  Plugin Support [Jeff Alvarez](https://wordpress.org/support/users/superlemon1998/)
 * (@superlemon1998)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16769838)
 * hi [@welaunchio](https://wordpress.org/support/users/welaunchio/) ,
 * You can use the following parts of the to get the wholesale price of the product
 *     ```wp-block-code
       	global $wc_wholesale_prices;
       	global $product;
       	$productID = $product->get_id();
   
       	$wholesale_roles = $wc_wholesale_prices->wwp_wholesale_roles->getAllRegisteredWholesaleRoles();
   
       	// loop through wholesale roles
       	foreach( $wholesale_roles as $wholesale_role => $data ) {
   
       		// get wholesale price of product per wholesale role
       		$wholesale_price_data = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop_v3($productID, array( $wholesale_role ) );
   
       		$wholesale_sale_price_data = WWPP_Wholesale_Prices::get_product_wholesale_sale_price($productID, array( $wholesale_role ) );
   
       		// category level wil output 'product_category_level', per product is 'per_product_level'. general is 'wholesale_role_level'
       		$wholesale_price_source = $wholesale_price_data[ 'source' ];
   
       		// wholesale price
       		$wholesale_price = $wholesale_price_data[ 'wholesale_price' ];
   
       	}
       ```
   
 * Here’s an example output: [Screenshot by Lightshot (prnt.sc)](https://prnt.sc/oywY8phjF7-R)
 * Let us know if you need anything else.
 *  [welaunchio](https://wordpress.org/support/users/welaunchio/)
 * (@welaunchio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16770884)
 * Thanks for your request but I get errors:
    1. Fatal error: Class WWPP_Wholesale_Prices not found (maybe wwpp -> wwp)
    2. I tried WWP_Wholesale_Prices::get_product_wholesale_sale_price but then I get“
       method not found error”
    3. Commented it out and I get an empty array, no wholesale prices: [https://imgur.com/a/AItcs0t](https://imgur.com/a/AItcs0t)
    4. I need the 474 price
 * We use this hook: woocommerce_after_shop_loop_item
 *  Plugin Support [Jeff Alvarez](https://wordpress.org/support/users/superlemon1998/)
 * (@superlemon1998)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16775241)
 * [@welaunchio](https://wordpress.org/support/users/welaunchio/) ,
 * Sorry about that, I’ve accidentally included our premium plugin’s function which
   resulted to errors.
 * Please use this
 *     ```wp-block-code
       add_action('woocommerce_after_shop_loop_item','test');
   
       function test(){
   
       	global $wc_wholesale_prices;
       $currentUserRole = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole();
   
       global $product;
       $productID = $product->get_id();
   
       $wholesaleProduct = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop_v3( $productID, $currentUserRole );
       $wholesalePrice = $wholesaleProduct['wholesale_price'];
       echo $wholesalePrice." Coded price goes here";
   
       	}
       ```
   
 * Output: [Screenshot by Lightshot (prnt.sc)](https://prnt.sc/fd6jwICD8DY2)
 * Please note that if you are not seeing the same result as my screenshot, I suggest
   running some basic debugging to check for conflicts: [How To Conduct A Basic Debug For Wholesale Suite – Wholesale Suite (wholesalesuiteplugin.com)](https://wholesalesuiteplugin.com/kb/how-to-conduct-a-basic-debug-for-wholesale-suite/)
 *  [welaunchio](https://wordpress.org/support/users/welaunchio/)
 * (@welaunchio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16775793)
 * Hi there,
 * I disabled all plugins, used default theme and even just put your code into the
   functions.php (not our plugin), but it still not works: [https://imgur.com/a/XIrglHu](https://imgur.com/a/XIrglHu)
 * On single products a fatal error is also triggered now.
 * Can you contact us via email to [support@welaunch.io](https://wordpress.org/support/topic/reward-points-plugin/support@welaunch.io?output_format=md)
   then I can send you credentials? We would really like to add support for your
   wholesale plugin to our reward points plugin.
 *  Plugin Support [Jeff Alvarez](https://wordpress.org/support/users/superlemon1998/)
 * (@superlemon1998)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16778060)
 * hi [@welaunchio](https://wordpress.org/support/users/welaunchio/) ,
 * Please give this code a try, it’ll only return the wholesale price of the product.
 *     ```wp-block-code
       global $wc_wholesale_prices;
       $user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole();
   
       $wholesale_price = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop($product->get_id(), $user_wholesale_role);
       ```
   
 * If that doesn’t work, then I’m afraid we’ll need to raise an integration request
   with our developers. We also are not able to assist from here as this is outside
   our support scope.
 * Let us know if you have other questions.
 * Regards,
 *  [welaunchio](https://wordpress.org/support/users/welaunchio/)
 * (@welaunchio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16780661)
 * Sorry but with this code I get an empty string: [https://imgur.com/a/LUaFqVj](https://imgur.com/a/LUaFqVj)
 * Can you contact us at [support@welaunch.io](https://wordpress.org/support/topic/reward-points-plugin/support@welaunch.io?output_format=md)
   and we send you admin / FTP data? Or our plugin?
 * We did not buy your plugin, but want to add support for our plugin.
 *  Plugin Author [Josh Kohlbach](https://wordpress.org/support/users/jkohlbach/)
 * (@jkohlbach)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16784650)
 * Hi [@welaunchio](https://wordpress.org/support/users/welaunchio/), would be great
   if you could write in via our support form with more information 🙂
   [https://wholesalesuitepugin.com/support/](https://wholesalesuitepugin.com/support/)
 * Since you’re attempting to integrate your plugin, Jeff provided the two code 
   options above. You can use this to fetch the wholesale price data for a product/
   role combination.
 * get_product_wholesale_price_on_shop will return just the wholesale price data.
   get_product_wholesale_price_on_shop_v3 will return an array containing the wholesale
   price (with tax), the wholesale price (without tax) and the raw value.
 * You’ll need to process the response in your code before echoing.
 * If you write in, it would be great if you could provide more context about what
   you’re attempting to do with the data. I’ll close this thread off for now and
   looking forward to hearing from you.
 *  [welaunchio](https://wordpress.org/support/users/welaunchio/)
 * (@welaunchio)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16787302)
 * I submitted a ticket now. Ticket text:
 * Hello,
 * we refer to this thread: [https://wordpress.org/support/topic/reward-points-plugin/](https://wordpress.org/support/topic/reward-points-plugin/)
 * We are the developers of a reward points plugin with over 1000 installs and want
   to add support for your plugin.
 * We need the wholesale price to calculate points, but NONE of the code, that was
   provided in the WP thread worked. Please send us a WORKING code to get the correct
   wholesale price.
 * Image below shows: empty string (no price returned): [https://imgur.com/a/A88oFZt](https://imgur.com/a/A88oFZt)
 * Code used:
 *     ```wp-block-code
       add_action('woocommerce_after_shop_loop_item', function() {
   
       	global $product, $wc_wholesale_prices;
       	$user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole();
   
       	$wholesale_price = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop($product->get_id(), $user_wholesale_role);
       	echo 'Wholesale price: ' . var_dump($wholesale_price);
       });
       ```
   

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

The topic ‘Reward points plugin’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-wholesale-prices/assets/icon-256x256.jpg?rev
   =2547870)
 * [Wholesale Suite – B2B, Dynamic Pricing & WooCommerce Wholesale Prices](https://wordpress.org/plugins/woocommerce-wholesale-prices/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-wholesale-prices/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-wholesale-prices/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-wholesale-prices/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-wholesale-prices/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-wholesale-prices/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [welaunchio](https://wordpress.org/support/users/welaunchio/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/reward-points-plugin/#post-16787302)
 * Status: resolved