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  

apswater
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.

Solution

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
ProductFormatRow
else
htmlProductFormatRow
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

objRS1.MoveNext
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
wend
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

Alex123
VP-CART Super User

USA
223 Posts

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

Alex
Go to Top of Page

apswater
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

https://www.apswater.com/shopdisplayproducts.asp?id=1109&cat=Barnstead+MicroPure+Water+Purification+Systems

vs searching for the same thing here

https://www.apswater.com/shopdisplayproducts.asp?Search=Yes&sppp=20&page=1&Keyword=Barnstead%20MicroPure&category=ALL&highprice=0&lowprice=0&allwords=Barnstead%20MicroPure&exact=&atleast=&without=&cprice=&searchfields=
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)
$0.00