How can I hide prices from certain customer groups?

  • 0
  • 1
  • Question
  • Updated 5 years ago
  • Answered
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Archived

Please note that while we offer this tutorial and it is tested and working at the time of creation, any customization of or support for these types of articles is outside of our scope of support. If you require assistance with any design or customization, we recommend that you either look at the considerable number of help topics posted here, or contact one of our web advisors.
We get a lot of questions about the ability to hide prices/disable purchasing based on customer group, which may be necessary in certain businesses. For example, many store owners focus on wholesale customers and don't want prices visible until that wholesale customer logs in so that their pricing is not visible to the public. This tutorial will step you through how to hide prices and add to cart functionality for a specific customer group!

Please note that, as with any javascript, the customer must have javascript enabled in their browser for this functionality to work. While this will be the case with the vast majority of users, it is recommended that you include a note in your terms of service declaring $0 value orders will not be honored, as it is possible to place a $0 order should javascript be disabled and this tutorial's workaround implemented.
Adjusting your customer group.
1.) Log in to your Bigcommerce Control Panel.
2.) Navigate to Customers -> Customer Groups.

custgroups2013-07-19_1341.png

3.) If you already have a customer group in place that you would like to edit, you can do so. Otherwise, choose Create a Customer Group.

createcustgroup2013-07-19_1341.png

4.) Name the group as necessary, and make sure it is the default group by choosing All new customers should be added to this group. The reason for this is so that you can verify all users before removing them from this group and allowing them to see your prices.

defaultgroup2013-07-19_1343.png

5.) Scroll down and select a storewide percentage discount of 100%. Click Save.

discount2013-07-19_1344.png

6.) Next, navigate to Settings -> Store and choose the Miscellaneous tab. Scroll down to your Customer Groups Settings and select the group you just created for the Customer Group for Guests setting. Click Save.

group_for_guest2013-07-19_1350.png


7.) If you have not already, you will want to be sure to create another customer group to which you can add customers for whom you would like to enable prices/purchasing. Just be sure to avoid following steps 4 and 5 above in the case of this second customer group.

Hiding on category, home and brand pages.
1.) Navigate to the Design section of your Control Panel and click the Template Files tab.

design2013-07-19_1411.png

template2013-07-19_1412.png

2.) Find the category.html file and click edit.

category2013-07-23_1104.png

3.) Copy the following code to your clipboard:

<script type="text/javascript">
$(document).ready( function() {
var caty = $('.ProductPriceRating').html().replace("$", "");
var catz = $(caty).html().replace(".", "");
var catx = parseInt(catz, 10);
if(catx<.01)
{
$('div.ProductPriceRating').hide();
$('div.ProductActionAdd').hide();
}
else {}
});
</script>

4.) Paste the code you copied below the %%Panel.HTMLHead%% line.

comp_cat2013-07-23_1106.png

5.) Click Save

6.) Navigate back to your Template Files and edit the default.html file.

default2013-07-30_1053.png

7.) Repeat steps 3 through 5.

defaultcodeadded2013-07-30_1054.png

8.) Click Save

9.) Navigate back to your Template Files and edit the brands.html file.

brands2013-07-23_1104.png

10.) Repeat steps 3 through 5.

comp_brands2013-07-23_1105.png

That's it! On the front end of your site, prices and add to cart functionality will no longer be available on category and brand pages until customers login and reside in the group(s) you designate.

frontendcat2013-07-19_1421.png

homeafter2013-07-30_1115.png

frontendbrand2013-07-23_1116.png

Hiding on product pages.
1.) Navigate to the Design section of your Control Panel and click the Template Files tab.

design2013-07-19_1411.png

template2013-07-19_1412.png

2.) Find the product.html file and click edit.

product2013-07-23_1105.png

3.) Copy the following code to your clipboard:

<script type="text/javascript">
$(document).ready( function() {
var prody = $('.Value').html().replace("$", "");
var prodz = $(prody).html().replace(".", "");
var prodx = parseInt(prodz, 10);
if(prodx<.01)
{
$('div.ProductPriceWrap').hide();
$('div.ProductAddToCart').hide();
}
else {}
});
</script>

4.) Paste the code you copied below the %%Panel.HTMLHead%% line.

comp_product2013-07-23_1107.png

5.) Click Save

That's it! On the front end of your site, prices and add to cart functionality will no longer be available on product pages until customers login and reside in the group(s) you designate.

 

frontendproduct2013-07-19_1422.png

Hiding on search results and comparison pages.
1.) Navigate to the Design section of your Control Panel and click the Template Files tab.

design2013-07-19_1411.png

template2013-07-19_1412.png

2.) Find the search.html file and click edit.

search2013-07-23_1105.png

3.) Copy the following code to your clipboard:

<script type="text/javascript">
$(document).ready( function() {
var compy= $('span.ProductPrice').html().replace("$", "");
var compx = parseInt(compy, 10);
if(compx<.01)
{
$('span.ProductPrice').hide();
$('span.ProductQty').hide();
}
else {}
});
</script>

4.) Paste the code you copied below the %%Panel.HTMLHead%% line.

comp_search2013-07-23_1107.png

5.) Click Save

6.) Navigate back to your Template Files and edit the compare.html.

compare2013-07-23_1104.png

7.) Repeat steps 3 through 5.

comp_compare2013-07-23_1106.png

That's it! On the front end of your site, prices and add to cart functionality will no longer be available on search results and comparison pages until customers login and reside in the group(s) you designate.

frontendsearch2013-07-23_1117.png

frontendcompare2013-07-23_1117.png

Photo of Drew N

Drew N, Community Manager

  • 259,114 Points 100k badge 2x thumb

Posted 5 years ago

  • 0
  • 1

There are no replies.

This conversation is no longer open for comments or replies.