Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 VP-ASP 7.0 Questions
 Add ''QTY'' next to the quantity block
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cps
VP-CART New User

South Africa
69 Posts

Posted - July 01 2013 :  06:47:26  Show Profile  Visit cps's Homepage  Reply with Quote
I just want to find out if there is a way to add ''QTY'' next to all the blocks where the customer fills out the quantity of the product they wish to order.

www.thecpswarehouse.co.za

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - July 02 2013 :  03:57:43  Show Profile  Reply with Quote
You can add the "qty" text to the sub FormatQuantity in shopproductformat.asp file or you can add it to the product templates.

Regards,

Carrol
www.deanston-electrical.co.uk
Go to Top of Page

cps
VP-CART New User

South Africa
69 Posts

Posted - July 02 2013 :  06:11:28  Show Profile  Visit cps's Homepage  Reply with Quote
Could you show me specifically where you would put the ''QTY'' in - I am not familiar with .ASP:

'' put out a quantity box unless using inventory products
'' Inventory products cannot be purchased so put our nothing
sub FormatQuantity
if GetConfig("xproductcatalogonly") = "Yes" then
exit sub
end if

''6.5.1 - don''t display this if xpriceloggedinonly = True and customer isn''t logged in
if (GetConfig("xpriceloggedinonly") = "Yes") and (GetSess("Login") = "") then
exit sub
end if
''6.5.1 - don''t display this if product is out of stock
if GetConfig("xOutOfStocklImit") > "" then
if lngcstock<= clng(GetConfig("xOutOfStocklImit")) then
response.write "<input class=""txtfield"" type=""hidden"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
exit sub
end if
end if
if GetConfig("xstocklow") > "" then
if lngcstock<= clng(GetConfig("xstocklow")) then
response.write "<input class=""txtfield"" type=""hidden"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
exit sub
end if
end if
if productwithhtml = "Yes" then
if inventoryquantitydisplay = false then
'' exit sub
end if
end if
if inventorycheck = true and inventoryquantitydisplay = false then
''6.08 - Quantity issue in inventory products
response.write "<input class=""txtfield"" type=""hidden"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
QuantityFlag = True
exit sub
end if
if strMinimumQuantity = 0 or strMinimumquantity = "" then
if productwithhtml<>"Yes" then
response.write ProdQuantityColumn & "<input class=""txtfield"" type=""text"" maxlength=""4"" size=""3"" value=""1"" name=""quantity"" />" & ProdQuantityEnd
else
response.write "<input class=""txtfield"" type=""text"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
end if
else
GenerateMinList
end if
QuantityFlag = True
end sub

sub GenerateMinList
dim PArray(100), PArrayCount
dim minamount, amount, multiply
minamount = strminimumquantity
'' should we generate a list or just prevent the customer from order less
if GetConfig("xproductminimumquantity") = "Yes" then
if productwithhtml<>"Yes" then
response.write ProdQuantityColumn & "<input type=""text"" maxlength=""4"" size=""3"" value=""" & strMinimumQuantity & """ name=""quantity"" />" & ProdQuantityEnd
else
response.write "<input type=""text"" maxlength=""4"" size=""3"" value=""" & strMinimumQuantity & """ name=""quantity"" />"
end if
exit sub
end if
parraycount = GetConfig("xproductminimumlist")
if parraycount = "" then
parraycount = 6
end if
parraycount = clng(parraycount)
for i = 1 to parraycount
amount = i * minamount
parray(i) = amount
next
dim i
s= "<select size=1 name=''quantity''>"
sSelect = sSelect & "<option selected=""selected"">" & minamount & "</option>"
for i = 2 to parraycount
sSelect = sSelect & "<option>" & Parray(i) & "</option>"
next
sSelect = sSelect & "</select></p>"
if productwithhtml<>"Yes" then
response.write ProdQuantityColumn & sSelect & ProdQuantityend
else
response.write sSelect
end if
end sub


www.thecpswarehouse.co.za
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - July 02 2013 :  06:21:24  Show Profile  Reply with Quote
Add the lines with red text.

'' put out a quantity box unless using inventory products
'' Inventory products cannot be purchased so put our nothing
sub FormatQuantity
if GetConfig("xproductcatalogonly") = "Yes" then
exit sub
end if

''6.5.1 - don''t display this if xpriceloggedinonly = True and customer isn''t logged in
if (GetConfig("xpriceloggedinonly") = "Yes") and (GetSess("Login") = "") then
exit sub
end if
''6.5.1 - don''t display this if product is out of stock
if GetConfig("xOutOfStocklImit") > "" then
if lngcstock<= clng(GetConfig("xOutOfStocklImit")) then
response.write "<input class=""txtfield"" type=""hidden"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
exit sub
end if
end if
if GetConfig("xstocklow") > "" then
if lngcstock<= clng(GetConfig("xstocklow")) then
response.write "<input class=""txtfield"" type=""hidden"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
exit sub
end if
end if
if productwithhtml = "Yes" then
if inventoryquantitydisplay = false then
'' exit sub
end if
end if
if inventorycheck = true and inventoryquantitydisplay = false then
''6.08 - Quantity issue in inventory products
response.write "<input class=""txtfield"" type=""hidden"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
QuantityFlag = True
exit sub
end if
if strMinimumQuantity = 0 or strMinimumquantity = "" then
if productwithhtml<>"Yes" then
response.write "Qty "
response.write ProdQuantityColumn & "<input class=""txtfield"" type=""text"" maxlength=""4"" size=""3"" value=""1"" name=""quantity"" />" & ProdQuantityEnd
else
response.write "Qty "
response.write "<input class=""txtfield"" type=""text"" maxlength=""4"" size=""3"" value=""0"" name=""quantity"" />"
end if
else
GenerateMinList
end if
QuantityFlag = True
end sub

Any problems, just ask.

Regards,
Carrol
www.deanston-electrical.co.uk
Go to Top of Page

cps
VP-CART New User

South Africa
69 Posts

Posted - July 02 2013 :  09:15:53  Show Profile  Visit cps's Homepage  Reply with Quote
It worked! Thanks so much for your help.

www.thecpswarehouse.co.za
Go to Top of Page

cps
VP-CART New User

South Africa
69 Posts

Posted - July 08 2013 :  03:26:24  Show Profile  Visit cps's Homepage  Reply with Quote
Hi there,

Sorry I just realised it has only worked where single products are displayed. Where there is a product with subproducts, the ''QTY'' does not display e.g. http://www.thecpswarehouse.co.za/shopdisplayproducts.asp?id=107&cat=Standard

Please advise where I

www.thecpswarehouse.co.za
Go to Top of Page

carfin
VP-CART Expert

United Kingdom
948 Posts

Posted - July 08 2013 :  03:44:40  Show Profile  Reply with Quote
Open file shopproductinventory.asp
Find the sub FormatInventoryQuantity() and add in the code highlighted in red.

sub FormatInventoryQuantity ( dbc, rs, objrs)
dim selectname, checkname, msize, setselected, Loopend, subCatalogId
dim formcaption, multiple, valuename, CatalogIds, quantityname
dim fprefix, sSelect
Formatinventoryformname fprefix, formcaption
selectname = fprefix & "subproductquantity"
valuename = selectname & "_CatalogIds"
checkname = selectname
CatalogIds = ""
loopend = "False"
s= ""
setselected = ""
sSelect = ProdFeatureCaption & formCaption & ProdFeatureCaptionEnd
sSelect = sSelect & "<table cellpadding=""0"" cellspacing=""0"">"
tempOption = ""
do while LoopEnd = "False"
GenerateSubProductName tempoption, rs
subCatalogId = rs("CatalogId")
if CatalogIds<>"" then
CatalogIds = CatalogIds & ","
end if
CatalogIds = CatalogIds & subCatalogId
quantityname = selectname & "_" & subCatalogId
sSelect = sSelect & "<tr>"
sselect = sselect & "<td> Qty: <input type=""text"" size=""1"" name=""" & quantityname & """ value=""" & "0" & """ class=""txtfield"" /> </td>"
sselect = sselect & "<td>" & tempoption & "</td>"
sSelect = sSelect & "</tr>"
Rs.movenext
if rs.eof then
LoopEnd = "True"
end if
loop
sSelect = sSelect & "</table>"
response.write "<br />" & sselect & "<br />"
response.write "<input type=""hidden"" name=""" & valuename & """ value=""" & CatalogIds & """ />" & vbcrlf
response.write "<input type=""hidden"" name=""" & checkname & """ value=" & 34) & "Yes" & chr(34) & " />" & vbcrlf
end sub

Regards,

Carrol
www.deanston-electrical.co.uk
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