Welcome, Guest ( Customer Panel | Login )




 All Forums
 VPCart Forum
 VP-Cart 8.0 Hint''s and Tips
 Remove order button is cprice is 0
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

apswater
VP-CART Super User

444 Posts

Posted - June 01 2017 :  11:16:04  Show Profile  Visit apswater's Homepage  Reply with Quote
Here is a mod Cam might want to consider making permanent.

The scenario is we frequently obsolete products but don''t want to remove it so we can still capture clients looking for it. We set the cprice to zero and in the prices it says "not available"... so far so good. But my less than intelligent clients still order it thinking "wow, its free!". So I needed to remove the qty and order button on zero price. I had done this on my old 4.5 version. So here it is on 8.0

It takes 2 mods.

In shopproductformat.asp around 567 find this

if myButton = "" then
htmlwrite "<input class=""submitbtn"" type=""submit"" value=""" & mytext & """ name=""Order"" />"
exit sub
end if

and change it to :

if myButton = "" then
if objrs("cprice") <> 0 then
htmlwrite "<input class=""submitbtn"" type=""submit"" value=""" & mytext & """ name=""Order"" />"
else
response.write "<font color=red><b>No Longer Available<br />Please Call For Alternatives</font></b>"
end if
exit sub
end if

and then in shopfileio.asp around 578 find

Add_Button "User",parsearray,parseRS
rc=0

and change it to :

if tmprs("cprice") <>0 then
Add_Button "User",parsearray,parseRS
else
response.write "<center><font color=red><b>No longer available</b><br>Please call for alternatives</font>"
end if
rc=0


Of course change the html part to meet your needs.

Hope it helps.


Edited by - apswater on June 01 2017 11:18:31

serjtankian
VP-CART Super User

Armenia
378 Posts

Posted - June 01 2017 :  13:00:59  Show Profile  Visit serjtankian's Homepage  Reply with Quote
wow that''s a very great tweak! copied and thanks!



*peace - serj*
Go to Top of Page

sancess
Starting Member

37 Posts

Posted - June 06 2017 :  12:51:10  Show Profile  Reply with Quote
@aspwater

how to modify if no cprice inserted then it will show a link to an external quote page.

Thanks
Incess
Go to Top of Page

apswater
VP-CART Super User

444 Posts

Posted - June 07 2017 :  16:02:59  Show Profile  Visit apswater's Homepage  Reply with Quote
Just put your link for quote in place of this :

"<font color=red><b>No Longer Available<br />Please Call For Alternatives</font></b>"
Go to Top of Page

sancess
Starting Member

37 Posts

Posted - June 08 2017 :  14:56:17  Show Profile  Reply with Quote
That is awesome! Thanks!

Incess
Go to Top of Page

motonet
VP-CART New User

Spain
79 Posts

Posted - June 12 2017 :  04:45:56  Show Profile  Reply with Quote
Great! Thanks
Saludos
Diego
Go to Top of Page

danielrichardson
VP-CART Super User

Australia
276 Posts

Posted - June 22 2017 :  06:04:44  Show Profile  Reply with Quote
Thanks for the above code!!
Go to Top of Page

bully456
Starting Member

United Kingdom
21 Posts

Posted - September 15 2017 :  11:11:38  Show Profile  Reply with Quote
Thank you very much for this!!

Just in case anybody else wants it, I added in an extra statement so that both the weight and stock are looked at.

case "ADD_ORDERBUTTON"
''6.5.1 - don''t display this if xpriceloggedinonly = True and customer isn''t logged in
if (GetConfig("xpriceloggedinonly") = "Yes") AND (GetSess("Login") = "") then
rc=0
else
if tmprs("cstock")>=1 And tmpRS("weight")>=1 then
Add_Button "User",parsearray,parseRS
else

''response.write "<center><font color=Black><b>" & tmprs("cstock") & "<br />" & vartype(tmpRS("weight")) & "</font></b>"

if tmprs("cstock")=0 And isnull(tmpRS("weight")) then
response.write "<center><font color=Black><b>This product has yet to be released<br />To Pre Order Please Contact Us</font></b>"
else
if tmprs("cstock")=0 And tmpRS("weight")>=1 then
response.write "<center><font color=Black><b>Currently out of stock<br />Available for back order</font></b>"
end if
end if
end if
rc=0
end if

Edited by - bully456 on September 19 2017 08:46:49
Go to Top of Page

bully456
Starting Member

United Kingdom
21 Posts

Posted - January 20 2018 :  12:10:32  Show Profile  Reply with Quote
Sorry for bringing up an old thread.

Does anyone know how to get this to work on the non-extended product description please? (Sorry - brain freeze and can''t remember what the page is called so have a picture instead) http://www.cheltenhammodelcentre.com/Stock.png

I have tired with small success to get this to work by using the VPASP helpnote https://helpnotes.vpcart.com/kb/16-Product-Formatting-Standard/1172-A-Friendlier-Stock-Display/ as a starting point.

I''m obviously doing something wrong, but I have now hit a brick wall with regards to working out what to do next.

Any help greatly appreciated

Thanks

James
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