Welcome, Guest ( Customer Panel | Login )

 All Forums
 VPCart Forum
 VP-Cart 8.0 Hint''s and Tips
 Handy mod for shopdisplayproducts
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

VP-CART Super User

444 Posts

Posted - May 30 2018 :  17:41:42  Show Profile  Visit apswater's Homepage  Reply with Quote
So earlier I posted a mod that when you made the selling price 0 the buy buttons were eliminated and "No longer available, Call for alternate" was shown instead. We want the products to show up so the clients know they are gone and not that we never carried them. We also have links to replacement parts and such on the products pages so we don''t want to scare them away and miss that we carry those still.

When you list products using shopdisplayproducts.asp, these items would show and sometime overwhelm the category listing. I decided I wanted them to appear in the search list but not on the product display pages.


This fuller mod will put the discontinued products at the bottom of the shopdisplayproducts.asp page.

Here is the whole section starting at line 304 of shopdisplayproducts.asp

GetProductRecordset objrs1, objrs

dim discontinued <- add

ProductGetValues objRS, dbc '' get product values
Inventorycheck = false '' no sub products
InventoryPriceDisplay = true '' display prices with sub products
Inventoryoutofstock = false '' there are inventory products to display
InventoryProductYesNo dbc, objrs, lngCatalogId, inventorycheck, Inventorypricedisplay, Inventoryquantitydisplay, inventoryoutofstock

if objrs("cprice") > 0 OR request.querystring("Search") <> "" then <--- add

if Productwithhtml<>"Yes" then
end if
if Product= "Yes" then
if trim(ProdIndex) = "" then ProdIndex = 0
ProdIndex = ProdIndex + 1
end if

else <--- add

discontinued=discontinued + 1 <--- add

session("discontinued")=session("discontinued") & "<a href=/shopexd.asp?id=" & objrs("catalogid") & ">" & objrs("ccode") & "</a> - " & objrs("cname") & " is discontinued. <hr size=1>" <--- add

end if <--- add

CloseRecordSet objrs
recordcount = recordcount + 1
colcount = colcount + 1
totalcolcount = totalcolcount + 1
if colcount>= ProductMaxColumns and ProductMaxcolumns>1 then
response.write "</tr>"
colcount = 0
end if
htmlwrite "</div>"

if discontinued > 0 then <--- add
%> <--- add
<br /><br /><b>Discontinued Items - Filters, Operation Manuals and Parts may still be available.<br />Click Catalog number for more info</b><hr> <--- add
<% <--- add
end if <--- add

response.write session("discontinued") <--- add
session("discontinued")="" <--- add

800 - 2016.02.22 - Enhancement: Load more results

Edited by - apswater on May 30 2018 20:44:53

VP-CART Super User

223 Posts

Posted - May 31 2018 :  15:29:06  Show Profile  Reply with Quote
Thank you for the tip. Will be useful for someone :)

Go to Top of Page

VP-CART Super User

444 Posts

Posted - May 31 2018 :  18:45:12  Show Profile  Visit apswater's Homepage  Reply with Quote
A good example is here


vs searching for the same thing here

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000
0 Item(s)