Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: Message for wholesale only website

  1. #1
    medsupply is offline Senior Member
    Join Date
    Jul 2011
    Posts
    99

    Default Message for wholesale only website

    I am running a wholesale only website where prices and add to cart buttons do not show for not logged in customers. It just shows an empty space.

    I would like to show a "Log in to view prices" link or button for not logged in customers. This message would dissappear when customer is logged in and the price and add to cart button would show in that space.

    How can I accomplish this in the product xml package?

  2. #2
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default

    I did the same for my site and got a programer to do for me.

    Create an appconfig called TC.UserNotLoggedIn.Prompt and TC.LevelNotAssigned.Prompt. Use these appconfigs to define what message or image you would like to appear to the user when they are NOT logged in. The value of the appconfig will be displayed to the user in place of the add to cart form.

    If you would like to insert an image, you will have to insert html. For example <img src=”http://www.mydomain.com/images/image.jpg” />

    Then add this code to your product xml file.

    Code:
    <xsl:choose>
                          <xsl:when test="/root/System/CustomerIsRegistered = 'false'">
                            <xsl:value-of select="aspdnsf:AppConfig('TC.UserNotLoggedIn.Prompt')" disable-output-escaping="yes"/>
                          </xsl:when>
                          <xsl:when test="number(/root/System/CustomerLevelID) = 0">
                            <xsl:value-of select="aspdnsf:AppConfig('TC.LevelNotAssigned.Prompt')" disable-output-escaping="yes"/>
                          </xsl:when>
                        </xsl:choose>
    in this code you have 2 messages.. 1 if for when client is not logged, requesting the client to register for an account.. the second is for after the client has registered but no level has been assigned... so it should say something like please hold until we approve you account. once a level is assigned to the client then prices and order forms should load enjoy
    Gordon

    8.1.1

  3. #3
    donttryathome is offline Senior Member
    Join Date
    Apr 2009
    Posts
    171

    Default

    I accomplished this by creating two different areas in my XML package. The package checks to see if the customer has been assigned to our wholesale customer level. If they're a wholesale customer the xml package displays the appropriate prices.

    If they're not a wholesale customer the xml package displays an altered version of the page layout showing "please login to view pricing" instead of actual prices.

    If you're familiar with xml packages, it's really as easy as separating the two "versions" of the page layout with if statements that check what wholesale customer level the customer is in...

    Code:
    <xsl:if test="/root/System/CustomerLevelID = 0">
    Non-registered page layout goes here.				
    </xsl:if>
    
    <xsl:if test="/root/System/CustomerLevelID > 0">
    Registered page layout goes here.				
    </xsl:if>
    Running: AspDotNetStorefront ML 8.0.1.2/8.0.1.2