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 7 of 7

Thread: Customer's Past Orders

  1. #1
    phase is offline Junior Member
    Join Date
    Dec 2007
    Posts
    5

    Default Customer's Past Orders

    Our client would like to send a brochure to first time customers. Is there a way to easily see if the customer has made any past orders from the back end?

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Look for the smily faces on the View/Manage order page in the admin site. They get one for each successful order, so one smily = their first order.
    Attached Images Attached Images  

  3. #3
    phase is offline Junior Member
    Join Date
    Dec 2007
    Posts
    5

    Default

    Perfect! Thanks a bunch.

  4. #4
    phase is offline Junior Member
    Join Date
    Dec 2007
    Posts
    5

    Default

    It turns out this isn't quite what our customer is looking for. They would like the number of orders to show up on the receipt so that the warehouse knows to send a brochure. Would the notification.receipt.xml.config file need to be edited to make this happen? Has anyone done something like this before?

  5. #5
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    If you have the source code, you can add this method under the AspDotNetStorefrontCore.XSLTExtensionBase:
    Code:
            public virtual string GetOrderHistory(string sCustomerID)
            {
                InputValidator IV = new InputValidator("GetOrderHistory");
                int customerID = IV.ValidateInt("CustomerID",sCustomerID);
                int Timeline = DB.GetSqlN("select count(ordernumber) N from orders where customerid = " + customerID);
                return Timeline.ToString();
            }
    Then insert the highlighted parts on the notification.receipt.xml.config:
    Code:
    							
    <table id="tblOrderHeader" width="100%" >
                    <tr>
                      <td class="tdOrderHeaderLabel">
                        <span id="lblOrderHistory">
                          <!--Order History-->
                          <xsl:value-of select="'Order History'" disable-output-escaping="yes" />
                        </span>
                      </td>
                      <td class="tdOrderHeaderValue">
                        <span id="lblOrderHistory">
                          <xsl:value-of select="aspdnsf:GetOrderHistory($OrderInfo/CustomerID)" />
                        </span>
                      </td>
                    </tr>
    
                    <tr>
    									<td class="tdOrderHeaderLabel">
    										<span id="lblOrderNumber">
    											<!--Order Number-->
    											<xsl:value-of select="aspdnsf:StringResource('notification.betareceipt.xml.config.29')" disable-output-escaping="yes" />
    										</span>
    									</td>
    									<td class="tdOrderHeaderValue">
    										<span id="lblOrderNumber">
    											<xsl:value-of select="$OrderInfo/OrderNumber" />
    										</span>
    									</td>
    								</tr>
    								<tr>
    and that's it...

  6. #6
    deanfp is offline Senior Member
    Join Date
    May 2009
    Location
    Sweden
    Posts
    556

    Default

    Is there a way to run any reports to see a number or percentage of customers who have placed more than one order?

    We have around 70000 customers and counting the smiley faces may make me feel I was in an 80's rave

    Cheers

  7. #7
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Well, under the {root}/{AdminDir}/orderframe.aspx.cs, simply comment out the following lines:
    Code:
    if (NumOrders > 0)
    {
        Response.Write("<tr><td align=\"right\" valign=\"top\">Order History:&nbsp;</td><td align=\"left\" valign=\"top\">");
        Response.Write("<a target=\"content\" href=\"cst_history.aspx?customerid=" + DB.RSFieldInt(rs2, "CustomerID").ToString() + "\">");
        for (int i = 1; i <= NumOrders; i++)
        {
            Response.Write("<img src=\"" + AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/smile.gif") + "\" border=\"0\" align=\"absmiddle\">");
            if (i % 25 == 0)
            {
                Response.Write("<br/>");
            }
        }
        Response.Write("</td></tr>\n");
    }
    and add these lines as a replacement:
    Code:
    if (NumOrders > 0)
    {
        Response.Write("<tr><td align=\"right\" valign=\"top\">Order History:&nbsp;</td><td align=\"left\" valign=\"top\">");
        Response.Write("<a target=\"content\" href=\"cst_history.aspx?customerid=" + DB.RSFieldInt(rs2, "CustomerID").ToString() + "\">");
        Response.Write("<b>"+ NumOrders.ToString()+"</b>");
        Response.Write("</td></tr>\n");
    }
    This would replace the smileys with a numerical count of order history...