ProductCart bug in viewPrd.asp |
Post Reply |
Author | |
dfinster
Newbie Joined: 11-February-2006 Status: Offline Points: 0 |
Post Options
Thanks(0)
Posted: 27-April-2006 at 7:57pm |
I've discovered errors in ProductCart when configuring a product with two option groups and three custom fields.
The client Javascript fails in that situation. See line 697 of viewPrd.asp. That Javascript validation function (cdd6) has errors in the alert statements. It refers to variables named "option", when it should be "option1", "option2", etc. Easy fix, took me 20 minutes to find it. It's a serious bug, it prevents the item from being added to the shopping cart. IE and Firefox blow up on it differently, but either way, it screws up the purchase. In addition, I've found that when returning from the shopping cart via the "Edit product options" link, the custom fields do not retain the original values. That's a hassle for the user, I'm looking at writing a patch now. Can you confirm my findings, and do I get a cookie? |
|
ProductCart
Admin Group ProductCart Team Joined: 01-October-2003 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
We cannot replicate the JavaScript problem that you described. Please contact us by opening a support ticket so that we can log into your Control Panel and look at the product settings. As for the other issue, it will be fixed in the next ProductCart version. |
|
dfinster
Newbie Joined: 11-February-2006 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
No need to log into my cart, I've fixed the code and it's working fine for me now. It just looks like a copy-paste error. Below is the full function, and below that is my correction.
The issue is that lines that read: alert("<%=dictLanguage.Item(Session("language")&"_ale rt_1")%>\n"+ option + "<%=dictLanguage.Item(Session("language")&"_alert_ 2")%>.\n"); Should read: alert("<%=dictLanguage.Item(Session("language")&"_ale rt_1")%>\n"+ option1 + "<%=dictLanguage.Item(Session("language")&"_alert_ 2")%>.\n"); I've bolded the part in error. It's a client-side error, the Javascript engine is trying to access a variable named "option" that doesn't exist. It should be "option1" or "option2" etc. Compare function cdd5 at line 675 and cdd6 at line 697 - it'll be obvious then. Here's the full function for context. Bad function beginning on line 697 of viewPrd.asp (from ProductCart_276_PATCH_101005.zip) ======== function cdd6(choice1, option1, choice2, option2, choice3, option3, choice4, option4, choice5, option5) { if (choice1== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice2== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice3== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice4== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice5== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { document.additem.action="instPrd.asp"; document.additem.method="POST"; document.additem.submit(); } } } } } } ============= Corrected function ======== function cdd6(choice1, option1, choice2, option2, choice3, option3, choice4, option4, choice5, option5) { if (choice1== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option1 + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice2== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option2 + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice3== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option3 + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice4== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option4 + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { if (choice5== 0) { alert("<%=dictLanguage.Item(Session("language")& ;"_alert_1")%>\n"+ option5 + "<%=dictLanguage.Item(Session("language")&"_alert_2") %>.\n"); } else { document.additem.action="instPrd.asp"; document.additem.method="POST"; document.additem.submit(); } } } } } } ============= |
|
ProductCart
Admin Group ProductCart Team Joined: 01-October-2003 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
You are using an older version of ProductCart. This issue was fixed months ago.
|
|
dfinster
Newbie Joined: 11-February-2006 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
I'm running 2.76p2, with the 11/10/2005 security update. I can't find a release after that when I click on "check for updates" from my cart. What am I missing? I just purchased this cart about 8 weeks ago, and this is the code I got.
|
|
ProductCart
Admin Group ProductCart Team Joined: 01-October-2003 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
That security update does not apply to v2.76p2, as indicated in the corresponding ReadMe file. Reupload the files from the v2.76p2 build to overwrite the ones that you replaced.
|
|
dfinster
Newbie Joined: 11-February-2006 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
To double check myself, and make sure there was no mistake, I asked to have my download link re-enabled so I could pull down a fresh, official build of productcart.
This morning I downloaded and unzipped ProductCart_v276p2_012406.zip into a clean folder and checked the file. This error still exists in both "parent paths enabled" and "parent paths disabled". It has not been corrected in this build. The security patch mentioned above was my confusion, but it's a red herring. That patch only contains two files, and they are identical (except for a single comment) to the 276p2 build. When I check for updates from my cart, that patch still shows as an available update, so I was confused. If this bug was corrected months ago, I'm not seeing the fix. Is this the latest build? Are there other patches I'm missing also? |
|
ProductCart
Admin Group ProductCart Team Joined: 01-October-2003 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
You're right. Our mistake. We had found the problem and the fix, but the edited file had not made it into the master. Sometimes it happens. Thanks for the feedback. By the way: this area of the cart has been substantially rewritten in v3 (next release - should be out by the end of June), and the problem does not exist there. |
|
dfinster
Newbie Joined: 11-February-2006 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
No sweat - I was confused for a bit... i have two clients using PC, one at 2.76p and the other at 2.76p2 and I thought I was looking at the wrong stuff. Any word on upgrade pricing for version 3?
By the way - I've used 4 different carts in the past, and each one of them I swore it was the first and last time I'd ever use the product. Your product is the first cart that made me a repeat customer. I've rolled it out twice, and I'm planning to use it in the future. |
|
ProductCart
Admin Group ProductCart Team Joined: 01-October-2003 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
That's great to hear, thanks! We haven't finalized pricing for v3, but we will soon :-) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |