VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Customization
 Stock Report
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

[email protected]
Starting Member

USA
44 Posts

Posted - December 09 2003 :  18:51:38  Show Profile  Visit johnrobinson@grahamcrackers.com's Homepage  Reply with Quote
I'd like the Stock Report to sort the listing by "cname" and not by "catalogid".
Now I was able to go in and simply change the order of the columns to the way I want in the file shopa_stock.asp, but I also needed to change
scriptresponder="shopa_addproduct.asp"
idfield="cname" <--was originally "catalogid"
GetInput
If Action = "" or Serror<>"" Then
DisplayForm
Else
GenerateSQL
WriteReport
end if

..This works, unfortunately it screws up the link as it wants catalogid there so when it executes shopa_addproduct.asp it'll be an id #. I don't mind it displaying that link later, so long as it sorts my inventory list in order by name.
I can live with the screwed up change I made, would just prefer to still have that working link so I can update the inventory level easily through stock reports.

Thanks!
--John

jonmadrid
VP-ASP New User

USA
192 Posts

Posted - December 10 2003 :  14:19:02  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
John,

You can add another variable into that page that will specify how to sort the records. Here is what you would do:

Replace this:
*******
dim Idfield
scriptresponder="shopa_editrecord.asp"
idfield="catalogID"
GetInput
...
*******

With this:

*******
dim Idfield
dim orderfield 'New variable for field to sort by
scriptresponder="shopa_editrecord.asp"
orderfield="cname"
idfield="catalogID" 'Define the field to sort by
GetInput
*******

Then, around line 84, replace this:

*******
Sql = SQL & " order by " & idfield
*******

with this:

*******
Sql = SQL & " order by " & orderfield
*******

That's it. That will now sort by the correct field, and will preserve your links in the correct format.




All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page

jonmadrid
VP-ASP New User

USA
192 Posts

Posted - December 10 2003 :  14:21:07  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
I just noticed that one of the comments in the code was on the wrong line. Should have read:

orderfield="cname" 'Define the field to sort by
idfield="catalogID"

Not

orderfield="cname"
idfield="catalogID" 'Define the field to sort by

Hope that didnt confuse you.



All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page

[email protected]
Starting Member

USA
44 Posts

Posted - December 10 2003 :  15:41:26  Show Profile  Visit johnrobinson@grahamcrackers.com's Homepage  Reply with Quote
Works like a charm!
Thanks a TON!

--John Robinson
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000