Print Page | Close Window

PC Admin - Locate Inactive Products only

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=2725
Printed Date: 26-July-2025 at 8:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: PC Admin - Locate Inactive Products only
Posted By: avalight
Subject: PC Admin - Locate Inactive Products only
Date 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



Replies:
Posted By: Hamish
Date 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. 


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: avalight
Date 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


Posted By: Hamish
Date Posted: 09-May-2009 at 3:36am
Hi,
    Yes, I would reset it back to the original version.


-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: avalight
Date 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


Posted By: avalight
Date 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


Posted By: Hamish
Date 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?

-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code



Posted By: Hamish
Date Posted: 11-May-2009 at 6:38pm
Hi,  we cross-posted :-)  I'm glad it's all working.

-------------
Editing ProductCart Code?

See http://wiki.earlyimpact.com/developers/editcode" rel="nofollow - WIKI Guidelines for Editing ProductCart's ASP Source Code




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