Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
naturenu

CCGV & payment.php

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×