Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

Learn more about...

AspDotNetStorefront
DotFeed

Customer Level being displayed on Login. How do I remove it?

After a customer logs into their account, the login text changes from "Login" to "You're logged in as: Joe Smith (Allow Terms/PO) Logout".

The "Allow Terms/PO" is based on the Customer's Level. I don't want this to display. How can I change it so it doesn't display?

Ultimately, I would like to have a simple "Login" text to change to "Welcome: Joe Smith" when logged in. Hovering over "Welcome Joe Smith" would trigger a drop-down menu showing the links to the customer's account info (Address Book, Invoices, Orders, My Account, etc).

Any thoughts on how to accomplish this?

Thanks
asked Oct 10, 2013 in ML by Potzi (380 points)

1 Answer

0 votes
In your template.master, you'll have something like this :-
 
<div id="login">
   <span id="userName">
      <asp:Literal ID="ltrUserName" runat="server" Text='<%$ Tokens:UserName %>' />
   </span>
   <span
      id="loginText">
      <a href='<asp:Literal ID="Literal1" runat="server" Text="<%$ Tokens:SignInOut_Link %>" />'>
         <asp:Literal
            ID="ltrSignInOutText" runat="server" Text='<%$ Tokens:SignInOut_Text %>' />
      </a>
   </span>
</div>

 

 
I replaced that with a reference to an xmlpackage, that contains code like this :-
 
<xsl:choose>
   <xsl:when test="/root/System/CustomerFirstName!=''">
      <li>
         Welcome 
         <strong>
            <xsl:value-of select="/root/System/CustomerFirstName" />
         </strong>
      </li>
      <li><a href="account.aspx" title="My Account">My Account</a></li>
      <li><a href="signout.aspx">Sign out</a></li>
   </xsl:when>
   <xsl:otherwise>
      <li>
         <xsl:value-of select="$loginlink" disable-output-escaping="yes" />
      </li>
      <li><a href="createaccount.aspx?checkout=False">Register</a></li>
   </xsl:otherwise>
</xsl:choose>

 

 
For the dropdown - you can just add html/css/js intop the xmlpackage.
answered Oct 11, 2013 by BFG 9000 (1,050 points)
edited Oct 11, 2013 by BFG 9000

So I've created the XML document and I'm trying to call it using (!XmlPackage Name="CustomerLogin.xml" !). This gives me the following error:

Exception=Error in XmlPackage(.Load), Package=[CustomerLogin.xml], Msg=[The XmlPackage file could not be found. The search tree is: skins/skin_{activeskinid}/XmlPackages and then the /XmlPackages folders in your web site. Please make sure that you have FTP'd the file up to the server!]

I've saved the CustomerLogin.xml in my skins/skin_id/XmlPackages.

Obviously, I'm doing something wrong, I'm just not sure what that is.

Here is my xml code:

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:choose>
    <xsl:when test="/root/System/CustomerFirstName !="">
        <li>Welcome
            <strong>
                <xsl:value-of select="/root/System/CustomerFirstName" />
            </strong>
        </li>
        <li><a href="account.aspx" title="My Account">My Account</a></li>
        <li><a href="signout.aspx">Sign out</a></li>
    </xsl:when>
    
    <xsl:otherwise>
        <li><xsl:value-of select="$loginlink" disable-output-escaping="yes"/></li>
        <li><a href="createaccount.aspx?checkout=False">Register</a></li>
    </xsl:otherwise>
</xsl:choose>


here is a snippet of my template code:
  <div id="contact" style="width: 100%;">
    <ul id="loginMenu">
        <li><a href="t-RequestPricing.aspx">Request Info/Pricing</a></li>
        <li><a href="dist_locator.aspx">Locate Distributor</a></li>
        <li><a href="t-contact.aspx">Contact Us</a></li>
        <li>(!XmlPackage Name="CustomerLogin.xml" !)</li>

</ul>
</div>

 

 

Try (!XmlPackage Name="CustomerLogin"!) or (!XmlPackage Name="CustomerLogin.xml.config"!) instead...

 

Also - you need to ensure that you use the xmlpackage format (copy another to use as a starting point) rather than a pure xmldocument.

 

TTFN

BFG

I finally got it working! Thanks for your BFG. It would have taken me forever to figure this out on my own.
...