Author |
Topic |
|
rudyfr
Starting Member
5 Posts |
Posted - September 23 2004 : 08:14:23
|
Hi, I'm wondering if anyone can help me solve a small issue. We'd like to run a report of the total cost of the customer selected features in a given time frame. In other words, the summary reports display the total sales, total tax, and total shipping for whatever period we enter; but what we also need is basically a way to run a query and find the "total features cost" from the same time period. I need to find a way to separate out the feature prices from the total sales so we can track those separately. We are not after a complicated report split out by total cost of the individual features added, we are just after the aggregate of the cost of all features.
I've noticed that the feature cost seems to be included in an array of information which appears as a chunk of information in various places such as the cart. Can someone help steer me in the right direction as to where/when in the order process I might be able to have the feature costs of each order written to a field separately somewhere in the database (orders or oitems table I am assuming), so I can then report on a sum of that field from records that are searched based on date?
Thanks, any help on this one would be greatly appreciated.
|
|
support
Administrator
4679 Posts |
Posted - September 23 2004 : 14:17:33
|
Features are stored in the oitems table as a list like
33,7,8 These are the featureids with the prodfeatures table.
You would parse the string Read the prodfeatures table to get the feature cost for each feature
VP-ASP Support
|
|
|
rudyfr
Starting Member
5 Posts |
Posted - September 24 2004 : 12:28:58
|
Thanks for responding. And thanks for the direction. Can you tell me if there is a file in the store that perfoms a similar process? I'm a bit of a novice to ASP, but I'm learning. If I can see something similar in action, I'll be able to work out the solution. Thanks again.
|
|
|
devshb
Senior Member
United Kingdom
1904 Posts |
Posted - September 24 2004 : 13:57:33
|
I don't know if this'll help, but in case it does here's something that'll bring back a list of the feature descriptions/settings for a given oitem.features value that we created for one of our addons once.....
(oitems.features [the argument to the function] being the value of the chosen features separated by commas as per support's posting above).....
Function BYZGetFeaturesText(arg_featurecodes) Dim retval Dim i Dim tconn Dim tCursorFeatures Dim tsqlqrytxtFeatures Dim tcaption Dim tname
if (arg_featurecodes="" or IsNull(arg_featurecodes)=true) then retval="" else retval="" EditOpenDatabase tconn, database,"prodfeatures" tsqlqrytxtFeatures="SELECT * FROM prodfeatures WHERE id in (" & arg_featurecodes & ")" Set tCursorFeatures=Server.CreateObject("ADODB.Recordset") tCursorFeatures.LockType=adLockReadOnly tCursorFeatures.CursorType=adOpenForwardOnly Set tCursorFeatures=tconn.Execute(tsqlqrytxtFeatures) i=0 While Not tCursorFeatures.EOF if (i>0) then retval=retval&", " end if tcaption=tCursorFeatures("featurecaption") tname=tCursorFeatures("featurename") retval=retval&tname i=i+1 tCursorFeatures.MoveNext Wend tCursorFeatures.Close Set tCursorFeatures=Nothing ' Close the relevant database: shopclosedatabase tconn end if BYZGetFeaturesText=retval End Function
but.....
your feature costs/prices will change over time, so to report accurately historically you'd need to add the feature costs amount to the order/oitems as new columns and populate them when the order gets created as I don't think that value is stamped onto the order/oitems.
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons
Edited by - devshb on September 24 2004 15:47:15 |
|
|
rudyfr
Starting Member
5 Posts |
Posted - September 28 2004 : 07:04:45
|
Thanks Simon! I'm going to give that a try, I think that will do what we need for now. Much appreciated. I'll let you know how it goes.
|
|
|
|
Topic |
|