naturenu Posted November 23, 2008 Share Posted November 23, 2008 I have installed CCGV 5.2 and was testing out my store but checkout stops and I get this message: Parse error: syntax error, unexpected T_STRING in /home/naturenu/public_html/includes/classes/payment.php on line 91 if (is_array($this->modules)) { if ($coversAll) { $addThis='if (document.checkout_payment.cot_gv.checked) { payment_value='cot_gv'; } else '; } else { $addThis=''; I took a look at that line but don't know what is wrong with it? (I bolded the line it is talking about) Anyone having similar problems or know how to fix it? TIA! Quote Link to comment Share on other sites More sharing options...
blakepetersen Posted November 26, 2008 Share Posted November 26, 2008 I recieved the same problem. If you comment it out, you can bypass the issue but in commenting, you must be bypassing whatever the script does... here is what it looks like.... // Start - CREDIT CLASS Gift Voucher Contribution function javascript_validation() { //function javascript_validation($coversAll) { //added the $coversAll to be able to pass whether or not the voucher will cover the whole //price or not. If it does, then let checkout proceed when just it is passed. $js = ''; if (is_array($this->modules)) { //if ($coversAll) { // $addThis='if (document.checkout_payment.cot_gv.checked) { // payment_value='cot_gv'; // } else '; //} else { // $addThis=''; //} // End - CREDIT CLASS Gift Voucher Contribution Quote Link to comment Share on other sites More sharing options...
blakepetersen Posted November 26, 2008 Share Posted November 26, 2008 In commenting i believe it gets rid of the inputs for whatever your payment selection is going to be so this actually does break the cart. If someone could please help find a fix, that would be great Quote Link to comment Share on other sites More sharing options...
blakepetersen Posted November 26, 2008 Share Posted November 26, 2008 Well, i was able to get rid of the error by removing the quotes around cot_gv on line 91. so it looks like payment_value=cot_gv; but im still having problems getting the perferred method of payment to display an input Quote Link to comment Share on other sites More sharing options...
p2409 Posted March 7, 2009 Share Posted March 7, 2009 Well, i was able to get rid of the error by removing the quotes around cot_gv on line 91. so it looks like payment_value=cot_gv; but im still having problems getting the perferred method of payment to display an input The clueless advice on here always makes me laugh. Commenting out or getting rid of quotes 'so it just works' is almost always the WRONG way to fix PHP. It shows you have no idea what you're doing. if (is_array($this->modules)) { if ($coversAll) { $addThis='if (document.checkout_payment.cot_gv.checked) { payment_value='cot_gv'; } else '; } else { $addThis=''; The problem with this awkward bit of code is that it is code creating javascript code. That code has quotes in it itself, so it f**** up the quoted string. To fix it, simply escape the quotes around 'cot_gv' ie. make it '\cot_gv\' instead. That way PHP will read the quote as 'part of the string' not 'the end of a string'. Quote OSC User Definitions "I can add modules to OSC" = I can search, cut and paste. But not well, or I wouldn't be here. "I start my posting with 'works like a charm' = I'm letting you down gently, nothing works and I have no idea why "I finish postings with "plzzzz....hlp" = My installation is buggered and I know I'm going to have to pay someone, but I really, really don't want to. Link to comment Share on other sites More sharing options...
Guest Posted September 5, 2010 Share Posted September 5, 2010 The clueless advice on here always makes me laugh. Commenting out or getting rid of quotes 'so it just works' is almost always the WRONG way to fix PHP. It shows you have no idea what you're doing. if (is_array($this->modules)) { if ($coversAll) { $addThis='if (document.checkout_payment.cot_gv.checked) { payment_value='cot_gv'; } else '; } else { $addThis=''; The problem with this awkward bit of code is that it is code creating javascript code. That code has quotes in it itself, so it f**** up the quoted string. To fix it, simply escape the quotes around 'cot_gv' ie. make it '\cot_gv\' instead. That way PHP will read the quote as 'part of the string' not 'the end of a string'. Why not fix it instead of playing around with it. payment_value="cot_gv"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.