Posted - 08/06/2025 : 16:36:52
You can do all kinds of things with this, right in your includes.asp file.
I do it a little different as we only let customers with login level 1+ to see pricing and checkout. I also alter the layout with this and you can put a message in place of where the price would be, indicating they need to login to to purchase. As a matter of fact, you can include a login button so they can login right there without having to hunt for the link.
The issue with your code is clientuser is not what you want - it's clientID
if SESSION("clientID")<>"" then noprice=FALSE else noprice=TRUE if SESSION("clientID")<>"" then nobuyorcheckout=FALSE else nobuyorcheckout=TRUE
So with my website, if they are logged in, they get this nopriceanywhere=FALSE noprice=false detailpagelayout="navigation,productimage,productid,productname,<div class=""customseven""><span style=""font-weight:bold;text-transform: capitalize;"">Sizing Info: </span>%custom7%</div>,<div class=""customsix""><span style=""font-weight:bold;text-transform: capitalize;"">Country of Origin: </span>%custom6%</div>,price,quantitypricing,custom3,reviewstarslarge,options,instock,quantity,addtocart,<div class=""customfive"">%custom5%</div>,description,reviews,socialmedia"
if not, they get this detailpagelayout="navigation,productimage,productid,productname,custom3,reviewstarslarge,price,<div class=""detailquantity"" style=""text-align:center;font-size:18px;color:black;text-transform: capitalize;"">Account Registration Required to view Discounts and Purchase<br><button type=""button"" class=""ectbutton"" style=""text-transform: capitalize;"" onclick=""window.location.href='cust-signup.asp'"">Signup Here</button><br><br><button type=""button"" class=""ectbutton"" style=""text-transform: capitalize;"" onclick=""displayloginaccount()"">Login Here</button></div>,description,reviews"
Note, I have a custom signup page, but you can link to the create account like this - onclick="return displaynewaccount()"
Enjoy Thanks, David
Edited by - dbdave on 08/06/2025 16:38:42
|