on 10-11-2008 6:05 AM
Hi
Our client has a requirement whereby he would like to hide the prices in the partdetail if a user is not logged into the site.
Once they have logged in they can then view the prices in the part list and part detail sections.
Could someone please advise on how to achieve this?
Thanks you
Regards
Ashvin
Hi,
try something like this
for partlistpage:
add this to partlistblock.ascx and change for this colunm with price only.
protected override void OnPreRender(EventArgs e)
{
string userID = ((NPBasePage)Page).UserID;
if (userID != "") {
PartsListGrid.Columns[7].Visible = true;
PartsListGrid.Columns[8].Visible = true;
} else {
PartsListGrid.Columns[7].Visible = false;
PartsListGrid.Columns[8].Visible = false;
PartsListGrid.Columns[9].Visible = false;
PartsListGrid.Columns[10].Visible = false;
}
}
for part details page i suggest in catalogpartdetail.master
private void Page_Load(object sender, System.EventArgs e) {
string userID = ((NPBasePage)Page).UserID;
if (userID != "") {
partprice.Visible = true;
} else {
partprice.Visible = false;
}}
try the same with search page...
regards Greg.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much Greg
That solved the problem.
Regards
Ash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ash,
There are a couple ways I can think of solving this issue.
1) Create a separate "view-only" catalog that has $0 for all prices and associate it with a theme. Upon logging in, the customers will see the real prices.
2) Create a Javascript or ASP.NET piece of code that sets the visibility on or off based on whether the user is logged in.
3) Block out unregistered users completely, but then publish a static page of products and descriptions or use a plug in that advertises different products on the home page.
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.