VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Problems and bugs
 Bug in product dependencies
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tmcleary
Starting Member

USA
2 Posts

Posted - December 10 2004 :  09:00:54  Show Profile  Visit tmcleary's Homepage  Reply with Quote
Nifty little bug (using 5.5):

If you set up for product dependencies, when you go to check out it will not let you without having the dependent products in your cart.

It should display a message to you (it actually redirects to shoperror.asp), but to make a long story short the message that is intended to be display has a HTML A tag in it so the customer can quickly jump to that product. The message is generated via ShopDependentMessage in shopdependent.asp

However, I think in their effort to close security issues, shoperror.asp is running the passed message through CleanseMessage in shop$db.asp which is rejecting the message due to the "=" in "HREF=" as well as the "/" in "</a>.

Having said all that, the more logical solution would be to automatically add the dependent product when adding to the cart originally.

Thanks!
-Tom




Edited by - tmcleary on December 10 2004 09:01:33

tmcleary
Starting Member

USA
2 Posts

Posted - December 10 2004 :  10:16:58  Show Profile  Visit tmcleary's Homepage  Reply with Quote
OK, here's some code that will automatically add the dependent products. Caveat: this seems to work but has not been extensively tested!

This is all in shopaddtocart.asp. First at the top you'll need to add the following include:

<!-- #include file="shopdependent.asp" -->

Then in the sub ProcessNetAdd(), find the three lines that read (starting at line 76 for me-with include added):

CartAddItem prodid, rc
if rc > 0 then
sError=getlang("langErrorNoProduct") & "id=" & prodid
end if

Then right before the "end if" line (after the "sError=..." line) add the following chunk of code:

else
dim deparray, count, i
If getconfig("xproductdependentfield")<>"" then
ShopProductDependent rc
If rc>0 then
count = GetSess("depCount")
deparray = GetSessA("depArray")
for i = 0 to count-1
prodid = depArray(1,i)
CartGetProduct prodid, rc
if rc > 0 then
sError=getlang("langErrorNoProduct") & "id=" & prodid
else
CartAddItem prodid, rc
if rc > 0 then
sError=getlang("langErrorNoProduct") & "id=" & prodid
Exit For
end if
end if
next
end if
end if

Let me know if anyone finds a problem with this...

Enjoy!
-T




Edited by - tmcleary on December 10 2004 10:25:45
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000