Skip to content
  • There are no suggestions because the search field is empty.

How to Show Different Content Based on Customer Type

Please note: The contents of this article apply only to licensed versions of the ProductCart software. They do not apply to stores running as a hosted application under a ProductCart Live agreement.




Retail vs. Wholesale Customers


In ProductCart, it's easy to show different content based on who is viewing the page. Once a customer has logged in, ProductCart sets session variables to identify the customer type.
 
session("customerType")="1"

… means that the customer is a wholesale customer. So to show a certain portion of HTML code only to a wholesale customer, you would use something like the following:
 
<% If session("customerType")="1" then %>
This is shown only to wholesale customers
<% else %>
This is shown to retail customers
<% end if %>
 

A Wholesale-Only Store


If you place this code in header.asp, then customers will not be able to use the store at all unless they are logged in as a wholesale customer. To do so, of course, you need to place a login form on a page that does not use header.asp.

 

Leveraging Customer Pricing Categories


As you know, you can also assign a customer to a pricing category in ProductCart. When you do so, at the time the customer logs in, another useful session variable is set.
 
session("customerCategory")

The value assigned to the session variable is the ID of the Customer Pricing Category. You can view this value when you add/edit a pricing category in the Control Panel.

So - similarly to the above - you can very easily show/hide content based on whether a customer belongs to a specific customer category. For example, assume that the ID of the Pricing Category “Preferred Customers” is 20. The code would read…
 
<% If session("customerCategory")="20" then %>
This is shown only to "Preferred Customers"
<% else %>
This is shown to other customers
<% end if %>

Note that you can use Customer Pricing Categories even if the discount is 0. That is, they can help you separate customers into different categories regardless of whether or not those customers also receive a different price.
 

Different looking storefronts for different customers


Advanced users will appreciate the fact that the above can be used to potentially show a completely different graphical interface based on the customer type or the customer category. That is, the files header.asp and footer.asp could contain IF statements based on the session variables mentioned above and load completely different HTML (e.g. entirely different DIVs, images, navigation, etc.).