Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

CCGV & payment.php


naturenu

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 months later...
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'.

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

  • 1 year later...

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";

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...