Print Page | Close Window

CatSalesReport.asp not showing customer name

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Using ProductCart
Forum Description: Running your store with ProductCart
URL: https://forum.productcart.com/forum_posts.asp?TID=4109
Printed Date: 21-July-2025 at 10:34pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CatSalesReport.asp not showing customer name
Posted By: Brett
Subject: CatSalesReport.asp not showing customer name
Date Posted: 31-October-2010 at 9:01pm
The report does not show customer name. Verified on ProductCart demo store.

To fix, edit the query on line 145 (v4.1 PPE):
query="SELECT DISTINCT orders.idorder,orders.idcustomer,orders.total,orders.shipmentDetails,orders.paymentDetails,orders.taxAmount,orders.discountDetails,orders.orderDate,orders.processDate,orders.shipDate,customers.name,customers.lastName FROM ((ProductsOrdered INNER JOIN Orders ON ProductsOrdered.idOrder=Orders.idOrder) INNER JOIN customers on customers.idcustomer=orders.idcustomer) INNER JOIN Categories_Products ON ProductsOrdered.idProduct=Categories_Products.idProduct WHERE Categories_Products.IDCategory=" & pIDCategory & " AND ((orders.orderStatus>2 AND orders.orderStatus<5) OR (orders.orderStatus>6 AND orders.orderStatus<9) OR (orders.orderStatus=10 OR orders.orderStatus=12)) " & TempSQL1 & TempSQL2 & TempSpecial & " ORDER BY " & tmpD & " DESC;"

This stuff was added:

,customers.name,customers.lastName FROM ((ProductsOrdered INNER JOIN Orders ON ProductsOrdered.idOrder=Orders.idOrder) INNER JOIN customers on customers.idcustomer=orders.idcustomer)

So it will pull customers.name and customers.lastName from the database.


Then on line 189:

do until rs.EOF
     pc_idorder=rs("idorder")
     pc_idcustomer=rs("idcustomer")
     pc_orderDate=rs("orderDate")
     custName=rs("name") & " " & rs("lastName")

This grabs the database query info and puts it into a variable custName


Then on line 259:

<td nowrap><a href="viewCustOrders.asp?idcustomer=<%=pc_idcustomer%>" title="View all orders by this customer"><%=custName%></a></td>

This shows the previously defined custName variable.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net