The result looks like this with Storefront theme: (but it might differ with different themes)
The above works for simple products, but it will be difficult to make it work for variable products - each variation can have its own table, so I'm not sure how that would work on the shop page.
You can do that by adding the following code snippet to the site:
$user = get_current_user();
if (is_object($user)){
$user_roles = $user->roles;
} else {
$user_roles = array();
}
if ( in_array( 'reps', $user_roles)) {
// the code here only applies to reps
global $b2bking_public;
add_action('woocommerce_after_shop_loop_item', array($b2bking_public,'b2bking_show_tiered_pricing_table'));
}
I do not know what you are using for reps. I wrote 'reps' in the above code snippet, but I don't know if that's the actual name of the role.
If you are using our SalesKing plugin let me know, I can give more details.
Hi,
Is it possible to display the tiered pricing on the shop page underneath each product as well as on the single product page?
Thanks for your time
Darren
Hi Darren,
I think that may look a bit too crowded on the shop page, but I suppose it depends on your theme and how products are displayed.
You can do that if you are open to modifying the plugin code.
To do that modification:
In class-b2bking-public.php you can find the following code (approx. lines 370-390).
These are the tables for simple products and for variable products.
You can also add the following line of code there to also display the tables in the shop page under the item:
The result looks like this with Storefront theme: (but it might differ with different themes)
The above works for simple products, but it will be difficult to make it work for variable products - each variation can have its own table, so I'm not sure how that would work on the shop page.
Kind Regards,
Stefan
This works great but How can I make it so the pricing table only shows on the shop page to WP user role reps only?
Thank you for your time
Darren
Hi Darren,
You can do that by adding the following code snippet to the site:
I do not know what you are using for reps. I wrote 'reps' in the above code snippet, but I don't know if that's the actual name of the role.
If you are using our SalesKing plugin let me know, I can give more details.
Kind regards,
Stefan