ProductCart E-Commerce Solutions Homepage
Forum Home Forum Home > ProductCart > Customizing ProductCart
  New Posts New Posts RSS Feed - PC Admin - Locate Inactive Products only
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

PC Admin - Locate Inactive Products only

 Post Reply Post Reply
Author
Message
avalight View Drop Down
Newbie
Newbie


Joined: 21-September-2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote avalight Quote  Post ReplyReply Direct Link To This Post Topic: PC Admin - Locate Inactive Products only
    Posted: 08-May-2009 at 4:53pm
Hello All
In the Admin console, under Locate Products, I only want to locate ONLY my inactive products.  I tried to modify the code in inc_srcPrds.asp, around line 700 in v3.51a, changing the value="-1" to "1" , to "" and the other part of the if-then statement, but nothing seems to give me just the inactive products. 

Has anyone done this and if so, what did you do?  Or any other ideas?

Thanks

Curt
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 08-May-2009 at 8:44pm
Hi Avalight,
     In inc_srcPrdQuery.asp look for the following code :

if pInactive="-1" then
else
   strSQL=strSQL & " AND products.active=-1"
end if

and try changing it to the following :

if pInactive="-1" then
   strSQL=strSQL & " AND products.active=0"
else
   strSQL=strSQL & " AND products.active=-1"
end if


Please note, I have NOT tested this and it will change, I believe, change the action of the checkbox to toggle between showing "active"  OR "inactive" instead of "active" OR "active and inactive". If you wish to choose between all three states then a more complex solution would be required.

Of course all the caveats about backups and makintaing changes through updates apply. 


Edited by Hamish - 08-May-2009 at 8:45pm
Back to Top
avalight View Drop Down
Newbie
Newbie


Joined: 21-September-2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote avalight Quote  Post ReplyReply Direct Link To This Post Posted: 09-May-2009 at 1:07am
Thanks Hamish, I will check it out.  But I should leave the code alone in the inc_srcPrds.asp file, then?  Because it looks like it triggers the above.
Curt
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 09-May-2009 at 3:36am
Hi,
    Yes, I would reset it back to the original version.
Back to Top
avalight View Drop Down
Newbie
Newbie


Joined: 21-September-2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote avalight Quote  Post ReplyReply Direct Link To This Post Posted: 11-May-2009 at 5:46pm
Okay, I made these changes, and something is backwards...with this change, if the box is checked, then all products show, when the box is unchecked, only the inactive show.  I am trying to figure out the logic here, so I can troubleshoot...I want two states:  Box checked, only the inactive products show... box unchecked (normal state) , then only the active products show.
Does 1 = true, and -1 = false??
Curt
Back to Top
avalight View Drop Down
Newbie
Newbie


Joined: 21-September-2007
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote avalight Quote  Post ReplyReply Direct Link To This Post Posted: 11-May-2009 at 6:18pm
Wait-a-minute!
I posted the code wrong.  I didn't realize you were saying to ADD a line of code...I just replaced what was there.   All is well, and it works great!
thanks!
Curt
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 11-May-2009 at 6:35pm
Hi Avalight, The only change you should need is the one in inc_srcPrdQuery.asp.
I believe the values in the DB for "active" are -1 = Yes,  0 = No.  Have you tried this and it's not working? If so what results are you getting?
Back to Top
Hamish View Drop Down
Admin Group
Admin Group


Joined: 12-October-2006
Location: United Kingdom
Status: Offline
Points: 56
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hamish Quote  Post ReplyReply Direct Link To This Post Posted: 11-May-2009 at 6:38pm
Hi,  we cross-posted :-)  I'm glad it's all working.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.